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
buf.append(pack.getElementName());
		}
		if (getFlag(flags, P_POST_QUALIFIED)) {
			buf.append(CONCAT_STRING);
			getPackageFragmentRootLabel((IPackageFragmentRoot) pack.getParent(), ROOT_QUALIFIED, buf);
		}
	}
	/**
	 * Appends the label for a package fragment root to a {@link StringBuffer}. Considers the ROOT_* flags.
	 * 	@param root The element to render.
	 * @param flags The rendering flags. Flags with names starting with ROOT_' are considered.
	 * @param buf The buffer to append the resulting label to.
	 */	
	public static void getPackageFragmentRootLabel(IPackageFragmentRoot root, long flags, StringBuffer buf) {
		if (root.isArchive())
			getArchiveLabel(root, flags, buf);
		else
			getFolderLabel(root, flags, buf);
	}
	
	private static void getArchiveLabel(IPackageFragmentRoot root, long flags, StringBuffer buf) {
			
		if (getFlag(flags, ROOT_VARIABLE) && getVariableLabel(root, flags, buf))
			return;
		boolean external= root.isExternal();
		if (external)
			getExternalArchiveLabel(root, flags, buf);
		else
			getInternalArchiveLabel(root, flags, buf);
	}