Bug 116199 [render] Easy-to-read .jar file reference
In the "Package Explorer" one often ends up with complicated or long paths to the jar files that are rererenced, and because of this the file name often ends up outside the viewable area, the explorer being relatively narrow. The idea here is simply to replace the label text with "shortname (path)" in stead of "path/shortname". I.e. in stead of the current label text that might be M2_REPO/junit/junit/3.8.1/junit-3.8.1.jar Use jarfile.jar (M2_REPO/junit/junit/3.8.1) or jarfile.jar (M2_REPO/junit/junit/3.8.1/junit-3.8.1.jar) This way, one can always see the name of the jar file in the browser.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/JavaElementLabels.java
}
	
	private static String getPkgNamePatternForPackagesView() {
		IPreferenceStore store= PreferenceConstants.getPreferenceStore();
		if (!store.getBoolean(PreferenceConstants.APPEARANCE_COMPRESS_PACKAGE_NAMES))
			return ""; 
		return store.getString(PreferenceConstants.APPEARANCE_PKG_NAME_PATTERN_FOR_PKG_VIEW);
	}
	
	/**
	 * Returns the label of a classpath container
	 * @param containerPath The path of the container.
	 * @param project The project the container is resolved in.
	 * @return Returns the label of the classpath container
	 * @throws JavaModelException Thrown when the resolving of the container failed.
	 */
	public static String getContainerEntryLabel(IPath containerPath, IJavaProject project) throws JavaModelException {
		IClasspathContainer container= JavaCore.getClasspathContainer(containerPath, project);
		if (container != null) {
			return container.getDescription();
		}
		ClasspathContainerInitializer initializer= JavaCore.getClasspathContainerInitializer(containerPath.segment(0));
		if (initializer != null) {
			return initializer.getDescription(containerPath, project);
		}
		return containerPath.toString();
	}
	
}