private String getPathString(IPath fullPath) { if (fBasePath == null || !hasSameDevice(fullPath, fBasePath)) { return fullPath.toOSString(); } int matchingSegments= fBasePath.matchingFirstSegments(fullPath); if (fBasePath.segmentCount() == matchingSegments) { return getRelativePath(fullPath, matchingSegments); } for (int i= 0; i < fJavaProjects.length; i++) { IProject proj= fJavaProjects[i].getProject(); IPath projLoc= proj.getLocation(); if (projLoc != null && projLoc.segmentCount() <= matchingSegments && projLoc.isPrefixOf(fullPath)) { return getRelativePath(fullPath, matchingSegments); } } IPath workspaceLoc= ResourcesPlugin.getWorkspace().getRoot().getLocation(); if (workspaceLoc.segmentCount() <= matchingSegments && workspaceLoc.isPrefixOf(fullPath)) { return getRelativePath(fullPath, matchingSegments); } return fullPath.toOSString(); }
private String getPathString(IPath fullPath) { if (fBasePath == null || !hasSameDevice(fullPath, fBasePath)) { return fullPath.toOSString(); } int matchingSegments= fBasePath.matchingFirstSegments(fullPath); if (fBasePath.segmentCount() == matchingSegments) { return getRelativePath(fullPath, matchingSegments); } for (int i= 0; i < fJavaProjects.length; i++) { IProject proj= fJavaProjects[i].getProject(); IPath projLoc= proj.getLocation(); if (projLoc != null && projLoc.segmentCount() <= matchingSegments && projLoc.isPrefixOf(fullPath)) { return getRelativePath(fullPath, matchingSegments); } } IPath workspaceLoc= ResourcesPlugin.getWorkspace().getRoot().getLocation(); if (workspaceLoc.segmentCount() <= matchingSegments && workspaceLoc.isPrefixOf(fullPath)) { return getRelativePath(fullPath, matchingSegments); } return fullPath.toOSString(); }
private String getPathString(IPath fullPath) { if (fBasePath == null || !hasSameDevice(fullPath, fBasePath)) { return fullPath.toOSString(); } int matchingSegments= fBasePath.matchingFirstSegments(fullPath); if (fBasePath.segmentCount() == matchingSegments) { return getRelativePath(fullPath, matchingSegments); } for (int i= 0; i < fJavaProjects.length; i++) { IProject proj= fJavaProjects[i].getProject(); IPath projLoc= proj.getLocation(); if (projLoc != null && projLoc.segmentCount() <= matchingSegments && projLoc.isPrefixOf(fullPath)) { return getRelativePath(fullPath, matchingSegments); } } IPath workspaceLoc= ResourcesPlugin.getWorkspace().getRoot().getLocation(); if (workspaceLoc.segmentCount() <= matchingSegments && workspaceLoc.isPrefixOf(fullPath)) { return getRelativePath(fullPath, matchingSegments); } return fullPath.toOSString(); }