Bug 15301 'show in packages view' - does not work fo java files not in source folders
20020502 open a java file that is in a resource folder (so it is not an ICompilationUnit - just a file with .java extension) 'show in packages view' is present in the context menu but it does nothing
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/ShowInPackageViewAction.java
}
	
	private IJavaElement getVisibleParent(IJavaElement element) {
		switch (element.getElementType()) {
			case IJavaElement.IMPORT_DECLARATION:
			case IJavaElement.PACKAGE_DECLARATION:
			case IJavaElement.IMPORT_CONTAINER:
			case IJavaElement.TYPE:
			case IJavaElement.METHOD:
			case IJavaElement.FIELD:
			case IJavaElement.INITIALIZER:
				
				element= (IJavaElement)element.getOpenable();
				break;
			case IJavaElement.JAVA_MODEL:
				element= null;
				break;
		}
		if (element.getElementType() == IJavaElement.COMPILATION_UNIT) {
			ICompilationUnit unit= (ICompilationUnit)element;
			if (unit.isWorkingCopy())
				element= unit.getOriginalElement();
		}
		return element;
	}
	
	private static String getDialogTitle() {
		return ActionMessages.getString("ShowInPackageViewAction.dialog.title"); 
	}
}