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
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.ui.IContextMenuConstants;
/**
 * Action group to add the Import and Export action to a view part's
 * context menu.
 * 
 * @sine 2.0
 */
public class ImportActionGroup extends ActionGroup {
	private static final String GROUP_IMPORT= "group.import"; 
	
	private static final int FAILED= 1 << 0;
	private static final int IMPORT= 1 << 1;
	private static final int EXPORT= 1 << 2;
	private static final int IMPORT_EXPORT= IMPORT | EXPORT;
	private ImportResourcesAction fImportAction;
	private ExportResourcesAction fExportAction;
	/**
	 * Creates a new <code>ImportActionGroup</code>.
	 * 
	 * @param part the view part that owns this action group
	 */
	public ImportActionGroup(IViewPart part) {
		IWorkbench workbench = part.getSite().getWorkbenchWindow().getWorkbench();
		fImportAction= new ImportResourcesAction(workbench);
		fExportAction= new ExportResourcesAction(workbench);			
	}
	
	/* (non-Javadoc)