Bug 127045 TypeInfoUtil.searchTypeInfo unnecessary
20060209 TypeInfoUtil.searchTypeInfo performs a search just to get a type info. This is too expensive and unnecessary. Either change the history to store qualified names or allow to create a type info from a qualified name (problem is the enclosing type names, so either we cheat there, or we need also the package name to evaluate the enclosing type names)
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/AddImportOnSelectionAction.java
}
		
	}
	private CompilationUnitEditor fEditor;
	public AddImportOnSelectionAction(CompilationUnitEditor editor) {
		super(JavaEditorMessages.AddImportOnSelection_label);
		setToolTipText(JavaEditorMessages.AddImportOnSelection_tooltip);
		setDescription(JavaEditorMessages.AddImportOnSelection_description);
		fEditor= editor;
		PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IJavaHelpContextIds.ADD_IMPORT_ON_SELECTION_ACTION);
		setEnabled(getCompilationUnit() != null);
	}
	public void update() {
		setEnabled(fEditor != null && getCompilationUnit() != null);
	}
	private ICompilationUnit getCompilationUnit () {
		if (fEditor == null) {
			return null;
		}
		IWorkingCopyManager manager= JavaPlugin.getDefault().getWorkingCopyManager();
		return manager.getWorkingCopy(fEditor.getEditorInput());
	}
	/*
	 * @see org.eclipse.jface.action.IAction#run()
	 */
	public void run() {
		final ICompilationUnit cu= getCompilationUnit();
		if (cu == null || fEditor == null)
			return;
		if (!ElementValidator.checkValidateEdit(cu, getShell(), JavaEditorMessages.AddImportOnSelection_error_title))