Package org.eclipse.core.runtime

Examples of org.eclipse.core.runtime.IPath


public synchronized void removeIndexFamily(IPath path) {
  // only finds cached index files... shutdown removes all non-cached index files
  ArrayList toRemove = null;
  Object[] containerPaths = this.indexLocations.keyTable;
  for (int i = 0, length = containerPaths.length; i < length; i++) {
    IPath containerPath = (IPath) containerPaths[i];
    if (containerPath == null) continue;
    if (path.isPrefixOf(containerPath)) {
      if (toRemove == null)
        toRemove = new ArrayList();
      toRemove.add(containerPath);
View Full Code Here


    if (VERBOSE)
      Util.verbose("-> saving index " + index.getIndexFile()); //$NON-NLS-1$
    index.save();
  }
  synchronized (this) {
    IPath containerPath = new Path(index.containerPath);
    if (this.jobEnd > this.jobStart) {
      for (int i = this.jobEnd; i > this.jobStart; i--) { // skip the current job
        IJob job = this.awaitingJobs[i];
        if (job instanceof IndexRequest)
          if (((IndexRequest) job).containerPath.equals(containerPath)) return;
      }
    }
    IPath indexLocation = computeIndexLocation(containerPath);
    updateIndexState(indexLocation, SAVED_STATE);
  }
}
View Full Code Here

    writer.write(getJavaPluginWorkingLocation().toOSString());
    writer.write('\n');
    Object[] keys = indexStates.keyTable;
    Object[] states = indexStates.valueTable;
    for (int i = 0, l = states.length; i < l; i++) {
      IPath key = (IPath) keys[i];
      if (key != null && !key.isEmpty() && states[i] == SAVED_STATE) {
        writer.write(key.lastSegment());
        writer.write('\n');
      }
    }
  } catch (IOException ignored) {
    if (VERBOSE)
View Full Code Here

          return Messages.bind(Messages.classpath_cycle, javaProject.getElementName());

        case DISABLED_CP_EXCLUSION_PATTERNS:
          javaProject = (IJavaProject)elements[0];
          String projectName = javaProject.getElementName();
          IPath newPath = path;
          if (path.segment(0).toString().equals(projectName)) {
            newPath = path.removeFirstSegments(1);
          }
          return Messages.bind(Messages.classpath_disabledInclusionExclusionPatterns, new String[] {newPath.makeRelative().toString(), projectName});

        case DISABLED_CP_MULTIPLE_OUTPUT_LOCATIONS:
          javaProject = (IJavaProject)elements[0];
          projectName = javaProject.getElementName();
          newPath = path;
          if (path.segment(0).toString().equals(projectName)) {
            newPath = path.removeFirstSegments(1);
          }
          return Messages.bind(Messages.classpath_disabledMultipleOutputLocations, new String[] {newPath.makeRelative().toString(), projectName});

        case INCOMPATIBLE_JDK_LEVEL:
            javaProject = (IJavaProject)elements[0];
            return Messages.bind(Messages.classpath_incompatibleLibraryJDKLevel, new String[]{ 
              javaProject.getElementName(),
View Full Code Here

    String key = event.getKey();
    if (key.startsWith(CP_USERLIBRARY_PREFERENCES_PREFIX)) {
      String libName = key.substring(CP_USERLIBRARY_PREFERENCES_PREFIX.length());
      try {
        // find affected projects
        IPath containerPath = new Path(JavaCore.USER_LIBRARY_CONTAINER_ID).append(libName);
        IJavaProject[] allJavaProjects = JavaCore.create(ResourcesPlugin.getWorkspace().getRoot()).getJavaProjects();
        ArrayList affectedProjects = new ArrayList();
        for (int i= 0; i < allJavaProjects.length; i++) {
          IJavaProject javaProject = allJavaProjects[i];
          IClasspathEntry[] entries= javaProject.getRawClasspath();
          for (int j= 0; j < entries.length; j++) {
            IClasspathEntry entry = entries[j];
            if (entry.getEntryKind() == IClasspathEntry.CPE_CONTAINER) {
              if (containerPath.equals(entry.getPath())) {
                affectedProjects.add(javaProject);
                break;
              }       
            }
          }
View Full Code Here

    for (int i = 0, length = entries.length; i < length; ++i) {
      ClasspathEntry cpEntry = (ClasspathEntry) entries[i];
   
      HashMap archive = new HashMap();
      archive.put(TAG_PATH, cpEntry.getPath().toString());
      IPath sourceAttach= cpEntry.getSourceAttachmentPath();
      if (sourceAttach != null)
        archive.put(TAG_SOURCEATTACHMENT, sourceAttach);
      IPath sourceAttachRoot= cpEntry.getSourceAttachmentRootPath();
      if (sourceAttachRoot != null)
        archive.put(TAG_SOURCEATTACHMENTROOT, sourceAttachRoot);       

      boolean hasExtraAttributes = cpEntry.extraAttributes != null && cpEntry.extraAttributes.length != 0;
      boolean hasRestrictions = cpEntry.getAccessRuleSet() != null; // access rule set is null if no access rules
View Full Code Here

     
      if (node.getNodeType() == Node.ELEMENT_NODE) {
        Element element= (Element) node;
        if (element.getNodeName().equals(TAG_ARCHIVE)) {
          String path = element.getAttribute(TAG_PATH);
          IPath sourceAttach= element.hasAttribute(TAG_SOURCEATTACHMENT) ? new Path(element.getAttribute(TAG_SOURCEATTACHMENT)) : null;
          IPath sourceAttachRoot= element.hasAttribute(TAG_SOURCEATTACHMENTROOT) ? new Path(element.getAttribute(TAG_SOURCEATTACHMENTROOT)) : null;
          NodeList children = element.getElementsByTagName("*"); //$NON-NLS-1$
          boolean[] foundChildren = new boolean[children.getLength()];
          NodeList attributeList = ClasspathEntry.getChildAttributes(ClasspathEntry.TAG_ATTRIBUTES, children, foundChildren);
          IClasspathAttribute[] extraAttributes = ClasspathEntry.decodeExtraAttributes(attributeList);
          attributeList = ClasspathEntry.getChildAttributes(ClasspathEntry.TAG_ACCESS_RULES, children, foundChildren);
View Full Code Here

        // contains a potential subtype as a local or anonymous type?
        boolean containsLocalType = false;
        if (localTypes == null) { // case of hierarchy on region
          containsLocalType = true;
        } else {
          IPath path = cu.getPath();
          containsLocalType = localTypes.contains(path.toString());
        }
       
        // build parsed unit
        CompilationUnitDeclaration parsedUnit = null;
        if (cu.isOpen()) {
View Full Code Here

    int cpLength = classpath.length;
    int newCPIndex = -1;

    for (int i = 0; i < cpLength; i++) {
      IClasspathEntry entry = classpath[i];
      IPath entryPath = entry.getPath();
      if (rootPath.equals(entryPath)) {
        // rename entry
        if (newClasspath == null) {
          newClasspath = new IClasspathEntry[cpLength];
          System.arraycopy(classpath, 0, newClasspath, 0, i);
          newCPIndex = i;
        }
        newClasspath[newCPIndex++] = copy(entry);
      } else if (this.destination.equals(entryPath)) {
        // remove entry equals to destination
        if (newClasspath == null) {
          newClasspath = new IClasspathEntry[cpLength];
          System.arraycopy(classpath, 0, newClasspath, 0, i);
          newCPIndex = i;
        }
      } else if (entry.getEntryKind() == IClasspathEntry.CPE_SOURCE) {
        // update exclusion/inclusion patterns
        IPath projectRelativePath = rootPath.removeFirstSegments(1);
        IPath[] newExclusionPatterns = renamePatterns(projectRelativePath, entry.getExclusionPatterns());
        IPath[] newInclusionPatterns = renamePatterns(projectRelativePath, entry.getInclusionPatterns());
        if (newExclusionPatterns != null || newInclusionPatterns != null) {
          if (newClasspath == null) {
            newClasspath = new IClasspathEntry[cpLength];
View Full Code Here

  private IPath[] renamePatterns(IPath rootPath, IPath[] patterns) {
    IPath[] newPatterns = null;
    int newPatternsIndex = -1;
    for (int i = 0, length = patterns.length; i < length; i++) {
      IPath pattern = patterns[i];
      if (pattern.equals(rootPath)) {
        if (newPatterns == null) {
          newPatterns = new IPath[length];
          System.arraycopy(patterns, 0, newPatterns, 0, i);
          newPatternsIndex = i;
        }
        IPath newPattern = this.destination.removeFirstSegments(1);
        if (pattern.hasTrailingSeparator())
          newPattern = newPattern.addTrailingSeparator();
        newPatterns[newPatternsIndex++] = newPattern;
      }
    }
    return newPatterns;
  }
View Full Code Here

TOP

Related Classes of org.eclipse.core.runtime.IPath

Copyright © 2018 www.massapicom. 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.