private void handleDropMove(Object target) throws ConnectionProfileException, CoreException { // handle move cp to Local Repository if (target instanceof LocalRepositoryNode) { PerformRefactoringOperation refOperation = new PerformRefactoringOperation( new MoveRefactoring(new ConnectionProfileMoveProcessor( (IConnectionProfile[]) mElements .toArray(new IConnectionProfile[mElements .size()]), ProfileManager .getInstance())), CheckConditionsOperation.ALL_CONDITIONS); ResourcesPlugin.getWorkspace().run(refOperation, null); } // handle move cp to specific repository else if (target instanceof IConnectionProfile) { PerformRefactoringOperation refOperation = new PerformRefactoringOperation( new MoveRefactoring(new ConnectionProfileMoveProcessor( (IConnectionProfile[]) mElements .toArray(new IConnectionProfile[mElements .size()]), target)), CheckConditionsOperation.ALL_CONDITIONS); ResourcesPlugin.getWorkspace().run(refOperation, null); } }
final PerformRefactoringOperation operation= new PerformRefactoringOperation(refactoring, CheckConditionsOperation.ALL_CONDITIONS); try { status.merge(aboutToPerformRefactoring(refactoring, descriptor, new SubProgressMonitor(monitor, 50, SubProgressMonitor.SUPPRESS_SUBTASK_LABEL))); if (!status.hasFatalError()) { ResourcesPlugin.getWorkspace().run(operation, new SubProgressMonitor(monitor, 90, SubProgressMonitor.SUPPRESS_SUBTASK_LABEL)); status.merge(operation.getConditionStatus()); if (!status.hasFatalError()) status.merge(operation.getValidationStatus());
final PerformRefactoringOperation op = new PerformRefactoringOperation(refactoring, CheckConditionsOperation.ALL_CONDITIONS); final IWorkspaceRunnable r = monitor -> op.run(monitor);
final PerformRefactoringOperation operation= new PerformRefactoringOperation(refactoring, CheckConditionsOperation.ALL_CONDITIONS); try { status.merge(aboutToPerformRefactoring(refactoring, descriptor, new SubProgressMonitor(monitor, 30, SubProgressMonitor.SUPPRESS_SUBTASK_LABEL))); if (!status.hasFatalError()) { ResourcesPlugin.getWorkspace().run(operation, new SubProgressMonitor(monitor, 90, SubProgressMonitor.SUPPRESS_SUBTASK_LABEL)); status.merge(operation.getConditionStatus()); if (!status.hasFatalError()) status.merge(operation.getValidationStatus());
final PerformRefactoringOperation operation= new PerformRefactoringOperation(refactoring, CheckConditionsOperation.ALL_CONDITIONS); try { status.merge(aboutToPerformRefactoring(refactoring, descriptor, new SubProgressMonitor(monitor, 30, SubProgressMonitor.SUPPRESS_SUBTASK_LABEL))); if (!status.hasFatalError()) { ResourcesPlugin.getWorkspace().run(operation, new SubProgressMonitor(monitor, 90, SubProgressMonitor.SUPPRESS_SUBTASK_LABEL)); status.merge(operation.getConditionStatus()); if (!status.hasFatalError()) status.merge(operation.getValidationStatus());
private void handleDropCopy(Object target) throws ConnectionProfileException, CoreException { // handle copy cp to Local Repository if (target instanceof LocalRepositoryNode) { PerformRefactoringOperation refOperation = new PerformRefactoringOperation( new CopyRefactoring(new ConnectionProfileCopyProcessor( (IConnectionProfile[]) mElements .toArray(new IConnectionProfile[mElements .size()]), ProfileManager .getInstance())), CheckConditionsOperation.ALL_CONDITIONS); ResourcesPlugin.getWorkspace().run(refOperation, null); } // handle copy cp to specific repository else if (target instanceof IConnectionProfile) { PerformRefactoringOperation refOperation = new PerformRefactoringOperation( new CopyRefactoring(new ConnectionProfileCopyProcessor( (IConnectionProfile[]) mElements .toArray(new IConnectionProfile[mElements .size()]), target)), CheckConditionsOperation.ALL_CONDITIONS); ResourcesPlugin.getWorkspace().run(refOperation, null); } }
private void refactor (IConnectionProfile profile) throws CoreException { // Refactor for rename PerformRefactoringOperation refOperation = new PerformRefactoringOperation( new DeleteRefactoring(new ConnectionProfileDeleteProcessor(profile)), CheckConditionsOperation.ALL_CONDITIONS); try { ResourcesPlugin.getWorkspace().run(refOperation, null); } catch (OperationCanceledException oce) { throw new OperationCanceledException(); } catch (CoreException ce) { throw ce; } } }
private void refactor (IConnectionProfile profile, String newName) throws CoreException { // Refactor for rename PerformRefactoringOperation refOperation = new PerformRefactoringOperation( new RenameRefactoring(new ConnectionProfileRenameProcessor(profile, newName)), CheckConditionsOperation.ALL_CONDITIONS); try { ResourcesPlugin.getWorkspace().run(refOperation, null); } catch (OperationCanceledException oce) { throw new OperationCanceledException(); } catch (CoreException ce) { throw ce; } }
private void refactor (IConnectionProfile profile) throws CoreException { // Refactor for rename Object o = null; if (profile.getParentProfile() == null) { o = ProfileManager.getInstance(); } else { o = profile.getParentProfile(); } PerformRefactoringOperation refOperation = new PerformRefactoringOperation( new CopyRefactoring(new ConnectionProfileCopyProcessor( new IConnectionProfile[] { profile}, o)), CheckConditionsOperation.ALL_CONDITIONS); try { ResourcesPlugin.getWorkspace().run(refOperation, null); } catch (OperationCanceledException oce) { throw new OperationCanceledException(); } catch (CoreException ce) { throw ce; } }