Esempio n. 1
0
 private DataFolder getFolder(String propName) {
   FileObject fo = helper.resolveFileObject(evaluator.getProperty(propName));
   if (fo != null) {
     DataFolder df = DataFolder.findFolder(fo);
     return df;
   }
   return null;
 }
Esempio n. 2
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};
    }
 public FileObject getRootFolder() {
   return helper.resolveFileObject(
       helper.getStandardPropertyEvaluator().getProperty("src.dir")); // NOI18N
 }