Esempio n. 1
0
 private void updateForcePreview() {
   boolean forcePreview = false;
   Refactoring refactoring = getRefactoring();
   ITextUpdating tu = (ITextUpdating) refactoring.getAdapter(ITextUpdating.class);
   IQualifiedNameUpdating qu =
       (IQualifiedNameUpdating) refactoring.getAdapter(IQualifiedNameUpdating.class);
   if (tu != null) {
     forcePreview = tu.getUpdateTextualMatches();
   }
   if (qu != null) {
     forcePreview |= qu.getUpdateQualifiedNames();
   }
   getRefactoringWizard().setForcePreviewReview(forcePreview);
 }
Esempio n. 2
0
 public UserInterfaceStarter getStarter(Refactoring refactoring) {
   RefactoringProcessor processor =
       (RefactoringProcessor) refactoring.getAdapter(RefactoringProcessor.class);
   if (processor == null) return null;
   Tuple tuple = fMap.get(processor.getClass());
   if (tuple == null) return null;
   try {
     UserInterfaceStarter starter = tuple.starter.newInstance();
     Class<? extends RefactoringWizard> wizardClass = tuple.wizard;
     Constructor<? extends RefactoringWizard> constructor =
         wizardClass.getConstructor(new Class[] {Refactoring.class});
     RefactoringWizard wizard = constructor.newInstance(new Object[] {refactoring});
     starter.initialize(wizard);
     return starter;
   } catch (NoSuchMethodException e) {
     return null;
   } catch (IllegalAccessException e) {
     return null;
   } catch (InstantiationException e) {
     return null;
   } catch (IllegalArgumentException e) {
     return null;
   } catch (InvocationTargetException e) {
     return null;
   }
 }