Package org.eclipse.core.resources

Examples of org.eclipse.core.resources.IWorkspaceRoot.findMember()


  }

  public static File lookingFileFromPathString(String path){
    IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
    IResource resourceInRuntimeWorkspace = root.findMember(path);
    if( resourceInRuntimeWorkspace == null){
      return new File(path);
    }
    File file = new File(resourceInRuntimeWorkspace.getLocationURI());
View Full Code Here


      if (containers.length > 0) {
        return containers[0];
      }
      if (path.getDevice() == null) {
        // search relative to the workspace if no device present
        return root.findMember(path);
      }
    }
    return null;
  }
}
View Full Code Here

    }

    public static boolean refreshLocal(IWorkbenchWindow window, String param) {
        try {
            IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
            IResource resource = workspaceRoot.findMember(param);
            // refresh resource
            resource.refreshLocal(IResource.DEPTH_INFINITE, monitor);
        } catch (Exception e) {
            e.printStackTrace();
            return false;
View Full Code Here

    }

    IPath path = getAbsolutePath(vertex.getParent().getFileName(),
        refinement);
    IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
    IResource resource = root.findMember(path);
    if (resource instanceof IFile) {
      return (IFile) resource;
    } else {
      return null;
    }
View Full Code Here

    IProgressMonitor monitor)
    throws CoreException {
    // create a sample file
    monitor.beginTask("Creating " + fileName, 2);
    IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
    IResource resource = root.findMember(new Path(containerName));
    if (!resource.exists() || !(resource instanceof IContainer)) {
      throwCoreException("Container \"" + containerName + "\" does not exist.");
    }
   
        createFile(resource, fileName, monitor);
View Full Code Here

        IClasspathEntry entries[] = javaProject.getResolvedClasspath(true);
        for (int i = 0; i < entries.length; i++) {
            IClasspathEntry classpathEntry = entries[i];
            if (classpathEntry.getEntryKind() == IClasspathEntry.CPE_SOURCE) {
                IPath outputLocation = ResourceUtils.getOutputLocation(classpathEntry, defaultOutputLocation);
                IResource resource = root.findMember(classpathEntry.getPath());
                // patch from 2891041: do not analyze derived "source" folders
                // because they probably contain auto-generated classes
                if (resource != null && resource.isDerived()) {
                    continue;
                }
View Full Code Here

     *            workspace relative path
     * @return given path if path is not known in workspace
     */
    public static IPath relativeToAbsolute(IPath relativePath) {
        IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
        IResource resource = root.findMember(relativePath);
        if (resource != null) {
            return resource.getLocation();
        }
        return relativePath;
    }
View Full Code Here

        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

    IProgressMonitor monitor)
    throws CoreException {
    // create a sample file
    monitor.beginTask("Creating " + fileName, 2);
    IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
    IResource resource = root.findMember(new Path(containerName));
    if (!resource.exists() || !(resource instanceof IContainer)) {
      throwCoreException("Container \"" + containerName + "\" does not exist.");
    }
   
        createFile(resource, fileName, monitor);
View Full Code Here

  private void doFinish(String containerName, String fileName,
      IProgressMonitor monitor) throws CoreException {
    // create a sample file
    monitor.beginTask("Creating " + fileName, 2);
    IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
    IResource resource = root.findMember(new Path(containerName));
    if (!resource.exists() || !(resource instanceof IContainer)) {
      throwCoreException("Container \"" + containerName
          + "\" does not exist.");
    }
    IContainer container = (IContainer) resource;
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.