Package org.eclipse.core.resources

Examples of org.eclipse.core.resources.IWorkspaceRoot


        IContainer container = creator.createContainer( NULL_MONITOR );
        return (IFolder) container;
    }

    private void deleteProject(String projectName) throws CoreException {
        IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
        IProject project = root.getProject( projectName );
        if ( project.exists() ) project.delete( true,
                                                true,
                                                NULL_MONITOR );
    }
View Full Code Here


   * Gets all the {@link IProject}s in the current open workspace.
   *
   * @return All the Projects in the current workspace
   */
  public IProject[] getAllProjects() {
    IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
    return workspaceRoot.getProjects();
  }
View Full Code Here

   *
   * @param projectName the project name as a string
   * @return the {@link IProject} which matches the given project name.
   */
  public IProject getProject(String projectName) {
    IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
    return workspaceRoot.getProject(projectName);
  }
View Full Code Here

    IWorkspace workspace = ResourcesPlugin.getWorkspace();
    if(workspace == null) {
      log.warning("No workspace");
      return null;
    }
    IWorkspaceRoot root = workspace.getRoot();
    if(root == null) {
      log.warning("No workspace root");
      return null;
    }
     IJavaModel javaModel = JavaCore.create(root);
View Full Code Here

    IWorkspace workspace = ResourcesPlugin.getWorkspace();
    if(workspace == null) {
      log.warning("No workspace");
      return null;
    }
    IWorkspaceRoot root = workspace.getRoot();
    if(root == null) {
      log.warning("No workspace root");
      return null;
    }
     IJavaModel javaModel = JavaCore.create(root);
View Full Code Here

    IWorkspace workspace = ResourcesPlugin.getWorkspace();
    if(workspace == null) {
      log.warning("No workspace");
      return null;
    }
    IWorkspaceRoot root = workspace.getRoot();
    if(root == null) {
      log.warning("No workspace root");
      return null;
    }
     IJavaModel javaModel = JavaCore.create(root);
View Full Code Here

  static public void setup() throws JavaModelException {
    IJavaProject project;

    IWorkspace workspace = ResourcesPlugin.getWorkspace();
    Assert.assertNotNull(workspace);
    IWorkspaceRoot root = workspace.getRoot();
    Assert.assertNotNull(root);
    project = (IJavaProject) JavaCore.create(root.getProject("FusionTests"));
    Assert.assertNotNull(project);
   
    hierarchy =  new CachedTypeHierarchy(project);
  }
View Full Code Here

     * @param projectName
     */
    public void createJavaProject(String projectName) {
        try {
            String binFolderName = "bin";
            IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
            this.project = workspaceRoot.getProject(projectName);
            if (project.exists()) {
                project.refreshLocal(IResource.DEPTH_INFINITE, null);
            }
            else {
                project.create(null);
View Full Code Here

  /**
   * Test for {@link Utils#getGWTProjects()}.
   */
  public void test_getGWTProjects() throws Exception {
    IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
    // initially only one project, and it is GWT project
    {
      assertThat(workspaceRoot.getProjects()).hasSize(1);
      //
      List<IJavaProject> gwtProjects = Utils.getGWTProjects();
      assertThat(gwtProjects).hasSize(1);
      assertEquals("TestProject", gwtProjects.get(0).getElementName());
    }
    // two projects
    {
      TestProject newProject = new TestProject("newProject");
      try {
        // now two projects
        assertThat(workspaceRoot.getProjects()).hasSize(2);
        // ...but still only one GWT project
        {
          List<IJavaProject> gwtProjects = Utils.getGWTProjects();
          assertThat(gwtProjects).hasSize(1);
          assertEquals("TestProject", gwtProjects.get(0).getElementName());
View Full Code Here

            IProject project = getJavaProject(configuration).getProject();
            project.build(IncrementalProjectBuilder.FULL_BUILD, monitor);

            Map<String, IFolder> sourceFolders = new HashMap<String, IFolder>();
            IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
            IJavaProject javaProject = getJavaProject(configuration);
            IPath munitOutputFolder = null;
            IClasspathEntry[] entries = javaProject.getResolvedClasspath(true);
            for (int i = 0; i < entries.length; i++)
            {
                IClasspathEntry entry = entries[i];
                if (entry.getEntryKind() == IClasspathEntry.CPE_SOURCE)
                {
                    IPath path = entry.getPath();
                    IFolder sourceFolder = root.getFolder(path);
                    if (sourceFolder.getLocation().toString().contains("test/munit"))
                    {
                        munitOutputFolder = entry.getOutputLocation();
                    }

                }
            }


            MunitEclipseUpdater.launch();

            String mainTypeName = verifyMainTypeName(configuration);
            IVMRunner runner = getVMRunner(configuration, mode);

            File workingDir = verifyWorkingDirectory(configuration);
            String workingDirName = null;
            if (workingDir != null)
            {
                workingDirName = workingDir.getAbsolutePath();
            }

            String[] envp = getEnvironment(configuration);

            ArrayList vmArguments = new ArrayList();
            ArrayList programArguments = new ArrayList();
            programArguments.add("-resource");
            programArguments.add(configuration.getAttribute("resource", ""));
            programArguments.add("-path");
            programArguments.add(configuration.getAttribute("Mpath", ""));
            programArguments.add("-port");
            programArguments.add(String.valueOf(MunitEclipseUpdater.getInstance().getPort()));

            // VM-specific attributes
            Map vmAttributesMap = getVMSpecificAttributesMap(configuration);

            for (int i = 0; i < entries.length; i++)
            {
                IClasspathEntry entry = entries[i];
                if (entry.getEntryKind() == IClasspathEntry.CPE_SOURCE)
                {
                    IPath path = entry.getPath();
                    IFolder sourceFolder = root.getFolder(path);
                    if (!sourceFolder.getLocation().toString().contains("test/munit"))
                    {
                        try
                        {
                            IFolder folder = root.getFolder(entry.getOutputLocation());
                            for (IResource resource : folder.members())
                            {
                                try
                                {
                                    resource.copy(munitOutputFolder, IFolder.SHALLOW, monitor);
View Full Code Here

TOP

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

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.