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


Java Node.getHelpCtx方法代碼示例

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


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

示例1: testItemHelp

import org.openide.nodes.Node; //導入方法依賴的package包/類
public void testItemHelp() throws Exception {
    FileObject item1 = getItemFile( categoryNames[0], itemNames[0][0] );
    FileObject item2 = getItemFile( categoryNames[0], itemNames[0][1] );
    
    item1.setAttribute( PaletteController.ATTR_HELP_ID, "DummyHelpId" );
    
    PaletteController pc = PaletteFactory.createPalette( getRootFolderName(), new DummyActions() );
    Model model = pc.getModel();
    Category[] categories = model.getCategories();
    Item[] items = categories[0].getItems();
    
    Node node1 = items[0].getLookup().lookup( Node.class );
    Node node2 = items[1].getLookup().lookup( Node.class );
    
    HelpCtx help1 = node1.getHelpCtx();
    HelpCtx help2 = node2.getHelpCtx();

    assertEquals( "Custom help", "DummyHelpId", help1.getHelpID() );
    assertEquals( "Default help", HelpCtx.DEFAULT_HELP, help2 );
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:21,代碼來源:HelpTest.java

示例2: testCategoryHelp

import org.openide.nodes.Node; //導入方法依賴的package包/類
public void testCategoryHelp() throws Exception {
    FileObject cat1 = getCategoryFile( categoryNames[0] );
    FileObject cat2 = getCategoryFile( categoryNames[1] );
    
    cat1.setAttribute( PaletteController.ATTR_HELP_ID, "DummyHelpId" );
    
    PaletteController pc = PaletteFactory.createPalette( getRootFolderName(), new DummyActions() );
    Model model = pc.getModel();
    Category[] categories = model.getCategories();
    
    Node node1 = categories[0].getLookup().lookup( Node.class );
    Node node2 = categories[1].getLookup().lookup( Node.class );
    
    HelpCtx help1 = node1.getHelpCtx();
    HelpCtx help2 = node2.getHelpCtx();

    assertEquals( "Custom help", "DummyHelpId", help1.getHelpID() );
    assertNull( "Default help", help2 );
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:20,代碼來源:HelpTest.java

示例3: getHelpCtx

import org.openide.nodes.Node; //導入方法依賴的package包/類
public HelpCtx getHelpCtx () {
    Object o = getDataObject().getPrimaryFile().getAttribute(EA_HELPCTX);
    if (o != null) {
        return new HelpCtx(o.toString());
    }
    // now try the original DataObject (assume it is a folder-thing)
    HelpCtx ctx = getDataObject().getHelpCtx();
    if (ctx != null &&
        ctx != HelpCtx.DEFAULT_HELP &&
        !FOLDER_DEFAULT_HELP.equals(ctx)) {
        return ctx;
    }
    // try the parent node:
    Node n = getParentNode();
    if (n != null)
        ctx = n.getHelpCtx();
    return ctx;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:19,代碼來源:LookupNode.java

示例4: testRootHelpCustom

import org.openide.nodes.Node; //導入方法依賴的package包/類
public void testRootHelpCustom() throws Exception {
    paletteRootFolder.setAttribute( PaletteController.ATTR_HELP_ID, "DummyHelpId" );
    
    PaletteController pc = PaletteFactory.createPalette( getRootFolderName(), new DummyActions() );
    Model model = pc.getModel();
    Node node = model.getRoot().lookup( Node.class );
    
    HelpCtx help = node.getHelpCtx();

    assertEquals( "Custom help", "DummyHelpId", help.getHelpID() );
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:12,代碼來源:HelpTest.java

示例5: testRootHelpDefault

import org.openide.nodes.Node; //導入方法依賴的package包/類
public void testRootHelpDefault() throws Exception {
    PaletteController pc = PaletteFactory.createPalette( getRootFolderName(), new DummyActions() );
    Model model = pc.getModel();
    Node node = model.getRoot().lookup( Node.class );
    
    HelpCtx help = node.getHelpCtx();

    assertNull( "Custom help", help );
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:10,代碼來源:HelpTest.java


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