Package org.eclipse.core.resources

Examples of org.eclipse.core.resources.IWorkspace.newProjectDescription()


                newPath = null;
            }
        }

        IWorkspace workspace = ResourcesPlugin.getWorkspace();
        final IProjectDescription description = workspace.newProjectDescription(newProjectHandle.getName());
        description.setLocation(newPath);

        // update the referenced project if provided
        if (referencePage != null) {
            IProject[] refProjects = referencePage.getReferencedProjects();
View Full Code Here


        location = null;
      }
    }

    IWorkspace workspace = ResourcesPlugin.getWorkspace();
    final IProjectDescription description = workspace
        .newProjectDescription(newProjectHandle.getName());
    description.setLocationURI(location);

    // create the new project operation
    IRunnableWithProgress op = new IRunnableWithProgress() {
View Full Code Here

      }

      // project is outside the workspace otherwise not at the top of the
      // workspace
      if (relLocation == null || relLocation.segmentCount() != 1) {
        IProjectDescription description = workspace.newProjectDescription(name);
        description.setLocation(location);
        description.setNatureIds(natures);
        project.create(description, null/*monitor*/);

      // project is at the workspace root, requires jumping through eclipse
View Full Code Here

        // hack for windows... manually remove drive letter
        relName = relName.replaceFirst("^[a-zA-Z]:", "");

        project = ProjectUtils.getProject(relName, true);
        if(!project.exists()){
          IProjectDescription description = workspace.newProjectDescription(relName);
          description.setNatureIds(natures);
          project.create(description, null/*monitor*/);
          // FIXME: eclipse will ignore this name change.  need to find the
          // proper way to rename a project in the workspace root if we want to
          // support this.
View Full Code Here

      }
      return null;
    }
    if (record.getProjectDescription() == null) {
      // error case
      record.setProjectDescription(workspace
          .newProjectDescription(projectName));
      IPath locationPath = new Path(record.getProjectSystemFile()
          .getAbsolutePath());

      // If it is under the root use the default location
View Full Code Here

        IWorkspace workspace = ResourcesPlugin.getWorkspace();
        IWorkspaceRoot root = workspace.getRoot();
        IProject newProject = root.getProject(projectName);

        // if project doesn't exist, create
        IProjectDescription projectDescription = workspace.newProjectDescription(projectName);
        if (!newProject.exists()) {
            projectDescription = workspace.newProjectDescription(projectName);
            newProject.create(projectDescription, monitor);
        } else {
            if (logger.isDebugEnabled()) {
View Full Code Here

        IProject newProject = root.getProject(projectName);

        // if project doesn't exist, create
        IProjectDescription projectDescription = workspace.newProjectDescription(projectName);
        if (!newProject.exists()) {
            projectDescription = workspace.newProjectDescription(projectName);
            newProject.create(projectDescription, monitor);
        } else {
            if (logger.isDebugEnabled()) {
                logger.debug("Existing project '" + projectName
                        + "' found in workspace - will attempt to apply Force.com");
View Full Code Here

            public IStatus runInWorkspace(IProgressMonitor monitor)
                    throws CoreException {
                IWorkspace workspace = ResourcesPlugin.getWorkspace();
                String name = page.getLoadedProperties().getProperty(
                        "project.name");
                IProjectDescription description = workspace
                        .newProjectDescription(name);
                description.setLocation(new Path(page.getRoot()
                        .getAbsolutePath()));
                description.setNatureIds(new String[] { JavaCore.NATURE_ID });
                IWorkspaceRoot root = workspace.getRoot();
View Full Code Here

      //
      IWorkspace workspace = ResourcesPlugin.getWorkspace();
      //
      // the project descriptions is set equal to the name of the project
      //
      final IProjectDescription desc = workspace.newProjectDescription(projectHandle.getName());
      //
      // get our workspace location
      //
      desc.setLocationURI(projectURI);
View Full Code Here

          if (sourcePath.append(".project").toFile().exists()) {
            ProjectDescriptionReader reader = new ProjectDescriptionReader(project);
            description = reader.read(sourcePath.append(".project"));
            description.setName(projectName);
          } else {
            description = workspace.newProjectDescription(projectName);
          }
         
          // If it is under the root use the default location
          if (Platform.getLocation().isPrefixOf(sourcePath)) {
            description.setLocation(null);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.