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


Java Node.EMPTY屬性代碼示例

本文整理匯總了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;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:16,代碼來源:CreateFolderAction.java

示例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;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:13,代碼來源:ClusterizeInfo.java

示例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)));
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:9,代碼來源:LibrariesNode.java

示例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);
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:12,代碼來源:TemplateWizardPanel1.java

示例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);
    
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:14,代碼來源:ElementSelectorPanel.java

示例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;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:41,代碼來源:ProjectsRootNode.java


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