Package org.eclipse.core.resources

Examples of org.eclipse.core.resources.IFolder


      }

      if (_combo.getText().equals("plugin")) {
        target = "plugins";
      }
      IFolder targetFolder=runtime.getProject().getFolder(target);
      WGADesignStructureHelper.createDirklink(targetFolder, (IContainer) _treeViewer.getTree().getSelection()[0].getData(), _linkNameText.getText());
    } catch (CoreException e) {
      WGADesignerPlugin.getDefault().logWarning(e.getMessage(), e);
    } catch (IOException e) {
      WGADesignerPlugin.getDefault().logWarning(e.getMessage(), e);
View Full Code Here


          if (_combo.getText().equals("plugin")) {
            target = "plugins";
          }

          IFolder folder = _selectedProject.getFolder(target);

          if (folder.getFolder(_linkNameText.getText()).exists()) {
            updateStatus(new Status(Status.ERROR, WGADesignerPlugin.PLUGIN_ID, _combo.getText() + " already exists."));
          }
        } else {
          updateStatus(new Status(Status.ERROR, WGADesignerPlugin.PLUGIN_ID, "Please select a Design or Plugin"));
        }
View Full Code Here

    }
  }
 
 
  private boolean isWGAPublisherProject(IProject project) {
    IFolder webContent = project.getFolder("WebContent");
    if (webContent.exists()) {
      IFolder webinf = webContent.getFolder("WEB-INF");
      if (webinf.exists() && webinf.exists(new Path("web.xml"))) {
        // TODO check web.xml for WGACore
        return true;
      }
    }
    return false;
View Full Code Here

                  }                                   
                } else {
                  // invalid resource - should not happen - ignore
                }
              } else if (delta.getResource() instanceof IFolder) {
                IFolder folder = (IFolder)delta.getResource();
                String absolutePath = folder.getLocation().toString();
                // make path relative to WebContent folder
                int pos = absolutePath.lastIndexOf("WebContent/");
                if (pos != -1) {                 
                  String relativePathToFolder = absolutePath.substring(pos + "WebContent/".length());
                  File targetFolder = new File(getDeployDir(), relativePathToFolder);
View Full Code Here

        }

        IWorkspace workspace = ResourcesPlugin.getWorkspace();

        if (!project.getPath().equals(path)) {
            IFolder outputFolder = workspace.getRoot().getFolder(path);
            if (outputFolder != null) {
                // linked resources will be resolved here!
                IPath rawPath = outputFolder.getRawLocation();
                if (rawPath != null) {
                    path = rawPath;
                }
            }
        } else {
View Full Code Here

                    int segmentCount = sourcePath.segmentCount();
                    if (segmentCount > 0) {
                        // create folder and its parents
                        IContainer container = project;
                        for (int j = 0; j < segmentCount; j++) {
                            IFolder folder = container.getFolder(new Path(
                                sourcePath.segment(j)));
                            if (!folder.exists()) {
                                folder.create(true, true, null);
                            }
                            container = folder;
                        }
                    }

                    // create source entry
                    entries[i] = JavaCore.newSourceEntry(
                        projectPath.append(sourcePath), new IPath[0],
                        new IPath[0], null);
                }

                for (int i = 0; i < libLength; i++) {
                    String lib = libraries[i];
                    if (lib.startsWith("JCL")) {
                        // ensure JCL variables are set
                         try {
                            setUpJCLClasspathVariables(compliance);
                        } catch (IOException e) {
                            e.printStackTrace();
                        }
                    }

                    if (lib.indexOf(File.separatorChar) == -1
                        && lib.charAt(0) != '/'
                        && lib.equals(lib.toUpperCase())) { // all upper case is a var
                        char[][] vars = CharOperation.splitOn(',', lib
                            .toCharArray());
                        entries[sourceLength + i] = JavaCore.newVariableEntry(
                            new Path(new String(vars[0])), vars.length > 1
                                ? new Path(new String(vars[1]))
                                : null, vars.length > 2
                                ? new Path(new String(vars[2]))
                                : null);
                    } else {
                        IPath libPath = new Path(lib);
                        if (!libPath.isAbsolute() && libPath.segmentCount() > 0
                            && libPath.getFileExtension() == null) {
                            project.getFolder(libPath).create(true, true, null);
                            libPath = projectPath.append(libPath);
                        }
                        entries[sourceLength + i] = JavaCore.newLibraryEntry(
                            libPath, null, null, ClasspathEntry.getAccessRules(
                                new IPath[0], new IPath[0]),
                            new IClasspathAttribute[0], false);
                    }
                }

                // create project's output folder
                IPath outputPath = new Path(projectOutput);
                if (outputPath.segmentCount() > 0) {
                    IFolder output = project.getFolder(outputPath);
                    if (!output.exists()) {
                        output.create(true, true, null);
                    }
                }

                // set classpath and output location
                IJavaProject javaProject = JavaCore.create(project);
View Full Code Here

        }
    }
   
    private void createOutputLocation(IJavaProject project)
            throws JavaModelException, CoreException {
        IFolder ifolder = project.getProject().getFolder("bin");
        createFolder(ifolder);
        IPath ipath = ifolder.getFullPath();
        project.setOutputLocation(ipath, null);
    }
View Full Code Here

  }

    private void createRule(IJavaProject project)
            throws JavaModelException, IOException {
        String s = "org/drools/ide/resource/DroolsTest.java.template";
        IFolder folder = project.getProject().getFolder("src/java");
        IPackageFragmentRoot packageFragmentRoot = project
                .getPackageFragmentRoot(folder);
        IPackageFragment packageFragment = packageFragmentRoot
                .createPackageFragment("com.sample", true, null);
        InputStream inputstream = getClass().getClassLoader()
View Full Code Here

    }
   
    private void createRulesProject(IJavaProject project)
            throws CoreException {
        String fileName = "org/drools/ide/resource/Rules.java.drl.template";
        IFolder folder = project.getProject().getFolder("src/rules");
        IFile file = folder.getFile("Rules.java.drl");
        InputStream inputstream = getClass().getClassLoader().getResourceAsStream(fileName);
        file.create(inputstream, true, null);
    }
View Full Code Here

    return bytes;
  }
   
    private void addSourceFolder(IJavaProject project, List list, String s) throws CoreException {
        IFolder folder = project.getProject().getFolder(s);
        createFolder(folder);
        IPackageFragmentRoot ipackagefragmentroot = project.getPackageFragmentRoot(folder);
        list.add(JavaCore.newSourceEntry(ipackagefragmentroot.getPath()));
    }
View Full Code Here

TOP

Related Classes of org.eclipse.core.resources.IFolder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.