當前位置: 首頁>>代碼示例>>Java>>正文


Java HelpCtx.findHelp方法代碼示例

本文整理匯總了Java中org.openide.util.HelpCtx.findHelp方法的典型用法代碼示例。如果您正苦於以下問題:Java HelpCtx.findHelp方法的具體用法?Java HelpCtx.findHelp怎麽用?Java HelpCtx.findHelp使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.openide.util.HelpCtx的用法示例。


在下文中一共展示了HelpCtx.findHelp方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: findHelpCtx

import org.openide.util.HelpCtx; //導入方法依賴的package包/類
private static HelpCtx findHelpCtx() {

        final TopComponent activeTC = TopComponent.getRegistry().getActivated();
        final Window win = WindowActivatedDetector.getCurrentActivatedWindow();
        final Container cont;
        if (activeTC != null && win != null && win.isAncestorOf(activeTC)) {
            cont = activeTC;
        } else {
            cont = win;
        }
        if (cont == null) {
            return HelpCtx.DEFAULT_HELP;
        } else {
            Component focused = SwingUtilities.findFocusOwner(cont);
            HelpCtx help = HelpCtx.findHelp(focused == null ? cont : focused);
            Installer.log.log(Level.FINE, "HelpCtx {0} from {1}",
                    new Object[]{help, focused});
            return help;
        }
    }
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:21,代碼來源:HelpAction.java

示例2: updateHelp

