Package org.eclipse.core.resources

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


                message = parts[2];
              }
             
              int lineNo = 1;
              lineNo = Integer.parseInt(parts[1]);
              IResource testFile = parent.findMember(parts[0].trim());
              MarkerUtilities.addMarker(testFile, lineNo, "Test: "+message, IMarker.SEVERITY_ERROR);
         
            } else if (line.matches("(^.*--- FAIL:.*)") ) {
              success = false;
              failedTests.add(line.substring(0, line.indexOf('('))
View Full Code Here


            CodeContext context = CodeContext.getTestCodeContext(activeTest.project, f);
           
            for (String name:failedTests){
              Function func = context.getFunctionForName(name+"()");
              if(func != null) {
                IResource res = parent.findMember(func.getFile().getName());
                MarkerUtilities.addMarker(res, func.getLine(), name+" failed.", IMarker.SEVERITY_ERROR);
              }
            }
          }
         
View Full Code Here

      path = path.makeRelative();
    }
    for(IResource resource : underlying) {
      if (resource instanceof IContainer) {
        IContainer c = (IContainer) resource;
        IResource candidate = c.findMember(path, true);
        if (candidate != null && candidate.exists()) {
          HashMap<String, IVirtualResource> map = new HashMap<String, IVirtualResource>(1);
          try {
            handleResource(candidate, map, 0);
            if (!map.isEmpty()) {
View Full Code Here

    return null;
  }

  protected IResource getResource(IPath path) {
    IContainer folder = getContainer(path, 1, false);
    return (folder != null ? folder.findMember(path.lastSegment()) : null);
  }

  protected IContainer getContainer(IPath path, int parentCount, boolean create) {
    IResource resource = ResourcesPlugin.getWorkspace().getRoot();
    for (int i = 0; i < path.segmentCount() - parentCount; i++) {
View Full Code Here

    String segments[] = uri.segments();
    boolean isPlatformURI = uri.isPlatformResource();
    int count = (isPlatformURI ? 1 : 0);
    IContainer folder = ResourcesPlugin.getWorkspace().getRoot();
    while (count < segments.length - 1) {
      IResource res = folder.findMember(segments[count]);
      if (! (res instanceof IContainer)) {
        return null;
      }
      folder = (IContainer)res;
      count++;
View Full Code Here

        return null;
      }
      folder = (IContainer)res;
      count++;
    }
    IResource res = folder.findMember(segments[count]);
    return (res == null && useFolder ? folder : res);
  }

  public static IJavaElement[] getJavaElementChildren(IParent parent) {
    IJavaElement[] children = null;
View Full Code Here

    else {
      container = (IProject) ((IResourceModelElement) getElementParent()).getElementResource();
      fullPath = container.getFullPath().append(fileName).toString();

      // Try to find the configuration file in the workspace
      file = (IFile) container.findMember(fileName);
    }

    if (file == null || !file.exists()) {
      modificationTimestamp = IResource.NULL_STAMP;
      String msg = "Beans config file '" + fullPath + "' not accessible";
View Full Code Here

    }

    value = arguments.get(FILE);
    if (value != null) {
      IContainer container = ResourcesPlugin.getWorkspace().getRoot();
      IResource resource = container.findMember(value);
      if (resource == null || !(resource instanceof IFile)) {
        status.merge(RefactoringStatus.createErrorStatus("Cannot get file"));
      }
      else {
        setFile((IFile) 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.