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


Java HelpCtx.getHelpID方法代碼示例

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


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

示例1: testGetHelpCtx

import org.openide.util.HelpCtx; //導入方法依賴的package包/類
public void testGetHelpCtx() throws Exception {
    final MVElem elem1 = new MVElem(new Action[] {new Act1("act1")} );
    final MVElem elem2 = new MVElem(new Action[] {new Act1("act2")} );
    MultiViewDescription desc1 = new MVDesc("desc1", null, 0, elem1);
    MultiViewDescription desc2 = new MVDesc("desc2", null, 0, elem2);
    MultiViewDescription[] descs = new MultiViewDescription[] { desc1, desc2 };
    TopComponent tc = callFactory(descs, desc2);
    
    tc.open();
    HelpCtx help = tc.getHelpCtx();
    MultiViewHandler hand = MultiViews.findMultiViewHandler(tc);
    
    assertNotNull(help);
    Object name = help.getHelpID();
    assertEquals(desc2, Accessor.DEFAULT.extractDescription(hand.getSelectedPerspective()));
    assertEquals("desc2", name);
    
    hand.requestActive(Accessor.DEFAULT.createPerspective(desc1));
    help = tc.getHelpCtx();
    assertNotNull(help);
    name = help.getHelpID();
    assertEquals("desc1", name);
    
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:25,代碼來源:AbstractMultiViewTopComponentTestCase.java

示例2: display

import org.openide.util.HelpCtx; //導入方法依賴的package包/類
@Override public boolean display(HelpCtx help) {
    String id = help.getHelpID();
    if (id != null) {
        if (isValidID(id, true)) {
            showHelp(help, true);
            return true;
        } else {
            return false;
        }
    } else {
        URL u = help.getHelp();
        if (u != null) {
            // or use URLDisplayer?
            showHelp(u);
            return true;
        } else {
            return false;
        }
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:21,代碼來源:JavaHelp.java

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

示例4: Bridge

import org.openide.util.HelpCtx; //導入方法依賴的package包/類
/** @param comp component
* @param action the action
*/
public Bridge(JComponent comp, Action action) {
    if(comp == null || action == null) {
        throw new IllegalArgumentException(
            "None of the arguments can be null: comp=" + comp + //NOI18N
            ", action=" + action); // NOI18N
    }
    this.comp = comp;
    this.action = action;

    actionL = WeakListeners.propertyChange(this, action);

    // associate context help, if applicable
    // [PENDING] probably belongs in ButtonBridge.updateState to make it dynamic
    HelpCtx help = findHelp(action);

    if ((help != null) && !help.equals(HelpCtx.DEFAULT_HELP) && (help.getHelpID() != null)) {
        HelpCtx.setHelpIDString(comp, help.getHelpID());
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:23,代碼來源:Actions.java

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

示例6: Menu

import org.openide.util.HelpCtx; //導入方法依賴的package包/類
/** Constructor that permits specification of the action on the node,
 * and permits overriding the name and icon of the menu.
 *
 * @param node node to represent
 * @param action action called when node selected
 * @param setName <code>true</code> to automatically set the name and icon of the item
 */
public Menu(final Node node, NodeAcceptor action, boolean setName) {
    this.node = node;
    this.action = action;

    if (setName) {
        MenuItem.initialize(this, node);

        HelpCtx help = node.getHelpCtx();

        if ((help != null) && !help.equals(HelpCtx.DEFAULT_HELP) && (help.getHelpID() != null)) {
            HelpCtx.setHelpIDString(this, help.getHelpID());
        }
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:22,代碼來源:MenuView.java

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


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