use of org.autorefactor.jdt.internal.corext.dom.PrepareApplyRefactoringsJob in project AutoRefactor by JnRouvignac.
the class AutoRefactorHandler method execute.
/**
* Execute.
*
* @param event The event
*
* @return An object
*
* @throws ExecutionException ExecutionException
*/
@Override
public Object execute(final ExecutionEvent event) throws ExecutionException {
try {
Environment environment = AutoRefactorPlugin.getEnvironment();
new PrepareApplyRefactoringsJob(getSelectedJavaElements(event), AllCleanUpRules.getConfiguredRefactoringRules(environment.getPreferences()), environment).schedule();
} catch (Exception e) {
final Shell shell = HandlerUtil.getActiveShell(event);
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
e.printStackTrace(pw);
// $NON-NLS-1$
showMessage(shell, "An error has occurred:\n\n" + sw);
}
// resolvedTypeBinding().
return null;
}
use of org.autorefactor.jdt.internal.corext.dom.PrepareApplyRefactoringsJob in project AutoRefactor by JnRouvignac.
the class ChooseCleanupsWizard method performFinish.
@Override
public boolean performFinish() {
final List<RefactoringRule> refactoringRules = chooseCleanupsPage.getSelectedRefactorings();
new PrepareApplyRefactoringsJob(javaElements, refactoringRules, AutoRefactorPlugin.getEnvironment()).schedule();
return !refactoringRules.isEmpty();
}
Aggregations