Bug 126507 [CommonNavigator] [Java] Proposed Java extension for Common Navigator
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerLabelProvider.java
private boolean fIsFlatLayout;
	private PackageExplorerProblemsDecorator fProblemDecorator;
	PackageExplorerLabelProvider(long textFlags, int imageFlags, PackageExplorerContentProvider cp) {
		super(textFlags, imageFlags);
		fProblemDecorator= new PackageExplorerProblemsDecorator();
		addLabelDecorator(fProblemDecorator);
		Assert.isNotNull(cp);
		fContentProvider= cp;
	}
	public String getText(Object element) {
		
		if (fIsFlatLayout || !(element instanceof IPackageFragment))
			return super.getText(element);			
		IPackageFragment fragment = (IPackageFragment) element;
		
		if (fragment.isDefaultPackage()) {
			return super.getText(fragment);
		} else {
			Object parent= fContentProvider.getPackageFragmentProvider().getParent(fragment);
			if (parent instanceof IPackageFragment) {
				return getNameDelta((IPackageFragment) parent, fragment);
			} else if (parent instanceof IFolder) {
				int prefixLength= getPrefixLength((IFolder) parent);
				return fragment.getElementName().substring(prefixLength);
			}
			else return super.getText(fragment);
		}
	}
	
	private int getPrefixLength(IFolder folder) {