Exemplo n.º 1
0
    protected Node[] createNodes(Object key) {
      Node n = null;
      if (key == KEY_SOURCE_DIR) {
        FileObject srcRoot =
            helper.resolveFileObject(evaluator.getProperty(IcanproProjectProperties.SRC_DIR));
        Project p = FileOwnerQuery.getOwner(srcRoot);
        Sources s = ProjectUtils.getSources(p);
        SourceGroup sgs[] =
            ProjectUtils.getSources(p).getSourceGroups(IcanproProject.SOURCES_TYPE_ICANPRO);
        for (int i = 0; i < sgs.length; i++) {
          if (sgs[i].contains(srcRoot)) {
            n = PackageView.createPackageView(sgs[i]);
            break;
          }
        }
        /*
                  } else if (key == KEY_DOC_BASE) {
                      n = new DocBaseNode (getFolder(IcanproProjectProperties.META_INF).getNodeDelegate());
                  } else if (key == KEY_EJBS) {
                      FileObject srcRoot = helper.resolveFileObject(evaluator.getProperty (IcanproProjectProperties.SRC_DIR));
                      Project project = FileOwnerQuery.getOwner (srcRoot);
                      DDProvider provider = DDProvider.getDefault();
                      EjbJarImplementation jp = (EjbJarImplementation) project.getLookup().lookup(EjbJarImplementation.class);
                      org.netbeans.modules.j2ee.dd.api.ejb.EjbJar ejbJar = null;
                      try {
                          ejbJar = provider.getDDRoot(jp.getDeploymentDescriptor());
                      } catch (IOException ioe) {
                          ErrorManager.getDefault().notify(ioe);
                      }
                      ClassPathProvider cpp = (ClassPathProvider)
                          project.getLookup().lookup(ClassPathProvider.class);
                      assert cpp != null;
                      ClassPath classPath = cpp.findClassPath(srcRoot, ClassPath.SOURCE);
                      n = new EjbContainerNode(ejbJar, classPath);
                      //Node nws =  new WebServicesNode(ejbJar, classPath);
                      return n == null ? new Node[0] : new Node[] {n};
                  } else if (key == WEBSERVICES_DIR){
        FileObject 	srcRoot = helper.resolveFileObject(evaluator.getProperty (IcanproProjectProperties.SRC_DIR));
                      WebServicesView webServicesView = WebServicesView.getWebServicesView(srcRoot);
                      if(webServicesView != null)
        {
        n = webServicesView.createWebServicesView(srcRoot);
                      }
           } else if (key == KEY_SETUP_DIR) {
                      try {
                          DataObject sdo = DataObject.find(getSetupFolder());
                          n = new ServerResourceNode(project); // sdo.getNodeDelegate());
                      } catch (org.openide.loaders.DataObjectNotFoundException dnfe) {}
                      */
      }

      return n == null ? new Node[0] : new Node[] {n};
    }
Exemplo n.º 2
0
 /** Collect all recursive subfolders, except those which have subfolders but no files. */
 private void findNonExcludedPackages(FileObject fo) {
   PackageView.findNonExcludedPackages(this, fo);
 }