Exemplo n.º 1
0
 @Override
 public String toString() {
   IIndexFileLocation loc = null;
   try {
     loc = getLocation();
   } catch (CoreException e) {
   }
   return loc != null ? loc.toString() : super.toString();
 }
 private IPath getLabel(IIndexFileLocation ifl) {
   String fullPath = ifl.getFullPath();
   if (fullPath != null) {
     return new Path(fullPath);
   }
   IPath path = IndexLocationFactory.getAbsolutePath(ifl);
   if (path != null) {
     return path;
   }
   URI uri = ifl.getURI();
   return new Path(EFSExtensionManager.getDefault().getPathFromURI(uri));
 }
Exemplo n.º 3
0
 /**
  * This method should not be called on PDOMFile objects that are referenced by the file index.
  *
  * @param location a new location
  * @throws CoreException
  */
 public void setLocation(IIndexFileLocation location) throws CoreException {
   String locationString = fLinkage.getPDOM().getLocationConverter().toInternalFormat(location);
   if (locationString == null) {
     throw new CoreException(
         CCorePlugin.createStatus(
             Messages.getString("PDOMFile.toInternalProblem")
                 + //$NON-NLS-1$
                 location.getURI()));
   }
   setInternalLocation(locationString);
 }
Exemplo n.º 4
0
 public PDOMFile(
     PDOMLinkage linkage, IIndexFileLocation location, int linkageID, ISignificantMacros macros)
     throws CoreException {
   fLinkage = linkage;
   this.location = location;
   Database db = fLinkage.getDB();
   record = db.malloc(RECORD_SIZE);
   String locationString = fLinkage.getPDOM().getLocationConverter().toInternalFormat(location);
   if (locationString == null)
     throw new CoreException(
         CCorePlugin.createStatus(
             Messages.getString("PDOMFile.toInternalProblem") + location.getURI())); // $NON-NLS-1$
   IString locationDBString = db.newString(locationString);
   db.putRecPtr(record + LOCATION_REPRESENTATION, locationDBString.getRecord());
   db.put3ByteUnsignedInt(record + LINKAGE_ID, linkageID);
   db.putRecPtr(record + SIGNIFICANT_MACROS, db.newString(macros.encode()).getRecord());
   setTimestamp(-1);
 }
Exemplo n.º 5
0
 @SuppressWarnings("nls")
 public String toInternalFormat(IIndexFileLocation location) {
   if (location.getFullPath() != null) return location.getFullPath();
   return location.getURI().getSchemeSpecificPart();
 }