Example #1
0
 public void run(IStructuredSelection selection) {
   if (ReorgUtils.containsOnlyProjects(selection.toList())) {
     createWorkbenchAction(selection).run();
     return;
   }
   try {
     startDeleteRefactoring(selection.toArray(), getShell());
   } catch (CoreException e) {
     ExceptionHandler.handle(
         e,
         RefactoringMessages.OpenRefactoringWizardAction_refactoring,
         RefactoringMessages.OpenRefactoringWizardAction_exception);
   }
 }
Example #2
0
 /*
  * @see SelectionDispatchAction#selectionChanged(IStructuredSelection)
  */
 public void selectionChanged(IStructuredSelection selection) {
   if (ReorgUtils.containsOnlyProjects(selection.toList())) {
     setEnabled(createWorkbenchAction(selection).isEnabled());
     return;
   }
   try {
     setEnabled(RefactoringAvailabilityTester.isDeleteAvailable(selection.toArray()));
   } catch (CoreException e) {
     // no ui here - this happens on selection changes
     // http://bugs.eclipse.org/bugs/show_bug.cgi?id=19253
     if (ScriptModelUtil.isExceptionToBeLogged(e)) DLTKUIPlugin.log(e);
     setEnabled(false);
   }
 }