} finally { deregisterHelper(helper);
	public void run() {		final ICompilationUnit cu= getCompilationUnit();		if (cu == null || fEditor == null)			return;		if (!ElementValidator.checkValidateEdit(cu, getShell(), JavaEditorMessages.getString("AddImportOnSelection.error.title"))) //$NON-NLS-1$			return;		if (!ActionUtil.isProcessable(getShell(), cu))			return;					ISelection selection= fEditor.getSelectionProvider().getSelection();		IDocument doc= fEditor.getDocumentProvider().getDocument(fEditor.getEditorInput());		if (selection instanceof ITextSelection && doc != null) {			ITextSelection textSelection= (ITextSelection) selection;			AddImportsOperation op= new AddImportsOperation(cu, doc, textSelection.getOffset(), textSelection.getLength(), new SelectTypeQuery(getShell()));			try {				IProgressService progressService= PlatformUI.getWorkbench().getProgressService();				progressService.runInUI(fEditor.getSite().getWorkbenchWindow(), new WorkbenchRunnableAdapter(op, op.getScheduleRule()), op.getScheduleRule());				IStatus status= op.getStatus();				if (!status.isOK()) {					IStatusLineManager manager= getStatusLineManager();					if (manager != null) {						manager.setMessage(status.getMessage());					}				}			} catch (InvocationTargetException e) {				ExceptionHandler.handle(e, getShell(), JavaEditorMessages.getString("AddImportOnSelection.error.title"), null); //$NON-NLS-1$			} catch (InterruptedException e) {				// Do nothing. Operation has been canceled.			}		}			}