本文整理匯總了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 );
}
示例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 );
}
示例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;
}
示例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() );
}
示例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 );
}