Bug 17045 Import/Export should always be on context menu of Packages view (or never)
Build 20020521 The Packages view does only include Import when a container is selected. It only includes Export when a container or file is selected. When the selection is empty, neither appear. The Navigator always includes Import/Export on the context menu. Filtering these action based on the selection makes too many assumptions about the kinds of available importers / exporters. For example, the importers for external projects and binary projects ignore the selection. Therefore, I currently cannot import binary projects via the packages view when my workspace is empty. Either these actions should always be included (and enabled), or always excluded.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/ImportActionGroup.java
* Method declared in ActionGroup
	 */
	public void fillContextMenu(IMenuManager menu) {
		IStructuredSelection selection= getStructuredSelection();
		if (selection == null)
			return;
			
		int mode= checkSelection(selection);
		if ((mode & FAILED) == 0) {
			menu.appendToGroup(IContextMenuConstants.GROUP_REORGANIZE, new Separator(GROUP_IMPORT));
			if ((mode  & IMPORT) != 0)
				menu.appendToGroup(GROUP_IMPORT, fImportAction);
			if ((mode & EXPORT) != 0)
				menu.appendToGroup(GROUP_IMPORT, fExportAction);
		}
		super.fillContextMenu(menu);
	}
	
	private void appendToGroup(IMenuManager menu, IAction action) {
		if (action.isEnabled())
			menu.appendToGroup(GROUP_IMPORT, action);
	}
	
	private IStructuredSelection getStructuredSelection() {
		ISelection selection= getContext().getSelection();
		if (selection instanceof IStructuredSelection)
			return (IStructuredSelection)selection;
		return null;
	}