本文整理匯總了Java中org.openide.nodes.Node.EMPTY屬性的典型用法代碼示例。如果您正苦於以下問題:Java Node.EMPTY屬性的具體用法?Java Node.EMPTY怎麽用?Java Node.EMPTY使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類org.openide.nodes.Node
的用法示例。
在下文中一共展示了Node.EMPTY屬性的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: isEnabled
@Override
public boolean isEnabled() {
Browser browser = getBrowser();
if(browser == null) {
return false;
}
if(browser.getExplorerManager().getRootContext() == Node.EMPTY) {
return false;
}
Node[] nodes = getBrowser().getSelectedNodes();
if(nodes.length != 1) {
return false;
}
return nodes[0] instanceof RepositoryPathNode &&
((RepositoryPathNode) nodes[0]).getEntry().getSvnNodeKind() == SVNNodeKind.DIR;
}
示例2: findNode
private static Node findNode(File f) {
try {
if (f != null) {
final FileObject fo = FileUtil.toFileObject(f);
if (fo != null) {
return DataObject.find(fo).getNodeDelegate();
}
}
} catch (DataObjectNotFoundException ex) {
Exceptions.printStackTrace(ex);
}
return Node.EMPTY;
}
示例3: createLibraryPackageViewNode
private Node createLibraryPackageViewNode(FileObject jfo) {
Icon icon = getLibrariesIcon();
FileObject root = FileUtil.getArchiveRoot(jfo);
if (root == null) {
return Node.EMPTY;
}
String name = String.format(getMessage("LBL_WrappedLibraryFmt"), FileUtil.toFile(jfo).getName());
return ActionFilterNode.create(PackageView.createPackageView(new LibrariesSourceGroup(root, name, icon, icon)));
}
示例4: getHelp
/** Help for this panel.
* @return the help or <code>null</code> if no help is supplied
*/
public HelpCtx getHelp () {
if (templateWizard1UI != null) {
if (templateWizard1UI.getExplorerManager().getRootContext() != Node.EMPTY) {
return new HelpCtx(TemplateWizard1.class.getName()+"."+ // NOI18N
templateWizard1UI.getExplorerManager().getRootContext().getName());
}
}
return new HelpCtx (TemplateWizard1.class);
}
示例5: setRootElement
public void setRootElement(ElementNode.Description elementDescription, boolean singleSelection) {
Node n;
if ( elementDescription != null ) {
ElementNode en = new ElementNode(elementDescription);
en.setSingleSelection(singleSelection);
n = en;
}
else {
n = Node.EMPTY;
}
manager.setRootContext(n);
}
示例6: logicalViewForProject
@NonNull
final Node logicalViewForProject(
@NonNull final Project project,
final Union2<LogicalViewProvider,org.openide.util.Pair<Sources,SourceGroup[]>> data,
final boolean[] projectInLookup) {
Node node;
if (!data.hasFirst()) {
LOG.log(
Level.WARNING,
"Warning - project of {0} in {1} failed to supply a LogicalViewProvider in its lookup", // NOI18N
new Object[]{
project.getClass(),
FileUtil.getFileDisplayName(project.getProjectDirectory())
});
final Sources sources = data.second().first();
final SourceGroup[] groups = data.second().second();
sources.removeChangeListener(this);
sources.addChangeListener(this);
if (groups.length > 0) {
node = PhysicalView.createNodeForSourceGroup(groups[0], project);
} else {
node = Node.EMPTY;
}
} else {
final LogicalViewProvider lvp = data.first();
node = lvp.createLogicalView();
if (!project.equals(node.getLookup().lookup(Project.class))) {
// Various actions, badging, etc. are not going to work.
LOG.log(
Level.WARNING,
"Warning - project {0} failed to supply itself in the lookup of the root node of its own logical view", // NOI18N
ProjectUtils.getInformation(project).getName());
//#114664
if (projectInLookup != null) {
projectInLookup[0] = false;
}
}
}
node.addNodeListener(WeakListeners.create(NodeListener.class, this, node));
return node;
}