public void run(ITextSelection selection) { try { checkAndRun(SelectionConverter.getTypeAtOffset(fEditor)); } catch (CoreException e) { ExceptionHandler.handle(e, getShell(), ActionMessages.GenerateHashCodeEqualsAction_error_caption, ActionMessages.GenerateHashCodeEqualsAction_error_cannot_create); } }
@Override public void run(ITextSelection selection) { try { checkAndRun(SelectionConverter.getTypeAtOffset(fEditor)); } catch (CoreException e) { ExceptionHandler.handle(e, getShell(), getErrorCaption(), ActionMessages.GenerateMethodAbstractAction_error_cannot_create); } }
@Override public void run(ITextSelection selection) { try { checkAndRun(SelectionConverter.getTypeAtOffset(fEditor)); } catch (CoreException e) { ExceptionHandler.handle(e, getShell(), getErrorCaption(), ActionMessages.GenerateMethodAbstractAction_error_cannot_create); } }
@Override public void run(ITextSelection selection) { if (!ActionUtil.isProcessable(fEditor)) return; try { Shell shell= getShell(); IType type= SelectionConverter.getTypeAtOffset(fEditor); if (type != null) run(shell, type, true); else MessageDialog.openInformation(shell, getDialogTitle(), ActionMessages.AddUnimplementedConstructorsAction_not_applicable); } catch (JavaModelException e) { ExceptionHandler.handle(e, getShell(), getDialogTitle(), null); } catch (CoreException e) { ExceptionHandler.handle(e, getShell(), getDialogTitle(), null); } }
@Override public void run(ITextSelection selection) { if (!ActionUtil.isProcessable(fEditor)) return; try { Shell shell= getShell(); IType type= SelectionConverter.getTypeAtOffset(fEditor); if (type != null) run(shell, type, true); else MessageDialog.openInformation(shell, getDialogTitle(), ActionMessages.AddUnimplementedConstructorsAction_not_applicable); } catch (JavaModelException e) { ExceptionHandler.handle(e, getShell(), getDialogTitle(), null); } catch (CoreException e) { ExceptionHandler.handle(e, getShell(), getDialogTitle(), null); } }
public void run(ITextSelection selection) { if (!ActionUtil.isProcessable(fEditor)) return; try { Shell shell= getShell(); IType type= SelectionConverter.getTypeAtOffset(fEditor); if (type != null) run(shell, type, true); else MessageDialog.openInformation(shell, getDialogTitle(), ActionMessages.AddUnimplementedConstructorsAction_not_applicable); } catch (JavaModelException e) { ExceptionHandler.handle(e, getShell(), getDialogTitle(), null); } catch (CoreException e) { ExceptionHandler.handle(e, getShell(), getDialogTitle(), null); } }
@Override public void run(ITextSelection selection) { try { IJavaElement element= SelectionConverter.getElementAtOffset(fEditor); if (!ActionUtil.isEditable(fEditor, getShell(), element)) return; int type= element != null ? element.getElementType() : -1; if (type != IJavaElement.METHOD && type != IJavaElement.TYPE && type != IJavaElement.FIELD) { element= SelectionConverter.getTypeAtOffset(fEditor); if (element == null) { MessageDialog.openInformation(getShell(), getDialogTitle(), ActionMessages.AddJavaDocStubsAction_not_applicable); return; } } IMember[] members= new IMember[] { (IMember)element }; if (ElementValidator.checkValidateEdit(members, getShell(), getDialogTitle())) run(members); } catch (CoreException e) { ExceptionHandler.handle(e, getShell(), getDialogTitle(), ActionMessages.AddJavaDocStubsAction_error_actionFailed); } }
@Override public void run(ITextSelection selection) { try { IJavaElement element= SelectionConverter.getElementAtOffset(fEditor); if (!ActionUtil.isEditable(fEditor, getShell(), element)) return; int type= element != null ? element.getElementType() : -1; if (type != IJavaElement.METHOD && type != IJavaElement.TYPE && type != IJavaElement.FIELD) { element= SelectionConverter.getTypeAtOffset(fEditor); if (element == null) { MessageDialog.openInformation(getShell(), getDialogTitle(), ActionMessages.AddJavaDocStubsAction_not_applicable); return; } } IMember[] members= new IMember[] { (IMember)element }; if (ElementValidator.checkValidateEdit(members, getShell(), getDialogTitle())) run(members); } catch (CoreException e) { ExceptionHandler.handle(e, getShell(), getDialogTitle(), ActionMessages.AddJavaDocStubsAction_error_actionFailed); } }
public void run(ITextSelection selection) { try { IJavaElement element= SelectionConverter.getElementAtOffset(fEditor); if (!ActionUtil.isEditable(fEditor, getShell(), element)) return; int type= element != null ? element.getElementType() : -1; if (type != IJavaElement.METHOD && type != IJavaElement.TYPE && type != IJavaElement.FIELD) { element= SelectionConverter.getTypeAtOffset(fEditor); if (element == null) { MessageDialog.openInformation(getShell(), getDialogTitle(), ActionMessages.AddJavaDocStubsAction_not_applicable); return; } } IMember[] members= new IMember[] { (IMember)element }; if (ElementValidator.checkValidateEdit(members, getShell(), getDialogTitle())) run(members[0].getCompilationUnit(), members); } catch (CoreException e) { ExceptionHandler.handle(e, getShell(), getDialogTitle(), ActionMessages.AddJavaDocStubsAction_error_actionFailed); } }
@Override public void run(ITextSelection selection) { try { final IType type= SelectionConverter.getTypeAtOffset(fEditor); if (type != null) { if (!ElementValidator.check(type, getShell(), getDialogTitle(), false) || !ActionUtil.isEditable(fEditor, getShell(), type)) { notifyResult(false); return; } if (type.isAnnotation()) { MessageDialog.openInformation(getShell(), getDialogTitle(), ActionMessages.OverrideMethodsAction_annotation_not_applicable); notifyResult(false); return; } run(getShell(), type); } else { MessageDialog.openInformation(getShell(), getDialogTitle(), ActionMessages.OverrideMethodsAction_not_applicable); } } catch (JavaModelException e) { ExceptionHandler.handle(e, getShell(), getDialogTitle(), null); } catch (CoreException e) { ExceptionHandler.handle(e, getShell(), getDialogTitle(), ActionMessages.OverrideMethodsAction_error_actionfailed); } }
@Override public void run(ITextSelection selection) { try { final IType type= SelectionConverter.getTypeAtOffset(fEditor); if (type != null) { if (!ElementValidator.check(type, getShell(), getDialogTitle(), false) || !ActionUtil.isEditable(fEditor, getShell(), type)) { notifyResult(false); return; } if (type.isAnnotation()) { MessageDialog.openInformation(getShell(), getDialogTitle(), ActionMessages.OverrideMethodsAction_annotation_not_applicable); notifyResult(false); return; } run(getShell(), type); } else { MessageDialog.openInformation(getShell(), getDialogTitle(), ActionMessages.OverrideMethodsAction_not_applicable); } } catch (JavaModelException e) { ExceptionHandler.handle(e, getShell(), getDialogTitle(), null); } catch (CoreException e) { ExceptionHandler.handle(e, getShell(), getDialogTitle(), ActionMessages.OverrideMethodsAction_error_actionfailed); } }
public void run(ITextSelection selection) { try { final IType type= SelectionConverter.getTypeAtOffset(fEditor); if (type != null) { if (!ElementValidator.check(type, getShell(), getDialogTitle(), false) || !ActionUtil.isEditable(fEditor, getShell(), type)) { notifyResult(false); return; } if (type.isAnnotation()) { MessageDialog.openInformation(getShell(), getDialogTitle(), ActionMessages.OverrideMethodsAction_annotation_not_applicable); notifyResult(false); return; } if (type.isInterface()) { MessageDialog.openInformation(getShell(), getDialogTitle(), ActionMessages.OverrideMethodsAction_interface_not_applicable); notifyResult(false); return; } run(getShell(), type); } else { MessageDialog.openInformation(getShell(), getDialogTitle(), ActionMessages.OverrideMethodsAction_not_applicable); } } catch (JavaModelException e) { ExceptionHandler.handle(e, getShell(), getDialogTitle(), null); } catch (CoreException e) { ExceptionHandler.handle(e, getShell(), getDialogTitle(), ActionMessages.OverrideMethodsAction_error_actionfailed); } }