Bug 29846 Package Explorer shows leading slash in status line for resource files
build I20030115 - load org.eclipse.jface as source - in the Package Explorer, select org.eclipse.jface/src - the status line shows: org.eclipse.jface/src - select org.eclipse.jface/scripts - the status line shows: /org.eclipse.jface/scripts - select org.eclipse.jface/src/org.eclipse.jface.action/Action.java - the status line shows: org.eclipse.jface.action.Action.java - org.eclipse.jface/src - select org.eclipse.jface/src/org.eclipse.jface.action/package.html - the status line shows: /org.eclipse.jface/src/org/eclipse/jface/action/package.html Leading slashes should be omitted. We generally try to avoid using leading slashes in the UI. Compare with the Navigator. Also, note that using / to separate segments in package names leads to an inconsistency with what is presented in the view. The view shows "org.eclipse.jface.action" but the status line shows "org/eclipse/jface/action". Could still follow the same format as for Java files, showing pkg.file - srcFolder. e.g. org.eclipse.jface.action.messages.properties - org.eclipse.jface/src or: messages.properties - org.eclipse.jface.action - org.eclipse.jface/src
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/viewsupport/StatusBarUpdater.java
}
	
	
	protected String formatMessage(ISelection sel) {
		if (sel instanceof IStructuredSelection && !sel.isEmpty()) {
			IStructuredSelection selection= (IStructuredSelection) sel;
			
			int nElements= selection.size();
			if (nElements > 1) {
				return JavaUIMessages.getFormattedString("StatusBarUpdater.num_elements_selected", String.valueOf(nElements)); 
			} else { 
				Object elem= selection.getFirstElement();
				if (elem instanceof IJavaElement) {
					return formatJavaElementMessage((IJavaElement) elem);
				} else if (elem instanceof IResource) {
					return formatResourceMessage((IResource) elem);
				}
			}
		}
		return "";  
	}
		
	private String formatJavaElementMessage(IJavaElement element) {
		return JavaElementLabels.getElementLabel(element, LABEL_FLAGS);
	}
		
	private String formatResourceMessage(IResource element) {
		return element.getFullPath().toString();
	}	
}