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


Java HelpCtx.setHelpIDString方法代碼示例

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


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

示例1: 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

示例2: SourceWizardPanel

import org.openide.util.HelpCtx; //導入方法依賴的package包/類
/** Creates new form SourceChooserPanel.
 * @param it's panel wizard descriptor */
private SourceWizardPanel(Panel descPanel, boolean testRole) {
    this.descPanel = descPanel;
    this.testRole = testRole;
    
    initComponents();        

    initAccessibility ();
    
    setPreferredSize(I18nWizardDescriptor.PREFERRED_DIMENSION);
    
    initList();
    
    putClientProperty(WizardDescriptor.PROP_CONTENT_SELECTED_INDEX, Integer.valueOf(0));
    
    if (testRole) {
        setName(Util.getString("TXT_SelecTestSources"));            //NOI18N
        HelpCtx.setHelpIDString(this, Util.HELP_ID_SELECTTESTSOURCES);
    } else {
        setName(Util.getString("TXT_SelectSources"));               //NOI18N
        HelpCtx.setHelpIDString(this, Util.HELP_ID_SELECTSOURCES);
    }        
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:25,代碼來源:SourceWizardPanel.java

示例3: HelpStringCustomEditor

import org.openide.util.HelpCtx; //導入方法依賴的package包/類
/** Creates new form CodeCustomEditor.
     * @param value value to be customized 
     * @param items for sleecteing in combo box
     * @param helpItems patterns described in list
     * @param comboText label for the combo-box, optionally with an ampersand marking the mnemonic character
     */
    public HelpStringCustomEditor(String value, List items, List helpItems, String comboText, String helpID) {
        initComponents();
        
        combo.setModel(new DefaultComboBoxModel(items.toArray()));
        combo.setSelectedItem(value);

        list.setListData(helpItems.toArray());
        list.setBackground(javax.swing.UIManager.getDefaults().getColor("TextField..disabledBackground")); // NOI18N
//        list.setBackground(new Color(SystemColor.window.getRGB()));
        
        Mnemonics.setLocalizedText(comboLabel, comboText);
        Mnemonics.setLocalizedText(listLabel, I18nUtil.getBundle().getString("LBL_Arguments"));
        
        initAccessibility ();     
        
        HelpCtx.setHelpIDString(this, helpID);
    }
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:24,代碼來源:HelpStringCustomEditor.java

示例4: addNotify

import org.openide.util.HelpCtx; //導入方法依賴的package包/類
@Override
public void addNotify () {
    super.addNotify ();
    //show progress for initialize method
    final Window w = findWindowParent ();
    if (w != null) {
        w.addWindowListener (new WindowAdapter (){
            @Override
            public void windowOpened (WindowEvent e) {
                final WindowAdapter waa = this;
                setWaitingState (true);
                Utilities.startAsWorkerThread (PluginManagerUI.this,
                        new Runnable () {
                            @Override
                            public void run () {
                                try {
                                    initTask.waitFinished ();
                                    w.removeWindowListener (waa);
                                } finally {
                                    setWaitingState (false);
                                }
                            }
                        },
                        NbBundle.getMessage (PluginManagerUI.class, "UnitTab_InitAndCheckingForUpdates"),
                        Utilities.getTimeOfInitialization ());
            }
        });
    }
    HelpCtx.setHelpIDString (this, PluginManagerUI.class.getName ());
    tpTabs.addChangeListener (new ChangeListener () {
        @Override
        public void stateChanged (ChangeEvent evt) {
            HelpCtx.setHelpIDString (PluginManagerUI.this, getHelpCtx ().getHelpID ());
        }
    });
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:37,代碼來源:PluginManagerUI.java

示例5: CustomEditor

import org.openide.util.HelpCtx; //導入方法依賴的package包/類
/** Constructor. */
public CustomEditor(I18nString i18nString, Project project, FileObject file) {
    super(i18nString.getSupport().getPropertyPanel(), false, project, file);
    setI18nString(i18nString);
    bundle = NbBundle.getBundle(FormI18nMnemonicEditor.class);
    env.setState(PropertyEnv.STATE_NEEDS_VALIDATION);
    env.addVetoableChangeListener(this);

    HelpCtx.setHelpIDString(this, I18nUtil.HELP_ID_FORMED);
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:11,代碼來源:FormI18nMnemonicEditor.java

示例6: createAnchoringSubmenu

import org.openide.util.HelpCtx; //導入方法依賴的package包/類
private void createAnchoringSubmenu(JMenu menu) {
    Node[] nodes = getActivatedNodes();
    List components = FormUtils.getSelectedLayoutComponents(nodes);
    if ((components == null) || (components.size() < 1)) {
        return;
    }
    if (!(menu.getMenuComponentCount() > 0)) {
        ResourceBundle bundle = NbBundle.getBundle(SetAnchoringAction.class);

        JCheckBoxMenuItem leftItem = new AnchoringMenuItem(
                bundle.getString("CTL_AnchorLeft"), // NOI18N
                components,
                0);
        JCheckBoxMenuItem rightItem = new AnchoringMenuItem(
                bundle.getString("CTL_AnchorRight"), // NOI18N
                components,
                1);
        JCheckBoxMenuItem topItem = new AnchoringMenuItem(
                bundle.getString("CTL_AnchorTop"), // NOI18N
                components,
                2);
        JCheckBoxMenuItem bottomItem = new AnchoringMenuItem(
                bundle.getString("CTL_AnchorBottom"), // NOI18N
                components,
                3);
        items = new JCheckBoxMenuItem[] {leftItem, rightItem, topItem, bottomItem};
        for (int i=0; i<4; i++) {
            items[i].addActionListener(getMenuItemListener());
            HelpCtx.setHelpIDString(items[i], SetAnchoringAction.class.getName());
            menu.add(items[i]);
        }
    }        
    updateState(components);
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:35,代碼來源:SetAnchoringAction.java

示例7: getPopupPresenter

import org.openide.util.HelpCtx; //導入方法依賴的package包/類
@Override
public JMenuItem getPopupPresenter() {
    JMenu layoutMenu = new LayoutMenu(getName());
    layoutMenu.setEnabled(isEnabled());
    HelpCtx.setHelpIDString(layoutMenu, SelectLayoutAction.class.getName());
    return layoutMenu;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:8,代碼來源:SelectLayoutAction.java

示例8: CustomEditor

import org.openide.util.HelpCtx; //導入方法依賴的package包/類
/** Constructor. */
public CustomEditor(I18nString i18nString, Project project, FileObject file) {
    super(i18nString.getSupport().getPropertyPanel(), false, project, file);
    bundle = NbBundle.getBundle(FormI18nIntegerEditor.class);
    setI18nString(i18nString);
    env.setState(PropertyEnv.STATE_NEEDS_VALIDATION);
    env.addVetoableChangeListener(this);

    HelpCtx.setHelpIDString(this, I18nUtil.HELP_ID_FORMED);
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:11,代碼來源:FormI18nIntegerEditor.java

示例9: createResizabilitySubmenu

import org.openide.util.HelpCtx; //導入方法依賴的package包/類
private void createResizabilitySubmenu(JMenu menu) {
    Node[] nodes = getActivatedNodes();
    List components = FormUtils.getSelectedLayoutComponents(nodes);
    if ((components == null) || (components.size() < 1)) {
        return;
    }
    if (!(menu.getMenuComponentCount() > 0)) {
        ResourceBundle bundle = NbBundle.getBundle(SetResizabilityAction.class);

        JCheckBoxMenuItem hItem = new ResizabilityMenuItem(
                bundle.getString("CTL_ResizabilityH"), // NOI18N
                components,
                0);
        JCheckBoxMenuItem vItem = new ResizabilityMenuItem(
                bundle.getString("CTL_ResizabilityV"), // NOI18N
                components,
                1);
        items = new JCheckBoxMenuItem[] {hItem, vItem};
        
        for (int i=0; i<2; i++) {
            items[i].addActionListener(getMenuItemListener());
            HelpCtx.setHelpIDString(items[i], SetResizabilityAction.class.getName());
            menu.add(items[i]);
        }
    }
    updateState(components);
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:28,代碼來源:SetResizabilityAction.java

示例10: getPopupPresenter

import org.openide.util.HelpCtx; //導入方法依賴的package包/類
/**
 * Returns a JMenuItem that presents this action in a Popup Menu.
 * @return the JMenuItem representation for the action
 */
@Override
public JMenuItem getPopupPresenter() {
    JMenu popupMenu = new JMenu(
            NbBundle.getMessage(DesignParentAction.class, "ACT_DesignParentAction")); // NOI18N
    
    popupMenu.setEnabled(isEnabled());
    HelpCtx.setHelpIDString(popupMenu, DesignParentAction.class.getName());
    createSubmenu(popupMenu);
    return popupMenu;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:15,代碼來源:DesignParentAction.java

示例11: testFindHelpHierarchically

import org.openide.util.HelpCtx; //導入方法依賴的package包/類
public void testFindHelpHierarchically() throws Exception {
    ExplorerPanel p = new ExplorerPanel();
    p.setLayout(new BorderLayout());
    BeanTreeView b = new BeanTreeView();
    p.add(b, BorderLayout.CENTER);
    JLabel l1 = new JLabel("test1");
    HelpCtx.setHelpIDString(l1, "test");
    p.add(l1, BorderLayout.NORTH);
    JLabel l2 = new JLabel("test2");
    assertEquals(HelpCtx.DEFAULT_HELP, HelpCtx.findHelp(l2));
    p.add(l2, BorderLayout.SOUTH);
    ExplorerManager m = p.getExplorerManager();
    m.setRootContext(root);
    assertEquals(Collections.EMPTY_LIST, Arrays.asList(m.getSelectedNodes()));
    HelpCtx base = new HelpCtx(ExplorerPanel.class);
    assertEquals(base, HelpCtx.findHelp(b));
    m.setSelectedNodes(new Node[] {nodes[0]});
    assertEquals(base, HelpCtx.findHelp(b));
    m.setSelectedNodes(new Node[] {nodes[1]});
    assertEquals(new HelpCtx("foo"), HelpCtx.findHelp(b));
    m.setSelectedNodes(new Node[] {nodes[1], nodes[2]});
    assertEquals(base, HelpCtx.findHelp(b));
    m.setSelectedNodes(new Node[] {nodes[1], nodes[3]});
    assertEquals(new HelpCtx("foo"), HelpCtx.findHelp(b));
    assertEquals(new HelpCtx("foo"), HelpCtx.findHelp(p));
    assertEquals(new HelpCtx("test"), HelpCtx.findHelp(l1));
    assertEquals(new HelpCtx("foo"), HelpCtx.findHelp(l2));
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:29,代碼來源:FindHelpTest.java

示例12: 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

示例13: associateHelp

import org.openide.util.HelpCtx; //導入方法依賴的package包/類
private void associateHelp(JComponent comp, HelpCtx help) {
    if ((help != null) && !help.equals(HelpCtx.DEFAULT_HELP) && (help.getHelpID() != null)) {
        HelpCtx.setHelpIDString(comp, help.getHelpID());
    } else {
        HelpCtx.setHelpIDString(comp, null);
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:8,代碼來源:Actions.java

示例14: ConditionsPanel

import org.openide.util.HelpCtx; //導入方法依賴的package包/類
/** Creates new form ConditionsPanel */
public ConditionsPanel(String helpId) {
    initComponents();
    HelpCtx.setHelpIDString(tfCondition, helpId);
    tfConditionFieldForUI = new javax.swing.JTextField();
    tfConditionFieldForUI.setEnabled(false);
    tfConditionFieldForUI.setToolTipText(tfCondition.getToolTipText());
    
    classFilterCheckBoxActionPerformed(null);
    conditionCheckBoxActionPerformed(null);
    cbWhenHitCountActionPerformed(null);
    int preferredHeight = tfConditionFieldForUI.getPreferredSize().height;
    Dimension spDim = spCondition.getPreferredSize();
    if (spDim.height > preferredHeight) {
        preferredHeight = spDim.height;
        tfConditionFieldForUI.setPreferredSize(new java.awt.Dimension(tfConditionFieldForUI.getPreferredSize().width, preferredHeight));
    }
    Border b = spCondition.getBorder();
    if (b instanceof WatchPanel.DelegatingBorder) {
        Insets insets = ((WatchPanel.DelegatingBorder) b).getInsets();
        insets.right = 1;
        ((WatchPanel.DelegatingBorder) b).setInsets(insets);
    }
    spCondition.setPreferredSize(spDim);
    //spCondition.setMinimumSize(spDim);
    tfHitCountFilter.setPreferredSize(
            new Dimension(8*tfHitCountFilter.getFontMetrics(tfHitCountFilter.getFont()).charWidth('8'),
                          tfHitCountFilter.getPreferredSize().height));
    cbHitStyle.setModel(new javax.swing.DefaultComboBoxModel(new String[] {
        NbBundle.getMessage(ConditionsPanel.class, "ConditionsPanel.cbWhenHitCount.equals"), // NOI18N
        NbBundle.getMessage(ConditionsPanel.class, "ConditionsPanel.cbWhenHitCount.greater"), // NOI18N
        NbBundle.getMessage(ConditionsPanel.class, "ConditionsPanel.cbWhenHitCount.multiple") // NOI18N
    }));
    conditionComboBox.setEditor(new ConditionComboBoxEditor());
    Object[] conditions = getSavedConditions();
    conditionComboBox.setModel(new DefaultComboBoxModel(conditions));
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:38,代碼來源:ConditionsPanel.java

示例15: getMenuPresenter

import org.openide.util.HelpCtx; //導入方法依賴的package包/類
public JMenuItem getMenuPresenter() {
    // beware, we shouldn't cache menu intstance, because getMenuPresenter
    // can be legally called several times and menu component cannot be
    // contained in more than one component hierarchy
    JMenu menu = new org.openide.awt.JMenuPlus();
    Mnemonics.setLocalizedText(menu, getName());
    menu.setHorizontalTextPosition(JMenu.RIGHT);
    menu.setHorizontalAlignment(JMenu.LEFT);
    menu.setIcon(getIcon());
    HelpCtx.setHelpIDString(menu, WorkspaceSwitchAction.class.getName());

    final WindowManager pool = WindowManager.getDefault();

    final Hashtable menu2Workspace = new Hashtable(10);

    // ^ maps listener on workspace
    final Hashtable workspace2Menu = new Hashtable(10);

    // ^ maps workspace to menuitem
    final Hashtable workspace2Listener = new Hashtable(10);

    // ^ maps workspace to action listener
    final Workspace[] currentDeskRef = new Workspace[1];
    currentDeskRef[0] = pool.getCurrentWorkspace();

    // attach all workspaces
    Workspace[] workspaces = pool.getWorkspaces();

    for (int i = 0; i < workspaces.length; i++) {
        attachWorkspace(workspaces[i], currentDeskRef, workspace2Menu, menu2Workspace, workspace2Listener, menu);
    }

    // check on currently active workspace
    JRadioButtonMenuItem curItem = (JRadioButtonMenuItem) workspace2Menu.get(currentDeskRef[0]);

    if (curItem != null) {
        curItem.setSelected(true);
    }

    // listen to the changes in workspaces
    pool.addPropertyChangeListener(
        getWorkspacePoolListener(workspace2Menu, menu2Workspace, workspace2Listener, currentDeskRef, menu)
    );

    return menu;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:47,代碼來源:WorkspaceSwitchAction.java


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