private void run(int offset, int length, IClassFile file) throws JavaModelException { if (!ActionUtil.isEditable(fEditor, getShell(), file)) return; RefactoringExecutionStarter.startIntroduceIndirectionRefactoring(file, offset, length, getShell()); }
private void run(IMethod method) throws JavaModelException { if (!ActionUtil.isEditable(fEditor, getShell(), method)) return; RefactoringExecutionStarter.startIntroduceIndirectionRefactoring(method, getShell()); } }
/** * Note: this method is for internal use only. Clients should not call this method. * @param unit the compilation unit * * @noreference This method is not intended to be referenced by clients. */ public void run(ICompilationUnit unit) { if (!ActionUtil.isEditable(fEditor, getShell(), unit)) return; ExternalizeWizard.open(unit, getShell()); }
private void run(ICompilationUnit unit, int offset, int length) { if (!ActionUtil.isEditable(fEditor, getShell(), unit)) return; RefactoringExecutionStarter.startConvertAnonymousRefactoring(unit, offset, length, getShell()); } }
private void run(int offset, int length, ICompilationUnit unit) throws JavaModelException { if (!ActionUtil.isEditable(fEditor, getShell(), unit)) return; RefactoringExecutionStarter.startIntroduceIndirectionRefactoring(unit, offset, length, getShell()); }
private void run(IMethod method) throws CoreException { if (method == null) { MessageDialog.openError(getShell(), ActionMessages.IntroduceParameterObjectAction_exceptiondialog_title, ActionMessages.IntroduceParameterObjectAction_can_not_run_refactoring_message); } else if (ActionUtil.isEditable(fEditor)) { RefactoringExecutionStarter.startIntroduceParameterObject(method, getShell()); } }
@Override public void run(ITextSelection selection) { try { if (!ActionUtil.isEditable(fEditor)) return; run(getSingleSelectedMethod(selection)); } catch (CoreException e) { ExceptionHandler.handle(e, getShell(), ActionMessages.IntroduceParameterObjectAction_exceptiondialog_title, ActionMessages.IntroduceParameterObjectAction_unexpected_exception); } }
@Override public void run(ITextSelection selection) { if (!ActionUtil.isEditable(fEditor)) return; if (canRunInEditor() && !isVarTypeSelection(selection)) doRun(); else MessageDialog.openInformation(getShell(), RefactoringMessages.RenameAction_rename, RefactoringMessages.RenameAction_unavailable); }
private void run(IType type, IField[] preselected, boolean editor) throws CoreException { if (!ElementValidator.check(type, getShell(), DIALOG_TITLE, editor)) return; if (!ActionUtil.isEditable(fEditor, getShell(), type)) return; if (!canRunOn(type)) return; showUI(type, preselected); }
private void run(IType type, IField[] preselected, boolean editor) throws CoreException { if (!ElementValidator.check(type, getShell(), DIALOG_TITLE, editor)) return; if (!ActionUtil.isEditable(fEditor, getShell(), type)) return; if (!canRunOn(type)) return; showUI(type, preselected); }
public void run(IStructuredSelection selection) { try { Assert.isTrue(RefactoringAvailabilityTester.isMoveMethodAvailable(selection)); IMethod method= getSingleSelectedMethod(selection); Assert.isNotNull(method); if (!ActionUtil.isEditable(fEditor, getShell(), method)) return; RefactoringExecutionStarter.startMoveMethodRefactoring(method, getShell()); } catch (JavaModelException e) { ExceptionHandler.handle(e, getShell(), RefactoringMessages.MoveInstanceMethodAction_dialog_title, RefactoringMessages.MoveInstanceMethodAction_unexpected_exception); } }
/** * {@inheritDoc} */ public void run(final IStructuredSelection selection) { try { final IMember[] members= getSelectedMembers(selection); if (RefactoringAvailabilityTester.isExtractSupertypeAvailable(members) && ActionUtil.isEditable(getShell(), members[0])) RefactoringExecutionStarter.startExtractSupertypeRefactoring(members, getShell()); } catch (final JavaModelException exception) { ExceptionHandler.handle(exception, RefactoringMessages.OpenRefactoringWizardAction_refactoring, RefactoringMessages.OpenRefactoringWizardAction_exception); } }
public void run(ITextSelection selection) { if (!ActionUtil.isEditable(fEditor)) return; try{ ICompilationUnit unit= SelectionConverter.getInputAsCompilationUnit(fEditor); RefactoringExecutionStarter.startIntroduceParameter(unit, selection.getOffset(), selection.getLength(), getShell()); } catch (CoreException e){ ExceptionHandler.handle(e, RefactoringMessages.IntroduceParameterAction_dialog_title, RefactoringMessages.NewTextRefactoringAction_exception); } } }
@Override public void run(IStructuredSelection selection) { try { if (RefactoringAvailabilityTester.isUseSuperTypeAvailable(selection)) { IType singleSelectedType= getSingleSelectedType(selection); if (! ActionUtil.isEditable(getShell(), singleSelectedType)) return; RefactoringExecutionStarter.startUseSupertypeRefactoring(singleSelectedType, getShell()); } } catch (JavaModelException e) { ExceptionHandler.handle(e, RefactoringMessages.OpenRefactoringWizardAction_refactoring, RefactoringMessages.OpenRefactoringWizardAction_exception); } }
public void run(IStructuredSelection selection) { try { IMember[] members= getSelectedMembers(selection); for (int index= 0; index < members.length; index++) { if (!ActionUtil.isEditable(getShell(), members[index])) return; } if (RefactoringAvailabilityTester.isMoveStaticMembersAvailable(members)) RefactoringExecutionStarter.startMoveStaticMembersRefactoring(members, getShell()); } catch (JavaModelException e) { ExceptionHandler.handle(e, RefactoringMessages.OpenRefactoringWizardAction_refactoring, RefactoringMessages.OpenRefactoringWizardAction_exception); } }
@Override public void run(final IStructuredSelection selection) { try { final IMember[] members= getSelectedMembers(selection); if (RefactoringAvailabilityTester.isExtractSupertypeAvailable(members) && ActionUtil.isEditable(getShell(), members[0])) RefactoringExecutionStarter.startExtractSupertypeRefactoring(members, getShell()); } catch (final JavaModelException exception) { ExceptionHandler.handle(exception, RefactoringMessages.OpenRefactoringWizardAction_refactoring, RefactoringMessages.OpenRefactoringWizardAction_exception); } }
public void run(IStructuredSelection selection) { try { if (RefactoringAvailabilityTester.isExtractInterfaceAvailable(selection)) { IType singleSelectedType= RefactoringAvailabilityTester.getSingleSelectedType(selection); if (! ActionUtil.isEditable(getShell(), singleSelectedType)) return; RefactoringExecutionStarter.startExtractInterfaceRefactoring(singleSelectedType, getShell()); } } catch (JavaModelException e) { ExceptionHandler.handle(e, RefactoringMessages.OpenRefactoringWizardAction_refactoring, RefactoringMessages.OpenRefactoringWizardAction_exception); } }
@Override public void run(ITextSelection selection) { if (!ActionUtil.isEditable(fEditor)) return; ExtractConstantRefactoring refactoring= new ExtractConstantRefactoring(SelectionConverter.getInputAsCompilationUnit(fEditor), selection.getOffset(), selection.getLength()); new RefactoringStarter().activate(new ExtractConstantWizard(refactoring), getShell(), RefactoringMessages.ExtractConstantAction_extract_constant, RefactoringSaveHelper.SAVE_NOTHING); } }
public void run(ITextSelection selection) { if (!ActionUtil.isEditable(fEditor)) return; try{ final ExtractTempRefactoring refactoring= new ExtractTempRefactoring(SelectionConverter.getInputAsCompilationUnit(fEditor), selection.getOffset(), selection.getLength()); new RefactoringStarter().activate(refactoring, new ExtractTempWizard(refactoring), getShell(), RefactoringMessages.ExtractTempAction_extract_temp, RefactoringSaveHelper.SAVE_NOTHING); } catch (JavaModelException e){ ExceptionHandler.handle(e, RefactoringMessages.ExtractTempAction_extract_temp, RefactoringMessages.NewTextRefactoringAction_exception); } } }
@Override public void run(ITextSelection selection) { if (!ActionUtil.isProcessable(fEditor)) return; ITypeRoot editorInput= SelectionConverter.getInput(fEditor); if (!ActionUtil.isEditable(getShell(), editorInput)) return; if (editorInput instanceof ICompilationUnit) run(selection.getOffset(), selection.getLength(), (ICompilationUnit) editorInput); else if (editorInput instanceof IClassFile) run(selection.getOffset(), selection.getLength(), (IClassFile) editorInput); }