当前位置: 首页>>代码示例>>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;未经允许,请勿转载。