本文整理汇总了Java中org.openide.loaders.DataFolder.getNodeDelegate方法的典型用法代码示例。如果您正苦于以下问题:Java DataFolder.getNodeDelegate方法的具体用法?Java DataFolder.getNodeDelegate怎么用?Java DataFolder.getNodeDelegate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.openide.loaders.DataFolder
的用法示例。
在下文中一共展示了DataFolder.getNodeDelegate方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getDataFolderNodeDelegate
import org.openide.loaders.DataFolder; //导入方法依赖的package包/类
private Node getDataFolderNodeDelegate() {
DataFolder df = getLookup().lookup(DataFolder.class);
try {
if (df.isValid()) {
return df.getNodeDelegate();
}
} catch (IllegalStateException e) {
//The data systems API is not thread save,
//the DataObject may become invalid after isValid call and before
//getNodeDelegate call, we have to catch the ISE. When the DataObject
//is valid - other cause rethrow it otherwise return leaf node.
//todo: The DataObject.getNodedelegate should throw specialized exception type.
if (df.isValid()) {
throw e;
}
}
return new AbstractNode(Children.LEAF);
}
示例2: GroupNode
import org.openide.loaders.DataFolder; //导入方法依赖的package包/类
public GroupNode(Project project, SourceGroup group, boolean isProjectDir, DataFolder dataFolder ) {
super( dataFolder.getNodeDelegate(),
dataFolder.createNodeChildren( VISIBILITY_QUERY_FILTER ),
createLookup(project, group, dataFolder, isProjectDir));
this.pi = ProjectUtils.getInformation( project );
this.group = group;
this.isProjectDir = isProjectDir;
if(isProjectDir) {
LogicalViewProvider lvp = project.getLookup().lookup(LogicalViewProvider.class);
// used to retrieve e.g. actions in case of a folder representing a project,
// so that a projects context menu is the same is in a logical view
this.projectDelegateNode = lvp != null ? lvp.createLogicalView() : null;
} else {
this.projectDelegateNode = null;
}
pi.addPropertyChangeListener(WeakListeners.propertyChange(this, pi));
group.addPropertyChangeListener( WeakListeners.propertyChange( this, group ) );
}
示例3: PackageNode
import org.openide.loaders.DataFolder; //导入方法依赖的package包/类
public PackageNode( FileObject root, DataFolder dataFolder, boolean empty ) {
super( dataFolder.getNodeDelegate(),
empty ? Children.LEAF : dataFolder.createNodeChildren( NO_FOLDERS_FILTER ),
new ProxyLookup(
Lookups.singleton(new NoFoldersContainer (dataFolder)),
dataFolder.getNodeDelegate().getLookup(),
Lookups.singleton(SearchInfoDefinitionFactory.createFlatSearchInfo(
dataFolder.getPrimaryFile()))));
this.root = root;
this.dataFolder = dataFolder;
this.isDefaultPackage = root.equals( dataFolder.getPrimaryFile() );
this.accRes = new AtomicReference<>();
}
示例4: getDataFolderNodeDelegate
import org.openide.loaders.DataFolder; //导入方法依赖的package包/类
@NonNull
private Node getDataFolderNodeDelegate() {
final DataFolder df = getLookup().lookup(DataFolder.class);
try {
if (df.isValid()) {
return df.getNodeDelegate();
}
} catch (IllegalStateException e) {
if (df.isValid()) {
throw e;
}
}
return new AbstractNode(Children.LEAF);
}
示例5: testGetNodesForAFolderExtjava
import org.openide.loaders.DataFolder; //导入方法依赖的package包/类
public void testGetNodesForAFolderExtjava() throws Exception {
CountingSecurityManager.initialize(getWorkDirPath());
long now = System.currentTimeMillis();
DataFolder f = DataFolder.findFolder(root);
Node n = f.getNodeDelegate();
Node[] arr = n.getChildren().getNodes(true);
assertEquals("1000 nodes", 1000, arr.length);
CountingSecurityManager.assertCounts("About 1000 * 4?", 4000, len);
}
示例6: testGetNodesForAFolderExtxml
import org.openide.loaders.DataFolder; //导入方法依赖的package包/类
public void testGetNodesForAFolderExtxml() throws Exception {
CountingSecurityManager.initialize(getWorkDirPath());
long now = System.currentTimeMillis();
DataFolder f = DataFolder.findFolder(root);
Node n = f.getNodeDelegate();
Node[] arr = n.getChildren().getNodes(true);
assertEquals("1000 nodes", 1000, arr.length);
CountingSecurityManager.assertCounts("About 1000 * 11?", 11000, len);
}
示例7: getTemplateRootNode
import org.openide.loaders.DataFolder; //导入方法依赖的package包/类
static Node getTemplateRootNode () {
if (templatesRootNode == null) {
DataFolder df = DataFolder.findFolder (getTemplatesRoot ());
templatesRootNode = new TemplateNode (new FilterNode (df.getNodeDelegate (), df.createNodeChildren (new TemplateFilter ())));
}
return templatesRootNode;
}
示例8: TreeRootNode
import org.openide.loaders.DataFolder; //导入方法依赖的package包/类
private TreeRootNode(DataFolder folder, SourceGroup g, boolean reduced) {
this(new FilterNode(folder.getNodeDelegate(), reduced ? Children.LEAF : folder.createNodeChildren(new GroupDataFilter(g))), folder, g, reduced);
}
示例9: PackageFilterNode
import org.openide.loaders.DataFolder; //导入方法依赖的package包/类
PackageFilterNode(DataFolder folder, DataFolder parent, ChangeableDataFilter filter, SourceGroup g) {
super(folder.getNodeDelegate(), Children.create(new ReducedChildren(folder, filter, g), true));
testPackageAction = FileSensitiveActions.fileCommandAction(ActionProvider.COMMAND_TEST_SINGLE, NbBundle.getMessage(TreeRootNode.class, "LBL_TestPackageAction_Name"), null);
this.parent = parent;
this.g = g;
}
示例10: ActionsPoolChildren
import org.openide.loaders.DataFolder; //导入方法依赖的package包/类
/** @param or original node to take children from */
public ActionsPoolChildren (DataFolder folder) {
super(folder.getNodeDelegate ());
}
示例11: ViewItemNode
import org.openide.loaders.DataFolder; //导入方法依赖的package包/类
public ViewItemNode(DataFolder folder, String includes, String excludes, String name, String displayName) {
super(folder.getNodeDelegate(), folder.createNodeChildren(new GroupDataFilter(folder.getPrimaryFile(), includes, excludes)));
this.name = name;
this.displayName = displayName;
}
示例12: Ch
import org.openide.loaders.DataFolder; //导入方法依赖的package包/类
/** @param or original node to take children from */
public Ch (DataFolder folder) {
super(folder.getNodeDelegate ());
}