Package org.eclipse.core.resources

Examples of org.eclipse.core.resources.IProject.create()


    if(!(projectName.trim().length() > 0)) return null;
    try{
    final IProject newProject = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
    if(!newProject.exists()){     
      //STEP 1 - Create new IProject
      newProject.create(null);
      newProject.open(null);
     
      //STEP 2 - Create folder structure
      createFolder(newProject, "src/main/java/", null);
      createFolder(newProject, "src/main/resources", null);
View Full Code Here


      final String projectName = XmlUtils.loadElement(projectFile)
          .getChild("name").getText().trim();
      IProject project = root.getProject(projectName);
      IJavaProject ret = JavaCore.create(project);
      try {
        project.create(null);
      } catch (CoreException exc) {
      }
      try {
        project.open(null);
      } catch (CoreException exc) {
View Full Code Here

        final IPath projectLocation = newKarafProject.getLocation();

        if (!Platform.getLocation().equals(projectLocation)) {
            final IProjectDescription projectDescription = project.getWorkspace().newProjectDescription(project.getName());
            projectDescription.setLocation(projectLocation);
            project.create(projectDescription, monitor);
        } else {
            project.create(monitor);
        }

        project.open(null);
View Full Code Here

        if (!Platform.getLocation().equals(projectLocation)) {
            final IProjectDescription projectDescription = project.getWorkspace().newProjectDescription(project.getName());
            projectDescription.setLocation(projectLocation);
            project.create(projectDescription, monitor);
        } else {
            project.create(monitor);
        }

        project.open(null);
    }
View Full Code Here

    public IJavaProject getJavaProject() throws Exception
    {
        if( this.project == null )
        {
            final IProject p = ResourcesPlugin.getWorkspace().getRoot().getProject( this.testClass.getName() );
            p.create( null );
            p.open( null );
           
            final IProjectDescription desc = p.getDescription();
            desc.setNatureIds( new String[] { JavaCore.NATURE_ID } );
            p.setDescription( desc, null );
View Full Code Here

        {
            n = n + "." + name;
        }
       
        final IProject p = ResourcesPlugin.getWorkspace().getRoot().getProject( n );
        p.create( null );
        p.open( null );
       
        return p;
    }
   
View Full Code Here

        writePydevProjectFile(projectLoc.append(".pydevproject"));
        File srcLocFile = projectLoc.append("src").toFile();
        srcLocFile.mkdir();

        assertTrue(!project.exists());
        project.create(monitor);
        project.open(monitor);
        project.refreshLocal(IResource.DEPTH_INFINITE, monitor);
        IJobManager jobManager = Job.getJobManager();
        jobManager.resume();
        final PythonNature nature = (PythonNature) PythonNature.addNature(project, null, null, null, null, null, null);
View Full Code Here

      // 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
      // hoops
      }else{
        String relName = relLocation.toString();
View Full Code Here

        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.
          /*project.open(null);
          description = project.getDescription();
View Full Code Here

          // location must be set to null to assume the "default location"
          desc.setLocation(null);
        } else {
          desc.setLocation(new Path(folder.getAbsolutePath()));
        }
        project.create(desc, null);
        project.open(null);

        // Add project to current WorkingSet
        IWorkingSetManager workingSetManager = PlatformUI.getWorkbench().getWorkingSetManager();
        IWorkingSet[] workingSets = workingSetManager.getWorkingSets();
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.