Package org.eclipse.core.resources

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


    try {
      IProject currProject = getProject();
      IWorkspaceRoot wsroot = ResourcesPlugin.getWorkspace().getRoot();
      IResource init = null;
      if (params.getRoot() != null) {
        init = wsroot.findMember(currProject.getName() + params.getRoot());
      }
      Class[] acceptedClasses = new Class[] { IProject.class, IFolder.class };
      ISelectionStatusValidator validator = new TypedElementSelectionValidator(acceptedClasses, false);
      IProject[] allProjects = wsroot.getProjects();
      ArrayList rejectedElements = new ArrayList(allProjects.length);
View Full Code Here


  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;
    final IFile file = container.getFile(new Path(fileName));
View Full Code Here

    boolean includeDataBase)
    throws CoreException {
    // create a sample file
    monitor.beginTask("Creating " + planName, 1);
    IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
    IResource resource = root.findMember(new Path(containerName));
    if (!resource.exists() || !(resource instanceof IContainer)) {
      throwCoreException("Container \"" + containerName + "\" does not exist.");
    }
    IFolder container = (IFolder) resource;
    final IFile file = ToolProjectSupport.createNewPlan(container, planName, includeDataBase, includeDataBase);
View Full Code Here

    IProgressMonitor monitor)
    throws CoreException {
    // create a cdf 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;
    final IFile fileCDF = container.getFile(new Path(fileName + ".cdf"));
View Full Code Here

          List<IFile> fileItems = new ArrayList<IFile>();
          for (Object item : items){
            if (item instanceof IFile)
              fileItems.add((IFile) item);
            else {
              IFile file = (IFile) root.findMember(item.toString());
              if (file != null)
                fileItems.add( file );
            }
          }
          return fileItems.toArray();
View Full Code Here

    if (relativeToWorkspace) {
      IWorkspaceRoot workspaceRoot = getWorkspaceRoot();
      if (workspaceRoot != null) {
        IPath wsRootPath = workspaceRoot.getLocation();
        IPath srcPath = new Path(newSourceLocation);
        if (workspaceRoot.findMember(srcPath) != null) {
          sourceLocation = newSourceLocation;
        } else if (wsRootPath.isPrefixOf(srcPath)) {
          int segmentsMatched = wsRootPath.matchingFirstSegments(srcPath);
          srcPath = srcPath.removeFirstSegments(segmentsMatched).setDevice(null);
          sourceLocation = srcPath.toOSString();
View Full Code Here

            if (model != null) {
              String baseLocation = model.getBaseLocation();
              if (baseLocation != null && baseLocation.length() > 0) {
                IWorkspaceRoot wsRoot = ResourcesPlugin.getWorkspace().getRoot();
                if (wsRoot != null) {
                  IResource jspRes = wsRoot.findMember(baseLocation);
                  if (jspRes != null) {
                    IContainer jspFolder = jspRes.getParent();
                    if (jspFolder != null) {
                      IResource imageRes = jspFolder.findMember(imagePath);
                      if (imageRes != null) {
View Full Code Here

    monitor.setTaskName("Creating file...");

    // get the project path
    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;
    final IFile file = container.getFile(new Path(filename));
View Full Code Here

   * @return
   * @throws CoreException
   */
  public IFile getOutputFile() throws CoreException {
    IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
    IResource resource = root.findMember(new Path(getContainerName()));
    if (!resource.exists() || !(resource instanceof IContainer)) {
      throwCoreException(
          "Container \"" + getContainerName() + "\" does not exist.");
    }

View Full Code Here

    if (relativeToWorkspace) {
      IWorkspaceRoot workspaceRoot = getWorkspaceRoot();
      if (workspaceRoot != null) {
        IPath wsRootPath = workspaceRoot.getLocation();
        IPath srcPath = new Path(newSourceLocation);
        if (workspaceRoot.findMember(srcPath) != null) {
          sourceLocation = newSourceLocation;
        } else if (wsRootPath.isPrefixOf(srcPath)) {
          int segmentsMatched = wsRootPath.matchingFirstSegments(srcPath);
          srcPath = srcPath.removeFirstSegments(segmentsMatched).setDevice(null);
          sourceLocation = srcPath.toOSString();
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.