Package org.eclipse.core.resources

Examples of org.eclipse.core.resources.IWorkspaceRoot


   *
   * @return an array of IProject objects
   */
  public static List<IProject> getIProjects(String[] projectNames) {
    IWorkspace workspace = ResourcesPlugin.getWorkspace();
    IWorkspaceRoot root = workspace.getRoot();
    // get all projects in the workspace
    IProject[] projects = root.getProjects();
    List<IProject> projectsSelected = new ArrayList<IProject>();
    for (IProject project : projects) {
      for (String str : projectNames) {
        if (project.getName().equals(str)) {
          projectsSelected.add(project);
View Full Code Here


      consoleThread.start();
      getThread().start();
      getThread().join();
      outPutHandler.outPutEnd();
     
      IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
      try {
        root.refreshLocal(IWorkspaceRoot.DEPTH_INFINITE, null);
      } catch (CoreException e) {
        e.printStackTrace();
      }
    } catch (InterruptedException iex) {
    }
View Full Code Here

   * @throws Exception
   */
  @BeforeClass
  public static void setUpBeforeClass() throws Exception {
    IWorkspace workspace = ResourcesPlugin.getWorkspace();
    IWorkspaceRoot root = workspace.getRoot()
    //get all projects in the workspace
    projects = root.getProjects();
    All: for(IProject project : projects){
      if(project.isNatureEnabled("org.eclipse.jdt.core.javanature")&&project.isOpen()){
        javaProject=JavaCore.create(project);

        IPackageFragment[] packages = javaProject.getPackageFragments();
View Full Code Here

   * @throws Exception
   */
  @BeforeClass
  public static void setUpBeforeClass() throws Exception {
    IWorkspace workspace = ResourcesPlugin.getWorkspace();
    IWorkspaceRoot root = workspace.getRoot()
    //get all projects in the workspace
    projects = root.getProjects();
   
    All: for(IProject tempProject : projects){
      if (tempProject.isNatureEnabled("org.eclipse.jdt.core.javanature")&&tempProject.isOpen()){
        //initialise project
        project = tempProject;
View Full Code Here

   * @return A test file.
   */
  protected IFile getFileForTesting() throws CoreException,
      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

  public EList<HDFSServer> getHdfsServers() {
    return HadoopManager.INSTANCE.getServers().getHdfsServers();
  }

  public void loadServers() {
    final IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
    for (HDFSServer server : getHdfsServers()) {
      uriToServerMap.put(server.getUri(), server);
      final IProject project = workspaceRoot.getProject(server.getName());
      if (!project.exists()) {
        server.setStatusCode(ServerStatus.NO_PROJECT_VALUE);
      }
      serverToProjectMap.put(server, server.getName());
      projectToServerMap.put(server.getName(), server);
    }
    IProject[] projects = workspaceRoot.getProjects();
    if (projects != null) {
      for (IProject p : projects) {
        if (p.getLocationURI() != null && HDFSFileSystem.SCHEME.equals(p.getLocationURI().getScheme())) {
          if (!projectToServerMap.keySet().contains(p)) {
            logger.error("HDFS project with no server associated being closed:" + p.getName());
View Full Code Here

                IvyPlugin.logError(UTF8_ERROR, e);
                throw new RuntimeException(UTF8_ERROR, e);
            }
            if (parameter[0].equals("project")) {
                if (conf.getJavaProject() == null && value.trim().length() != 0) {
                    IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
                    IProject project = root.getProject(value.trim());
                    IJavaProject javaProject = JavaCore.create(project);
                    conf.setProject(javaProject);
                }
            } else if (parameter[0].equals("ivyXmlPath")) {
                ivyXmlPath = value;
View Full Code Here

     * Return the IvyDE container which include the specified project path as ivy dependency
     */
    private List getAffectedContainers(IPath projectPath) {
        List/* <IvyClasspathContainer> */allContainers = new ArrayList();

        IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
        IJavaProject[] projects;
        try {
            projects = JavaCore.create(root).getJavaProjects();
        } catch (JavaModelException e) {
            // something bad happend in the JDT...
View Full Code Here

    }

    private List getAllContainersExcludingProjects(Collection openedProjects) {
        List/* <IvyClasspathContainer> */allContainers = new ArrayList();

        IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
        IJavaProject[] projects;
        try {
            projects = JavaCore.create(root).getJavaProjects();
        } catch (JavaModelException e) {
            // something bad happend in the JDT...
View Full Code Here

        final String fileName = page.getFileName();
        final String orgName = page.getOrganisationName();
        final String moduleName = page.getModuleName();
        final String status = page.getStatus();

        IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
        IResource resource = root.findMember(new Path(containerName));
        if (!resource.exists() || !(resource instanceof IContainer)) {
            MessageDialog.openError(getShell(), "Error", "Container \"" + containerName
                    + "\" does not exist.");
        }
        IContainer container = (IContainer) resource;
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.