/*
  * (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);
   }
 }
 /**
  * Note: This constructor is for internal use only. Clients should not call this constructor.
  *
  * @param editor the JavaScript editor
  */
 public ChangeTypeAction(JavaEditor editor) {
   this(editor.getEditorSite());
   fEditor = editor;
   setEnabled(SelectionConverter.getInputAsCompilationUnit(fEditor) != null);
 }