MessageDialog.openError(shell, JavaUIMessages.getString("AddMethodStubAction.error.title"), e.getTargetException().getMessage()); JavaPlugin.log(e.getTargetException());
ExceptionHandler.handle(e, shell, JavaUIMessages.getString("AddMethodStubAction.error.title"), null);
	public void run() {		if (!canActionBeAdded(fParentType, fSelection)) {			return;		}				Shell shell= JavaPlugin.getActiveWorkbenchShell();		try {					// open an editor and work on a working copy			IEditorPart editor= EditorUtility.openInEditor(fParentType);			IType usedType= (IType)EditorUtility.getWorkingCopy(fParentType);			if (usedType == null) {				MessageDialog.openError(shell, JavaUIMessages.getString("AddMethodStubAction.error.title"), JavaUIMessages.getString("AddMethodStubAction.error.type_removed_in_editor")); //$NON-NLS-2$ //$NON-NLS-1$				return;			}						CodeGenerationSettings settings= JavaPreferencesSettings.getCodeGenerationSettings();			List list= ((IStructuredSelection)fSelection).toList();				IMethod[] methods= (IMethod[]) list.toArray(new IMethod[list.size()]); 			AddMethodStubOperation op= new AddMethodStubOperation(usedType, methods, settings, createOverrideQuery(), createReplaceQuery(), false);					ProgressMonitorDialog dialog= new ProgressMonitorDialog(shell);			dialog.run(false, true, new WorkbenchRunnableAdapter(op));			IMethod[] res= op.getCreatedMethods();			if (res != null && res.length > 0 && editor != null) {				EditorUtility.revealInEditor(editor, res[0]);			}		} catch (InvocationTargetException e) {			MessageDialog.openError(shell, JavaUIMessages.getString("AddMethodStubAction.error.title"), e.getTargetException().getMessage()); //$NON-NLS-1$			JavaPlugin.log(e.getTargetException());		} catch (CoreException e) {			ErrorDialog.openError(shell, JavaUIMessages.getString("AddMethodStubAction.error.title"), null, e.getStatus()); //$NON-NLS-1$			JavaPlugin.log(e.getStatus());		} catch (InterruptedException e) {			// Do nothing. Operation has been canceled by user.		}	}