Package org.eclipse.core.resources

Examples of org.eclipse.core.resources.IProjectDescription


        IOUtils.createFolder(binFolder);
        javaProject.setOutputLocation(binFolder.getFullPath(), null);
    }

    private void addJavaBuilder(IJavaProject javaProject) throws CoreException {
        IProjectDescription desc = javaProject.getProject().getDescription();
        ICommand command = desc.newCommand();
        command.setBuilderName(JavaCore.BUILDER_ID);
        desc.setBuildSpec(new ICommand[] { command });
        javaProject.getProject().setDescription(desc, null);
    }
View Full Code Here


  public static final String HTML_NATURE_ID = "tk.eclipse.plugin.htmleditor.HTMLProjectNature";
  public static final String HTML_BUILDER_ID = "tk.eclipse.plugin.htmleditor.HTMLProjectBuilder";
  private IProject project;
 
  public void configure() throws CoreException {
    IProjectDescription desc = project.getDescription();
    ICommand[] commands = desc.getBuildSpec();
    for(int i=0;i<commands.length;i++){
      if(commands[i].getBuilderName().equals(HTML_BUILDER_ID)){
        return;
      }
    }
    ICommand command = desc.newCommand();
    command.setBuilderName(HTML_BUILDER_ID);
    ICommand[] newCommands = new ICommand[commands.length + 1];
    for(int i=0;i<commands.length;i++){
      newCommands[i] = commands[i];
    }
    newCommands[newCommands.length - 1] = command;
    desc.setBuildSpec(newCommands);
    project.setDescription(desc,null);
  }
View Full Code Here

    desc.setBuildSpec(newCommands);
    project.setDescription(desc,null);
  }

  public void deconfigure() throws CoreException {
    IProjectDescription desc = project.getDescription();
    ICommand[] commands = desc.getBuildSpec();
    ArrayList list = new ArrayList();
    for(int i=0;i<commands.length;i++){
      if(!commands[i].getBuilderName().equals(HTML_BUILDER_ID)){
        list.add(commands[i]);
      }
    }
    desc.setBuildSpec((ICommand[])list.toArray(new ICommand[list.size()]));
    project.setDescription(desc,null);
  }
View Full Code Here

   
    project.refreshLocal(IResource.DEPTH_ONE, new NullProgressMonitor());
  }
 
  private void addNature(IProject project) throws CoreException {
    IProjectDescription description = project.getDescription();
    String[] natures = description.getNatureIds();
    for(int i=0;i<natures.length;i++){
      if(natures[i].equals(HTMLProjectNature.HTML_NATURE_ID)){
        return;
      }
    }
    String[] newNatures = new String[natures.length + 1];
    System.arraycopy(natures, 0, newNatures, 0, natures.length);
    newNatures[natures.length] = HTMLProjectNature.HTML_NATURE_ID;
    description.setNatureIds(newNatures);
    project.setDescription(description, null);
  }
View Full Code Here

    description.setNatureIds(newNatures);
    project.setDescription(description, null);
  }
 
  private void removeNature(IProject project) throws CoreException {
    IProjectDescription description = project.getDescription();
    String[] natures = description.getNatureIds();
    List newNatures = new ArrayList();
    for(int i=0;i<natures.length;i++){
      if(!natures[i].equals(HTMLProjectNature.HTML_NATURE_ID)){
        newNatures.add(natures[i]);
      }
    }
    description.setNatureIds((String[])newNatures.toArray(new String[newNatures.size()]));
    project.setDescription(description, null);
  }
View Full Code Here

   *          the project to add the nature
   *
   * @throws CoreException
   */
  public static void addNLPNature(IProject project) throws CoreException {
    IProjectDescription description = project.getDescription();
    String[] natures = description.getNatureIds();
    String[] newNatures = new String[natures.length + 1];
    System.arraycopy(natures, 0, newNatures, 0, natures.length);
    newNatures[natures.length] = NlpProject.ID;
    description.setNatureIds(newNatures);
    project.setDescription(description, null);
  }
View Full Code Here

    private static void createProject(IProject project, IPath location)
    {
        if (!project.exists())
        {
            IProjectDescription projectDescribtion = project.getWorkspace()
                    .newProjectDescription(project.getName());

            if (Platform.getLocation().equals(location))
            {
                location = null;
            }

            projectDescribtion.setLocation(location);

            try
            {
                project.create(projectDescribtion, null);
            }
View Full Code Here

   *           If a problem occurs
   */
  public static void addUIMANature(IProject project) throws PearException {
    try {
      if (!project.hasNature(UIMA_NATURE_ID)) {
        IProjectDescription description = project.getDescription();
        String[] natures = description.getNatureIds();
        String[] newNatures = new String[natures.length + 1];
        System.arraycopy(natures, 0, newNatures, 0, natures.length);
        newNatures[natures.length] = UIMA_NATURE_ID;
        description.setNatureIds(newNatures);
        project.setDescription(description, null);
        project.close(null);
        project.open(null);
      }
    } catch (Throwable e) {
View Full Code Here

            // newDriverPage.getRunnable().run(new
            // SubProgressMonitor(monitor,100));
            // }

            IProject project = javaPage.getNewJavaProject().getResource().getProject();
            IProjectDescription description = project.getDescription();
            String[] existingNatures = description.getNatureIds();
            String[] natures = new String[existingNatures.length + 1];
            for (int i = 0; i < existingNatures.length; i++) {
              natures[i + 1] = existingNatures[i];
            }

            natures[0] = MapReduceNature.ID;
            description.setNatureIds(natures);

            project.setPersistentProperty(new QualifiedName(Activator.PLUGIN_ID, "hadoop.runtime.path"), firstPage.currentPath);
            project.setPersistentProperty(new QualifiedName(Activator.PLUGIN_ID, "hadoop.version"), firstPage.hadoopVersionText);
            project.setDescription(description, new NullProgressMonitor());
View Full Code Here

   * @throws CoreException
   */
  private IProject createIProject(String name, final java.net.URI hdfsURI) {
    final IWorkspace workspace = ResourcesPlugin.getWorkspace();
    final IProject project = workspace.getRoot().getProject(name);
    final IProjectDescription pd = workspace.newProjectDescription(name);
      WorkspaceJob operation = new WorkspaceJob("Adding HDFS Location") {

      @Override
      public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException {
        monitor.beginTask("Creating Project", 100);
        try {
          pd.setLocationURI(hdfsURI);
          project.create(pd, new SubProgressMonitor(monitor, 70));
          project.open(IResource.BACKGROUND_REFRESH, new SubProgressMonitor(monitor, 30));
          RepositoryProvider.map(project, HDFSTeamRepositoryProvider.ID);
          return Status.OK_STATUS;
        } catch (final CoreException e) {
View Full Code Here

TOP

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

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.