if (element == EXTERNAL_CONTAINER) {
return Messages.PathEntrySelectionDialog_6;
}
if (element instanceof IBuildpathEntry) {
IBuildpathEntry includePathEntry = (IBuildpathEntry) element;
return EnvironmentPathUtils.getLocalPathString(includePathEntry
.getPath());
}
if (!(element instanceof PathEntry)) {
return super.getText(element);
}
PathEntry entry = (PathEntry) element;
String path = entry.getResolvedPath();
if (entry.getType() == Type.WORKSPACE) {
VirtualPath tmpPath = entry.getAbstractPath().clone();
tmpPath.removeFirstSegment();
path = tmpPath.toString();
if (path.startsWith("/")) { //$NON-NLS-1$
path = path.substring(1);
}
}
if (entry.getType() == Type.INCLUDE_FOLDER
|| entry.getType() == Type.INCLUDE_VAR) {
IBuildpathEntry includePathEntry = (IBuildpathEntry) entry
.getContainer();
String includePath = EnvironmentPathUtils
.getLocalPathString(includePathEntry.getPath());
if (includePathEntry.getEntryKind() == IBuildpathEntry.BPE_VARIABLE) {
IPath p = DLTKCore.getResolvedVariablePath(includePathEntry
.getPath());
if (p != null) {
includePath = p.toOSString();
}
}