import org.openide.util.HelpCtx; //導入方法依賴的package包/類
private void updateHelp() {
    //System.err.println ("Updating help for NbDialog...");
    HelpCtx help = getHelpCtx();
    // Handle help from the inner component automatically (see docs
    // in DialogDescriptor):
    if (HelpCtx.DEFAULT_HELP.equals(help)) {
        Object msg = descriptor.getMessage();
        if (msg instanceof Component) {
            help = HelpCtx.findHelp((Component) msg);
        }
        if (HelpCtx.DEFAULT_HELP.equals(help)) help = null;
    }
    if (! Utilities.compareObjects(currentHelp, help)) {
        currentHelp = help;
        if (help != null && help.getHelpID() != null) {
            //System.err.println ("New help ID for root pane: " + help.getHelpID ());
            HelpCtx.setHelpIDString(getRootPane(), help.getHelpID());
        }
        // Refresh button list if it had already been created.
        if (haveCalledInitializeButtons) initializeButtons();
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:23,代碼來源:NbPresenter.java

示例3: updateHelpAndAccessibleDescription

import org.openide.util.HelpCtx; //導入方法依賴的package包/類
private void updateHelpAndAccessibleDescription() {
    HelpCtx.setHelpIDString(this, null);
    int i = editorsCombo.getSelectedIndex();
    HelpCtx helpCtx = i < 0 ? null : HelpCtx.findHelp(cardPanel.getComponent(i));
    String helpID = helpCtx != null && helpCtx != HelpCtx.DEFAULT_HELP ? helpCtx.getHelpID() : "f1_mat_prop_html"; // NOI18N
    HelpCtx.setHelpIDString(this, helpID);

    updateAccessibleDescription(i < 0 ? null : cardPanel.getComponent(i));
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:10,代碼來源:FormCustomEditor.java

示例4: actionPerformed

import org.openide.util.HelpCtx; //導入方法依賴的package包/類
@Override public void actionPerformed(ActionEvent ev) {
    Help h = (Help)Lookup.getDefault().lookup(Help.class);
    if (h == null) {
        Toolkit.getDefaultToolkit().beep();
        return;
    }

    HelpCtx help;
    
    final MenuElement[] path =
        MenuSelectionManager.defaultManager().getSelectedPath();

    if (path != null
        && path.length > 0
        && !(path[0].getComponent() instanceof javax.swing.plaf.basic.ComboPopup)
        ) {
        help = HelpCtx.findHelp(path[path.length - 1].getComponent());
        
        SwingUtilities.invokeLater(new Runnable() {
            public void run() {
                MenuElement[] newPath =
                    MenuSelectionManager.defaultManager().getSelectedPath();

                if (newPath.length != path.length)
                    return;
                for (int i = 0; i < newPath.length; i++) {
                    if (newPath[i] != path[i])
                        return;
                }
                MenuSelectionManager.defaultManager().clearSelectedPath();
            }
        });
    }
    else {
        help = findHelpCtx();
    }
    
    StatusDisplayer.getDefault().setStatusText(NbBundle.getMessage(HelpAction.class, "CTL_OpeningHelp"));
    h.showHelp (help);
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:41,代碼來源:HelpAction.java

示例5: getHelpCtx

import org.openide.util.HelpCtx; //導入方法依賴的package包/類
public HelpCtx getHelpCtx () {
    try {
        //??? eliminate recursion it delegates to parent (this)
        if (active) return null;
        active = true;
        return HelpCtx.findHelp(innerComp);  
    } finally  {
        active = false;
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:11,代碼來源:NodeOperationImpl.java

示例6: getHelpCtx

import org.openide.util.HelpCtx; //導入方法依賴的package包/類
@Override
public HelpCtx getHelpCtx() {
    HelpCtx h = HelpCtx.findHelp(bean);

    if (h != HelpCtx.DEFAULT_HELP) {
        return h;
    } else {
        return new HelpCtx(BeanNode.class);
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:11,代碼來源:BeanNode.java

示例7: setCategory

import org.openide.util.HelpCtx; //導入方法依賴的package包/類
private void setCategory(final ProjectCustomizer.Category newCategory) {
    if ( newCategory == null ) {
        return;
    }
    
    if ( currentCustomizer != null ) {
        customizerPanel.remove( currentCustomizer );
    }

    JComponent newCustomizer = panelCache.get(newCategory);
    if (newCustomizer == null && !panelCache.containsKey(newCustomizer)) {
        newCustomizer = componentProvider.create( newCategory );
        panelCache.put(newCategory, newCustomizer);
    }

    if ( newCustomizer != null ) {
        Utilities.getCategoryChangeSupport(newCategory).addPropertyChangeListener(new PropertyChangeListener() {
            public @Override void propertyChange(PropertyChangeEvent evt) {
                setErrorMessage(newCategory.getErrorMessage(), newCategory.isValid());
            }
        });
        currentCustomizer = newCustomizer;            
        currentHelpCtx = HelpCtx.findHelp( currentCustomizer );
        /*if (previousDimension == null) {
            previousDimension = currentCustomizer.getSize();
        }
        int newWidth = 0;
        int newHeight = 0;
        if (previousDimension != null) {
            newWidth = previousDimension.width;
            newHeight = previousDimension.height;
            if (currentCustomizer.getPreferredSize().width > previousDimension.width) {
                newWidth = currentCustomizer.getPreferredSize().width;
                int maxWidth = WindowManager.getDefault().getMainWindow().getGraphicsConfiguration().getBounds().width * 3 / 4;
                if (newWidth > maxWidth) {
                    newWidth = maxWidth;
                }
            }
            if (currentCustomizer.getPreferredSize().height > previousDimension.height) {
                newHeight = currentCustomizer.getPreferredSize().height;
                int maxHeght = WindowManager.getDefault().getMainWindow().getGraphicsConfiguration().getBounds().height * 3 / 4;
                if (newHeight > maxHeght) {
                    newHeight = maxHeght;
                }
            }
        }

        Dimension newDim = new Dimension(newWidth, newHeight);
        currentCustomizer.setPreferredSize(newDim);
        previousDimension = newDim;*/

        /*Preferences prefs = NbPreferences.forModule(org.netbeans.modules.project.uiapi.CustomizerPane.class);
        prefs.put(CUSTOMIZER_DIALOG_WIDTH, Integer.toString(newDim.width));
        prefs.put(CUSTOMIZER_DIALOG_HEIGHT, Integer.toString(newDim.height));*/

        customizerPanel.add( currentCustomizer, fillConstraints );
        customizerPanel.validate();
        customizerPanel.repaint();

        /*if (customizerPanel != null) {
            Window window = SwingUtilities.getWindowAncestor(customizerPanel);
            if (window != null) {
                window.pack();
                window.setBounds(org.openide.util.Utilities.findCenterBounds(window.getSize()));
            }
        }*/
        
        setErrorMessage(newCategory.getErrorMessage(), newCategory.isValid());
        firePropertyChange( HELP_CTX_PROPERTY, null, getHelpCtx() );
    } else {
        currentCustomizer = null;
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:74,代碼來源:CustomizerPane.java

示例8: setHelpToChooser

import org.openide.util.HelpCtx; //導入方法依賴的package包/類
private void setHelpToChooser( JFileChooser chooser ) {
    HelpCtx help = HelpCtx.findHelp( this );
    if ( help != null )
        HelpCtx.setHelpIDString(chooser, help.getHelpID());
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:6,代碼來源:NbClassPathCustomEditor.java

示例9: update

import org.openide.util.HelpCtx; //導入方法依賴的package包/類
private void update (BreakpointType t) {
    if (type == t) return ;
    pEvent.removeAll ();
    DebuggerManager d = DebuggerManager.getDebuggerManager ();
    BreakpointType old = type;
    type = t;
    customizer = type.getCustomizer ();
    if (customizer == null) return;

    //Set HelpCtx. This method must be called _before_ the customizer
    //is added to some container, otherwise HelpCtx.findHelp(...) would
    //query also the customizer's parents.
    // <RAVE>
    // The help IDs for the customizer panels have to be different from the
    // values returned by getHelpCtx() because they provide different help
    // in the 'Add Breakpoint' dialog and when invoked in the 'Breakpoints' view
    // helpCtx = HelpCtx.findHelp (customizer);
    // ====
    String hid = (String) customizer.getClientProperty("HelpID_AddBreakpointPanel"); // NOI18N
    if (hid != null) {
        helpCtx = new HelpCtx(hid);
    } else {
        helpCtx = HelpCtx.findHelp (customizer);
    }
    // </RAVE>

    pEvent.add (customizer, "Center"); // NOI18N
    pEvent.getAccessibleContext ().setAccessibleDescription (
        customizer.getAccessibleContext ().getAccessibleDescription ()
    );
    customizer.getAccessibleContext ().setAccessibleName (
        pEvent.getAccessibleContext ().getAccessibleName ()
    );
    revalidate ();
    SwingUtilities.invokeLater(new Runnable() {
        @Override
        public void run() {
            Window w = SwingUtilities.windowForComponent (AddBreakpointPanel.this);
            if (w == null) return;
            w.pack ();
        }
    });
    firePropertyChange (PROP_TYPE, old, type);
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:45,代碼來源:AddBreakpointPanel.java


注:本文中的org.openide.util.HelpCtx.findHelp方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。