当前位置: 首页>>代码示例>>Java>>正文


Java NodeFactorySupport类代码示例

本文整理汇总了Java中org.netbeans.spi.project.ui.support.NodeFactorySupport的典型用法代码示例。如果您正苦于以下问题:Java NodeFactorySupport类的具体用法?Java NodeFactorySupport怎么用?Java NodeFactorySupport使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


NodeFactorySupport类属于org.netbeans.spi.project.ui.support包,在下文中一共展示了NodeFactorySupport类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: RootNode

import org.netbeans.spi.project.ui.support.NodeFactorySupport; //导入依赖的package包/类
@Messages({"# {0} - folder", "HINT_project_root_node=Module project in {0}"})
RootNode(@NonNull NbModuleProject project) {
    
    // XXX add a NodePathResolver impl to lookup
    super(NodeFactorySupport.createCompositeChildren(project, "Projects/org-netbeans-modules-apisupport-project/Nodes"), 
          Lookups.fixed(project, DataFolder.findFolder( project.getProjectDirectory() ),
            project.getProjectDirectory()));
    this.project = project;
    boolean osgi = false;
        Manifest man = project.getManifest();
        if (man != null) {
            Attributes attrs = man.getMainAttributes();
            if (attrs != null) {
                osgi = attrs.getValue(ManifestManager.BUNDLE_SYMBOLIC_NAME) != null;
            }
        }
    setIconBaseWithExtension(
        osgi ? NbModuleProject.NB_PROJECT_OSGI_ICON_PATH :
        NbModuleProject.NB_PROJECT_ICON_PATH
    );
    pi = ProjectUtils.getInformation(project); // must keep reference to PI, it is a wrapper and would be immediately GCed
    setDisplayName(pi.getDisplayName());
    setShortDescription(HINT_project_root_node(FileUtil.getFileDisplayName(project.getProjectDirectory())));
    pi.addPropertyChangeListener(WeakListeners.propertyChange(this, pi));
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:26,代码来源:ModuleLogicalView.java

示例2: createNodes

import org.netbeans.spi.project.ui.support.NodeFactorySupport; //导入依赖的package包/类
public NodeList createNodes(Project project) {

        this.proj = project;

        DataObject assetsFolder;
        try {
            //return a new node for the project view if theres an assets folder:
            ProjectAssetManager item = project.getLookup().lookup(ProjectAssetManager.class);
            if (item != null) {
                assetsFolder = DataObject.find(item.getAssetFolder());
                Node node = assetsFolder.getNodeDelegate();
//                return NodeFactorySupport.fixedNodeList(node);
                ProjectAssetsNode nd = new ProjectAssetsNode(item, proj, node);
//                return NodeFactorySupport.createCompositeChildren(project, item.getAssetFolderName());//fixedNodeList(nd);
                return NodeFactorySupport.fixedNodeList(nd);
            }
        } catch (Exception ex) {
            Exceptions.printStackTrace(ex);
        }

        //If our item isn't in the lookup,
        //then return an empty list of nodes:
        return NodeFactorySupport.fixedNodeList();

    }
 
开发者ID:jMonkeyEngine,项目名称:sdk,代码行数:26,代码来源:ProjectAssetsNodeFactory.java

示例3: beforeCreateNodesCheck

import org.netbeans.spi.project.ui.support.NodeFactorySupport; //导入依赖的package包/类
/**
 * Convenience implementation, that checks that the project has a proper
 * ProjectSubfolderProvider in its lookup. Extend this class, override
 * {@link #createNodes(org.netbeans.api.project.Project) } and first call
 * <code>super.createNodes(p)</code>. If you get a non-null result - return it
 * immediately, if you get null - create a proper NodeList.
 * <b>WARNING:</b><br/>
 * Never return null in your implementation!!!
 * @param p
 * @return null, if no errors were found in Project, or a NodeList, that you
 * should return, in case of errors.
 */
public NodeList<?> beforeCreateNodesCheck(Project p) {
    ProjectSubfolderProvider folderProvider = p.getLookup()
            .lookup(getProjectSubfolderProviderClass());

    if (folderProvider == null) {
        AbstractNode errorNode = new AbstractNode(Children.LEAF);
        Class<T> fp = getProjectSubfolderProviderClass();

        String errMsgShort = String.format("ERROR: An implementation of %s "
                + "can't be found in project's lookup.", fp.getCanonicalName());
        errorNode.setDisplayName(errMsgShort);

        String errMsgLong = String.format("%s You must register a %s in your"
                + "project's lookup. Use @ProjectServiceProvider annotation for that. "
                + "Or drag&drop an instance in layer.xml from an existing project type, "
                + "e.g. 'Projects/umich-ms-batmass-projects-types-proteomics-proteomicsproject/Lookup'"
                + " to your project type similar .../Lookup folder.",
                errMsgShort, fp.getSimpleName());
        Exceptions.printStackTrace(new IllegalStateException(errMsgLong));
        // Safety net - return a NodeList to make the error state clearly visible.
        // Also, we're not allowed to return null from this method.
        return NodeFactorySupport.fixedNodeList(errorNode);
    }
    return null;
}
 
开发者ID:chhh,项目名称:batmass,代码行数:38,代码来源:BMNodeFactory.java

示例4: ProjectNode

import org.netbeans.spi.project.ui.support.NodeFactorySupport; //导入依赖的package包/类
public ProjectNode(Node node, DlangProject project)
                    throws DataObjectNotFoundException {
//                super(node,
//                        new FilterNode.Children(node),
//                        new ProxyLookup(
//                                new Lookup[]{
//                                    Lookups.singleton(project),
//                                    node.getLookup()
//                                }));
                super(node,
                        NodeFactorySupport.createCompositeChildren(
                                project,
                                "Projects/org-dlang-project/Nodes"),
                        // new FilterNode.Children(node),
                        new ProxyLookup(
                                new Lookup[]{
                                    Lookups.singleton(project),
                                    node.getLookup()
                                }));
                this.project = project;
            }
 
开发者ID:Xianguang-Zhou,项目名称:netbeans-dlang-plugin,代码行数:22,代码来源:DlangProject.java

示例5: createNodes

import org.netbeans.spi.project.ui.support.NodeFactorySupport; //导入依赖的package包/类
public NodeList createNodes(Project project) {

//        this.proj = project;

            //If our item is in the project's lookup,
            //return a new node in the node list:
            ImportantFilesLookupItem item = project.getLookup().lookup(ImportantFilesLookupItem.class);
            if (item != null) {
                try {
                    ImportantFilesNode nd = new ImportantFilesNode(project);
                    return NodeFactorySupport.fixedNodeList(nd);
                } catch (DataObjectNotFoundException ex) {
                    Exceptions.printStackTrace(ex);
                }
            }

            //If our item isn't in the lookup,
            //then return an empty list of nodes:
            return NodeFactorySupport.fixedNodeList();

        }
 
开发者ID:chototsu,项目名称:MikuMikuStudio,代码行数:22,代码来源:ImportantFilesNode.java

示例6: SuiteRootNode

import org.netbeans.spi.project.ui.support.NodeFactorySupport; //导入依赖的package包/类
SuiteRootNode(final SuiteProject suite) {
    super(NodeFactorySupport.createCompositeChildren(suite, "Projects/org-netbeans-modules-apisupport-project-suite/Nodes"), 
          Lookups.fixed(new Object[] {suite, DataFolder.findFolder( suite.getProjectDirectory() ),
            suite.getProjectDirectory()}));
    this.suite = suite;
    info = ProjectUtils.getInformation(suite);
    info.addPropertyChangeListener(WeakListeners.propertyChange(this, info));
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:9,代码来源:SuiteLogicalView.java

示例7: createNodes

import org.netbeans.spi.project.ui.support.NodeFactorySupport; //导入依赖的package包/类
@Override
public NodeList createNodes(Project p) {
    if (p.getLookup().lookup(NbModuleProvider.class) != null) {
        return new ImpFilesNL(p);
    }
    return NodeFactorySupport.fixedNodeList();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:8,代码来源:ImportantFilesNodeFactory.java

示例8: createNodes

import org.netbeans.spi.project.ui.support.NodeFactorySupport; //导入依赖的package包/类
@Override
public NodeList createNodes(Project project) {
    NbMavenProjectImpl prj = project.getLookup().lookup(NbMavenProjectImpl.class);
    return NodeFactorySupport.fixedNodeList(new Node[] {
        new ProjectFilesNode(prj)
    });
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:8,代码来源:ProjectFilesNodeFactory.java

示例9: MavenProjectNode

import org.netbeans.spi.project.ui.support.NodeFactorySupport; //导入依赖的package包/类
public MavenProjectNode(Lookup lookup, NbMavenProjectImpl proj) {
    super(NodeFactorySupport.createCompositeChildren(proj, "Projects/org-netbeans-modules-maven/Nodes"), lookup); //NOI18N
    this.project = proj;
    info = ProjectUtils.getInformation(project);
    info.addPropertyChangeListener(new PropertyChangeListener() {
        @Override public void propertyChange(PropertyChangeEvent event) {
            String prop = event.getPropertyName();
            if (ProjectInformation.PROP_NAME.equals(prop)) {
                fireNameChange(null, null);
            } else if (ProjectInformation.PROP_DISPLAY_NAME.equals(prop)) {
                fireDisplayNameChange(null, getDisplayName());
            } else if (ProjectInformation.PROP_ICON.equals(prop)) {
                fireIconChange();
                fireOpenedIconChange();
            }
        }
    });
    proj.getLookup().lookup(ProjectProblemsProvider.class).addPropertyChangeListener(new PropertyChangeListener() {
         @Override
         public void propertyChange(PropertyChangeEvent evt) {
             if (ProjectProblemsProvider.PROP_PROBLEMS.equals(evt.getPropertyName())) {
                 SwingUtilities.invokeLater(new Runnable() {
                     @Override
                     public void run() {
                         fireNameChange(null, getName());
                         fireDisplayNameChange(null, getDisplayName());
                         fireShortDescriptionChange(null, getShortDescription());
                     }
                 });

             }
         }
     });
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:35,代码来源:MavenProjectNode.java

示例10: LogicalViewRootNode

import org.netbeans.spi.project.ui.support.NodeFactorySupport; //导入依赖的package包/类
@SuppressWarnings("LeakingThisInConstructor")
LogicalViewRootNode(@NonNull final Lookup lkp) {
    super(NodeFactorySupport.createCompositeChildren(
      project,
      String.format("Projects/%s/Nodes",projectType)),  //NOI18N
      lkp);
    broken = ProjectProblems.isBroken(project);
    compileOnSaveDisabled = isCompileOnSaveDisabled();
    addChangeListener(WeakListeners.change(this, LogicalViewProviderImpl.this));
    final ProjectInformation pi = project.getLookup().lookup(ProjectInformation.class);
    info = pi != null ? pi : new SimpleInfo(project);
    info.addPropertyChangeListener(WeakListeners.propertyChange(this, info));
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:14,代码来源:LogicalViewProviders.java

示例11: RootNode

import org.netbeans.spi.project.ui.support.NodeFactorySupport; //导入依赖的package包/类
@SuppressWarnings("LeakingThisInConstructor")
public RootNode(FreeformProject p) {
    super(NodeFactorySupport.createCompositeChildren(p, "Projects/org-netbeans-modules-ant-freeform/Nodes"), Lookups.singleton(p));
    this.p = p;
    info = ProjectUtils.getInformation(p);
    info.addPropertyChangeListener(WeakListeners.propertyChange(this, info));
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:8,代码来源:View.java

示例12: createNodes

import org.netbeans.spi.project.ui.support.NodeFactorySupport; //导入依赖的package包/类
@Override
public NodeList createNodes(Project project) {
    try {
        return NodeFactorySupport.fixedNodeList(new AssetNode(project),
                new ContentNode(project),
                new TemplatesNode(project),
                new PropertyNode(project));
    } catch (DataObjectNotFoundException ex) {
        Exceptions.printStackTrace(ex);
    }
    return NodeFactorySupport.fixedNodeList();
}
 
开发者ID:rajmahendra,项目名称:NetBeans-JBake-Plugin,代码行数:13,代码来源:JBakeNodeFactory.java

示例13: createNodes

import org.netbeans.spi.project.ui.support.NodeFactorySupport; //导入依赖的package包/类
public NodeList createNodes(Project project) {

//            ImportantFilesLookupItem item = project.getLookup().lookup(ImportantFilesLookupItem.class);
//            if (item != null) {
            try {
                ImportantFilesNode nd = new ImportantFilesNode(project);
                return NodeFactorySupport.fixedNodeList(nd);
            } catch (DataObjectNotFoundException ex) {
                Exceptions.printStackTrace(ex);
            }
//            }

            return NodeFactorySupport.fixedNodeList();
        }
 
开发者ID:jMonkeyEngine,项目名称:sdk,代码行数:15,代码来源:ImportantFilesNode.java

示例14: ProjectNode

import org.netbeans.spi.project.ui.support.NodeFactorySupport; //导入依赖的package包/类
public ProjectNode(Node node, PlayProject project) throws DataObjectNotFoundException {
    super(node,
            NodeFactorySupport.createCompositeChildren(
                    project, "Projects/com-qualixium-playnb/Nodes"),
            new ProxyLookup(
                    new Lookup[]{
                        Lookups.singleton(project), node.getLookup()
                    }));
    this.project = project;
    this.actionsProcessor = new ActionsProcessor(project);
}
 
开发者ID:pedrohidalgo,项目名称:pleasure,代码行数:12,代码来源:PlayProject.java

示例15: ProjectNode

import org.netbeans.spi.project.ui.support.NodeFactorySupport; //导入依赖的package包/类
public ProjectNode(Node node, AnsibleProject project) throws DataObjectNotFoundException {
    super(node, 
        NodeFactorySupport.createCompositeChildren( project, "Projects/de-javastream-ansible/Nodes"),
        new ProxyLookup(
                new Lookup[]{
                    Lookups.singleton(project), 
                    node.getLookup()
                }
        )
    );
    this.project = project;
}
 
开发者ID:phaus,项目名称:netbeans-ansible,代码行数:13,代码来源:AnsibleProject.java


注:本文中的org.netbeans.spi.project.ui.support.NodeFactorySupport类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。