Package org.eclipse.core.resources

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


    IProject project = root.getProject(runtimeName);
    if (project.exists()) {
      throwCoreException("A project with name '" + runtimeName + "' already exists in the workspace.");
    } else {
      // create project     
      project.create(new SubProgressMonitor(monitor, 1));     
      project.open(new SubProgressMonitor(monitor, 1));
     
      JDTUtils.addNature(project, WGADesignerPlugin.NATURE_WGA_RUNTIME);     
     
      _wgaRuntime = (WGARuntime) project.getNature(WGADesignerPlugin.NATURE_WGA_RUNTIME);
View Full Code Here


        deleteProject(project1);

        IWorkspaceRunnable create = new IWorkspaceRunnable() {

            public void run(IProgressMonitor monitor) throws CoreException {
                project1.create(null);
                project1.open(null);
            }
        };
        workspace.run(create, null);
        return project1;
View Full Code Here

        IPath location = operation.getLocation();
        IContainer container = workspace.getRoot().getContainerForLocation(location);
        if (container == null) {
            IProjectDescription projDesc = workspace.loadProjectDescription(location.append(IProjectDescription.DESCRIPTION_FILE_NAME));
            IProject project = workspace.getRoot().getProject(Workspace.CNFDIR);
            project.create(projDesc, monitor);
            project.open(monitor);
        } else if (container.getType() == IResource.PROJECT) {
            IProject project = (IProject) container;
            if (project.exists()) {
                project.open(monitor);
View Full Code Here

        } else if (container.getType() == IResource.PROJECT) {
            IProject project = (IProject) container;
            if (project.exists()) {
                project.open(monitor);
            } else {
                project.create(monitor);
            }
        } else {
            throw new CoreException(new Status(IStatus.ERROR, Plugin.PLUGIN_ID, 0, "Incorrect path (not a project): " + location, null));
        }
    }
View Full Code Here

    // create project
    final IProject project = getWorkspaceRoot().getProject(projectName);
    IWorkspaceRunnable populate = new IWorkspaceRunnable() {
      public void run(IProgressMonitor monitor) throws CoreException {
        project.create(null);
        try {
          project.open(null);
        }
        catch (ConcurrentModificationException e) {
          // wait and try again to work-around
View Full Code Here

    IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
    IProject project = workspaceRoot.getProject("test-java-project");
    if (project.exists()) {
      project.delete(true, true, null);
    }
    project.create(null);
    project.open(null);
   
    return project;
  }
View Full Code Here

  create_java_project() throws CoreException {
    String projectName = generateProjectName();
    System.out.println("Creating project " + projectName);
   
    IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
    project.create(null);
    project.open(null);
   
    IProjectDescription description = project.getDescription();
    description.setNatureIds(new String[] { JavaCore.NATURE_ID });
    project.setDescription(description, null);
View Full Code Here

        final IProject project = ws.getRoot().getProject(name);
        try {
            if (!project.exists()) {
                IProjectDescription description = ws.newProjectDescription(name);
                description.setLocation(new Path(path));
                project.create(description, null);
                project.open(null);

                description = project.getDescription();
                description.setNatureIds(new String[] { ModelPlugin.NATURE_ID });
                description.setName(name);
View Full Code Here

    URL _workspaceURL = this.getWorkspaceURL();
    this.setUpFile(_workspaceURL, name);
    final IProject project = this.getProject(name);
    final IWorkspaceRunnable runnable = new IWorkspaceRunnable() {
      public void run(final IProgressMonitor monitor) throws CoreException {
        project.create(null);
        project.open(null);
      }
    };
    IWorkspace _workspace = this.getWorkspace();
    _workspace.run(runnable, null);
View Full Code Here

      FileNotFoundException, IOException {

    IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
    IProject project = root.getProject("Tmp");
    if (!project.exists()) {
      project.create(null);
    }
    if (!project.isOpen()) {
      project.open(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.