Bug 66635 AddImportOnSelectionAction passes null process monitor to all types cache
I20040611_0100 Title says it all. We should avoid passing in null since the operation can take a while.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/AddImportOnSelectionAction.java
private CompilationUnitEditor fEditor;
	
	public AddImportOnSelectionAction(CompilationUnitEditor editor) {	
		super(JavaEditorMessages.getString("AddImportOnSelection.label"));		 
		setToolTipText(JavaEditorMessages.getString("AddImportOnSelection.tooltip")); 
		setDescription(JavaEditorMessages.getString("AddImportOnSelection.description")); 
		
		fEditor= editor;
		WorkbenchHelp.setHelp(this, IJavaHelpContextIds.ADD_IMPORT_ON_SELECTION_ACTION);
		setEnabled(getCompilationUnit() != null);	
	}
	
	public void update() {
		setEnabled(fEditor != null && getCompilationUnit() != null);
	}	
			
	private ICompilationUnit getCompilationUnit () {
		IWorkingCopyManager manager= JavaPlugin.getDefault().getWorkingCopyManager();				
		return manager.getWorkingCopy(fEditor.getEditorInput());
	}
	
	/*
	 * @see org.eclipse.jface.action.IAction#run()