Package org.eclipse.core.resources

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


   */
  public IFile addTemplateToProject(String destinationContainer,
      String templateContent, IProgressMonitor monitor, int noOfTicks)
      throws CoreException {
    IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
    IResource resource = root.findMember(new Path(destinationContainer));
    if (!resource.exists() || !(resource instanceof IContainer)) {
      throw ExceptionHandler.getNewCoreException(destinationContainer + " does not exist!", null);
    }
    IContainer container = (IContainer) resource;
    String templateFileName= templateConfig.getName().replace(" ", "") + ".java";
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;
  }
  public String getSourceAttachmentLocation() {
View Full Code Here

   * @return the container to the corresponding container name.
   * @throws CoreException
   */
  private IResource getContainer(String containerName) throws CoreException {
    IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
    IResource resource = root.findMember(new Path(containerName));
    if (!resource.exists() || !(resource instanceof IContainer)) {
      throwCoreException("Container \"" + containerName + "\" does not exist.", IStatus.ERROR);
    }
    return resource;
  }
View Full Code Here

    uri = uri.trimFileExtension();
    uri = uri.appendFileExtension("dispel");
    ResourceSet rSet = d.eResource().getResourceSet();
    final IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace(
        ).getRoot();
    IResource file = workspaceRoot.findMember(uri.toPlatformString(true));
   
    try {
      if (file == null || !file.exists()) {
        Resource createResource = rSet.createResource(uri);
        createResource.save(new HashMap());
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;
  }
  public String getSourceAttachmentLocation() {
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;
  }
  public String getSourceAttachmentLocation() {
View Full Code Here

    }
    List<IJavaProject> alreadySelected = new ArrayList<IJavaProject>();
    IRuntimeClasspathEntry[] entries = getViewer().getEntries();
    for (int i = 0; i < entries.length; i++) {
      if (entries[i].getType() == IRuntimeClasspathEntry.PROJECT) {
        IResource res = root.findMember(entries[i].getPath());
        IJavaProject jp = (IJavaProject)JavaCore.create(res);
        alreadySelected.add(jp);
      }
    }
    remaining.removeAll(alreadySelected);
View Full Code Here

    }
    List<IJavaProject> alreadySelected = new ArrayList<IJavaProject>();
    IRuntimeClasspathEntry[] entries = getViewer().getEntries();
    for (int i = 0; i < entries.length; i++) {
      if (entries[i].getType() == IRuntimeClasspathEntry.PROJECT) {
        IResource res = root.findMember(entries[i].getPath());
        IJavaProject jp = (IJavaProject)JavaCore.create(res);
        alreadySelected.add(jp);
      }
    }
    remaining.removeAll(alreadySelected);
View Full Code Here

    }
    List<IJavaProject> alreadySelected = new ArrayList<IJavaProject>();
    IRuntimeClasspathEntry[] entries = getViewer().getEntries();
    for (int i = 0; i < entries.length; i++) {
      if (entries[i].getType() == IRuntimeClasspathEntry.PROJECT) {
        IResource res = root.findMember(entries[i].getPath());
        IJavaProject jp = (IJavaProject)JavaCore.create(res);
        alreadySelected.add(jp);
      }
    }
    remaining.removeAll(alreadySelected);
View Full Code Here

    if(path.toFile().exists()){
      return path.toFile();
    }

    IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
    IResource resourceInRuntimeWorkspace = root.findMember(path);
    if( resourceInRuntimeWorkspace ==null) {
      return path.toFile();
    }

    File file = new File(resourceInRuntimeWorkspace.getLocationURI());
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.