public void run(IStructuredSelection selection) { try { IMember member = getMember(selection); if (member == null || !ActionUtil.isEditable(getShell(), member)) return; ISourceRange range = member.getNameRange(); RefactoringExecutionStarter.startChangeTypeRefactoring( member.getJavaScriptUnit(), getShell(), range.getOffset(), range.getLength()); } catch (CoreException e) { ExceptionHandler.handle( e, RefactoringMessages.ChangeTypeAction_dialog_title, RefactoringMessages.ChangeTypeAction_exception); } }
/* * (non-Javadoc) Method declared on SelectionDispatchAction */ public void run(ITextSelection selection) { if (!ActionUtil.isEditable(fEditor)) return; try { RefactoringExecutionStarter.startChangeTypeRefactoring( SelectionConverter.getInputAsCompilationUnit(fEditor), getShell(), selection.getOffset(), selection.getLength()); } catch (CoreException e) { ExceptionHandler.handle( e, RefactoringMessages.ChangeTypeAction_dialog_title, RefactoringMessages.ChangeTypeAction_exception); } }