public static void startMoveRefactoring(final IResource[] resources, final IJavaElement[] elements, final Shell shell) throws JavaModelException { IMovePolicy policy= ReorgPolicyFactory.createMovePolicy(resources, elements); if (policy.canEnable()) { final JavaMoveProcessor processor= new JavaMoveProcessor(policy); final JavaMoveRefactoring refactoring= new JavaMoveRefactoring(processor); final RefactoringWizard wizard= new ReorgMoveWizard(refactoring); processor.setCreateTargetQueries(new CreateTargetQueries(wizard)); processor.setReorgQueries(new ReorgQueries(wizard)); new RefactoringStarter().activate(refactoring, wizard, shell, RefactoringMessages.OpenRefactoringWizardAction_refactoring, RefactoringSaveHelper.SAVE_ALL); } }
public static void startMoveRefactoring(final IResource[] resources, final IJavaElement[] elements, final Shell shell) throws JavaModelException { IMovePolicy policy= ReorgPolicyFactory.createMovePolicy(resources, elements); if (policy.canEnable()) { JavaMoveProcessor processor= new JavaMoveProcessor(policy); Refactoring refactoring= new MoveRefactoring(processor); RefactoringWizard wizard= new ReorgMoveWizard(processor, refactoring); processor.setCreateTargetQueries(new CreateTargetQueries(wizard)); processor.setReorgQueries(new ReorgQueries(wizard)); new RefactoringStarter().activate(wizard, shell, RefactoringMessages.OpenRefactoringWizardAction_refactoring, processor.getSaveMode()); } }
public static void startMoveRefactoring(final IResource[] resources, final IJavaElement[] elements, final Shell shell) throws JavaModelException { IMovePolicy policy= ReorgPolicyFactory.createMovePolicy(resources, elements); if (policy.canEnable()) { JavaMoveProcessor processor= new JavaMoveProcessor(policy); Refactoring refactoring= new MoveRefactoring(processor); RefactoringWizard wizard= new ReorgMoveWizard(processor, refactoring); processor.setCreateTargetQueries(new CreateTargetQueries(wizard)); processor.setReorgQueries(new ReorgQueries(wizard)); new RefactoringStarter().activate(wizard, shell, RefactoringMessages.OpenRefactoringWizardAction_refactoring, processor.getSaveMode()); } }
public void run(Shell parent) throws InterruptedException, InvocationTargetException { try { JavaMoveRefactoring ref= new JavaMoveRefactoring(fMoveProcessor); if (fMoveProcessor.hasAllInputSet()) { IRunnableContext context= new ProgressMonitorDialog(parent); fMoveProcessor.setCreateTargetQueries(new CreateTargetQueries(parent)); fMoveProcessor.setReorgQueries(new ReorgQueries(parent)); new RefactoringExecutionHelper(ref, RefactoringCore.getConditionCheckingFailedSeverity(), RefactoringSaveHelper.SAVE_ALL, parent, context).perform(false, false); } else { RefactoringWizard wizard= new ReorgMoveWizard(ref); /* * We want to get the shell from the refactoring dialog but it's not known at this point, * so we pass the wizard and then, once the dialog is open, we will have access to its shell. */ fMoveProcessor.setCreateTargetQueries(new CreateTargetQueries(wizard)); fMoveProcessor.setReorgQueries(new ReorgQueries(wizard)); new RefactoringStarter().activate(ref, wizard, parent, RefactoringMessages.OpenRefactoringWizardAction_refactoring, RefactoringSaveHelper.SAVE_ALL); } } catch (JavaModelException e) { ExceptionHandler.handle(e, RefactoringMessages.OpenRefactoringWizardAction_refactoring, RefactoringMessages.OpenRefactoringWizardAction_exception); } } }
public boolean run(Shell parent) throws InterruptedException, InvocationTargetException { Refactoring ref= new MoveRefactoring(fMoveProcessor); if (fMoveProcessor.hasAllInputSet()) { IRunnableContext context= PlatformUI.getWorkbench().getActiveWorkbenchWindow(); fMoveProcessor.setCreateTargetQueries(new CreateTargetQueries(parent)); fMoveProcessor.setReorgQueries(new ReorgQueries(parent)); new RefactoringExecutionHelper(ref, RefactoringCore.getConditionCheckingFailedSeverity(), fMoveProcessor.getSaveMode(), parent, context).perform(false, false); return true; } else { RefactoringWizard wizard= new ReorgMoveWizard(fMoveProcessor, ref); /* * We want to get the shell from the refactoring dialog but it's not known at this point, * so we pass the wizard and then, once the dialog is open, we will have access to its shell. */ fMoveProcessor.setCreateTargetQueries(new CreateTargetQueries(wizard)); fMoveProcessor.setReorgQueries(new ReorgQueries(wizard)); return new RefactoringStarter().activate(wizard, parent, RefactoringMessages.OpenRefactoringWizardAction_refactoring, fMoveProcessor.getSaveMode()); } } }
public boolean run(Shell parent) throws InterruptedException, InvocationTargetException { Refactoring ref= new MoveRefactoring(fMoveProcessor); if (fMoveProcessor.hasAllInputSet()) { IRunnableContext context= PlatformUI.getWorkbench().getActiveWorkbenchWindow(); fMoveProcessor.setCreateTargetQueries(new CreateTargetQueries(parent)); fMoveProcessor.setReorgQueries(new ReorgQueries(parent)); new RefactoringExecutionHelper(ref, RefactoringCore.getConditionCheckingFailedSeverity(), fMoveProcessor.getSaveMode(), parent, context).perform(false, false); return true; } else { RefactoringWizard wizard= new ReorgMoveWizard(fMoveProcessor, ref); /* * We want to get the shell from the refactoring dialog but it's not known at this point, * so we pass the wizard and then, once the dialog is open, we will have access to its shell. */ fMoveProcessor.setCreateTargetQueries(new CreateTargetQueries(wizard)); fMoveProcessor.setReorgQueries(new ReorgQueries(wizard)); return new RefactoringStarter().activate(wizard, parent, RefactoringMessages.OpenRefactoringWizardAction_refactoring, fMoveProcessor.getSaveMode()); } } }