Examples of IWorkspaceRoot


Examples of org.eclipse.core.resources.IWorkspaceRoot

    TreeViewer treeViewer = new TreeViewer(new Tree(parent, style));   
    treeViewer.setContentProvider(new WorkbenchContentProvider());
    treeViewer.setLabelProvider(WorkbenchLabelProvider.getDecoratingWorkbenchLabelProvider());
    treeViewer.setComparator(new NameSorter());
    treeViewer.addFilter(getFilter());   
    IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
    treeViewer.setInput(workspaceRoot);
    IStructuredSelection preSelection = getPreSelection(_workspaceSelection);
    if (preSelection != null) {
      treeViewer.setSelection(preSelection);
    }
View Full Code Here

Examples of org.eclipse.core.resources.IWorkspaceRoot

    addPage(_page);
  }


  public boolean performFinish() {
    IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();   
    IProject project = root.getProject(_page.getDesignName());
   
    if(!project.exists()){
      try {               
        WGADesign design = WGADesignFactory.createDesign(project, _page.getTemplate());
               
View Full Code Here

Examples of org.eclipse.core.resources.IWorkspaceRoot

  }

  protected void doFinish(String runtimeName, WGADeployment deployment, IProgressMonitor monitor, List<String> workingSetsToAddTo) throws CoreException {
    monitor.beginTask("Creating WGA runtime '" + runtimeName + "'", 5);
   
    IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();   
   
    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));     
View Full Code Here

Examples of org.eclipse.core.resources.IWorkspaceRoot

      }
    });

    tableViewer.setComparator(new NameSorter());
    tableViewer.addFilter((ViewerFilter) new WGADesignViewerFilter(null));
    IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
    tableViewer.setInput(workspaceRoot);
    return tableViewer;
  }
View Full Code Here

Examples of org.eclipse.core.resources.IWorkspaceRoot

    });

    tableViewer.setComparator(new NameSorter());
    tableViewer.addFilter((ViewerFilter) new WGADesignViewerFilter(_selectedProject));

    IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
    tableViewer.setInput(workspaceRoot);
    return tableViewer;
  }
View Full Code Here

Examples of org.eclipse.core.resources.IWorkspaceRoot

        return cl;
    }

    private static void getClassURLs(IJavaProject javaProject, List urls) {
        IProject project = javaProject.getProject();
        IWorkspaceRoot workspaceRoot = project.getWorkspace().getRoot();

        IClasspathEntry[] paths = null;
        IPath defaultOutputLocation = null;
        try {
            paths = javaProject.getResolvedClasspath(true);
            defaultOutputLocation = javaProject.getOutputLocation();
        } catch (JavaModelException e) {
            // don't show message to user neither log it
            // BytecodeOutlinePlugin.log(e, IStatus.ERROR);
        }
        if (paths != null) {
            IPath projectPath = javaProject.getProject().getLocation();
            for (int i = 0; i < paths.length; ++i) {
                IClasspathEntry cpEntry = paths[i];
                IPath p = null;
                if (cpEntry.getEntryKind() == IClasspathEntry.CPE_SOURCE) {
                    // filter out source container - there are unused for class
                    // search - add bytecode output location instead
                    p = cpEntry.getOutputLocation();
                    if (p == null) {
                        // default output used:
                        p = defaultOutputLocation;
                    }
                } else if (cpEntry.getEntryKind() == IClasspathEntry.CPE_PROJECT) {
                    String projName = cpEntry.getPath().toPortableString()
                        .substring(1);
                    IProject proj = workspaceRoot.getProject(projName);
                    IJavaProject projj = JavaCore.create(proj);
                    getClassURLs(projj, urls);
                    continue;
                } else {
                    p = cpEntry.getPath();
View Full Code Here

Examples of org.eclipse.core.resources.IWorkspaceRoot

        if (project == null) {
            return null;
        }
        IPath path = new Path(rootPath);
        if (path.isAbsolute()) {
            IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace()
                .getRoot();
            IResource resource = workspaceRoot.findMember(path);
            IPackageFragmentRoot root1;
            if (resource == null) {
                // external jar
                root1 = project.getPackageFragmentRoot(rootPath);
            } else {
View Full Code Here

Examples of org.eclipse.core.resources.IWorkspaceRoot

        requiredProjectNames[index++] = (String)iter.next();
      }
      Util.sort(requiredProjectNames); // ensure that if changed, the order is consistent
     
      IProject[] requiredProjectArray = new IProject[newSize];
      IWorkspaceRoot wksRoot = projectResource.getWorkspace().getRoot();
      for (int i = 0; i < newSize; i++){
        requiredProjectArray[i] = wksRoot.getProject(requiredProjectNames[i]);
      }
      description.setDynamicReferences(requiredProjectArray);
      projectResource.setDescription(description, null);
 
    } catch(CoreException e){
View Full Code Here

Examples of org.eclipse.core.resources.IWorkspaceRoot

  public static IClasspathEntry getResolvedClasspathEntry(IClasspathEntry entry) {

    if (entry.getEntryKind() != IClasspathEntry.CPE_VARIABLE)
      return entry;

    IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
    IPath resolvedPath = JavaCore.getResolvedVariablePath(entry.getPath());
    if (resolvedPath == null)
      return null;

    Object target = JavaModel.getTarget(workspaceRoot, resolvedPath, false);
View Full Code Here

Examples of org.eclipse.core.resources.IWorkspaceRoot

      // check if the build state version number has changed since last session
      // (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=98969)
      if (monitor != null)
        monitor.subTask(Messages.javamodel_getting_build_state_number);
      QualifiedName qName = new QualifiedName(JavaCore.PLUGIN_ID, "stateVersionNumber"); //$NON-NLS-1$
      IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
      String versionNumber = null;
      try {
        versionNumber = root.getPersistentProperty(qName);
      } catch (CoreException e) {
        // could not read version number: consider it is new
      }
      final JavaModel model = manager.getJavaModel();
      String newVersionNumber = Byte.toString(State.VERSION);
      if (!newVersionNumber.equals(versionNumber)) {
        // build state version number has changed: touch every projects to force a rebuild
        if (JavaBuilder.DEBUG)
          System.out.println("Build state version number has changed"); //$NON-NLS-1$
        IWorkspaceRunnable runnable = new IWorkspaceRunnable() {
          public void run(IProgressMonitor progressMonitor2) throws CoreException {
            IJavaProject[] projects = null;
            try {
              projects = model.getJavaProjects();
            } catch (JavaModelException e) {
              // could not get Java projects: ignore
            }
            if (projects != null) {
              for (int i = 0, length = projects.length; i < length; i++) {
                IJavaProject project = projects[i];
                try {
                  if (JavaBuilder.DEBUG)
                    System.out.println("Touching " + project.getElementName()); //$NON-NLS-1$
                  project.getProject().touch(progressMonitor2);
                } catch (CoreException e) {
                  // could not touch this project: ignore
                }
              }
            }
          }
        };
        if (monitor != null)
          monitor.subTask(Messages.javamodel_building_after_upgrade);
        try {
          ResourcesPlugin.getWorkspace().run(runnable, monitor);
        } catch (CoreException e) {
          // could not touch all projects
        }
        try {
          root.setPersistentProperty(qName, newVersionNumber);
        } catch (CoreException e) {
          Util.log(e, "Could not persist build state version number"); //$NON-NLS-1$
        }
      }
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.