boolean successful= false; try { manager.aboutToPerformChange(change); undoChange= change.perform(new NullProgressMonitor()); successful= true; } finally { manager.changePerformed(change, successful); manager.addUndo(getName(), undoChange);
if (fUndoManager != null) { ResourcesPlugin.getWorkspace().checkpoint(false); fUndoManager.aboutToPerformChange(fChange); aboutToPerformChangeCalled= true; ResourcesPlugin.getWorkspace().checkpoint(false); if (aboutToPerformChangeCalled) fUndoManager.changePerformed(fChange, !fChangeExecutionFailed); fUndoManager.addUndo(fUndoName, fUndoChange); } else { fUndoManager.flush(); fUndoManager.flush(); if (fUndoChange != null && undoInitialized) { Change ch= fUndoChange; } catch (RuntimeException e) { if (fUndoManager != null) fUndoManager.flush(); if (fUndoChange != null && undoInitialized) { Change ch= fUndoChange;
public void stop(BundleContext context) throws Exception { if (fRefactoringUndoContext != null) { IUndoContext workspaceContext= (IUndoContext)ResourcesPlugin.getWorkspace().getAdapter(IUndoContext.class); if (workspaceContext instanceof ObjectUndoContext) { ((ObjectUndoContext)workspaceContext).removeMatch(fRefactoringUndoContext); } } if (fgUndoManager != null) fgUndoManager.shutdown(); final RefactoringHistoryService service= RefactoringHistoryService.getInstance(); service.disconnect(); if (fRefactoringHistoryListener != null) service.removeHistoryListener(fRefactoringHistoryListener); RefactoringContributionManager.getInstance().disconnect(); super.stop(context); }
public void run(IAction action) { Shell parent= fWorkbenchWindow.getShell(); IRunnableWithProgress op= createOperation(parent); try { PlatformUI.getWorkbench().getProgressService().runInUI( new ProgressMonitorDialog(fWorkbenchWindow.getShell()), op, ResourcesPlugin.getWorkspace().getRoot()); } catch (InvocationTargetException e) { RefactoringCore.getUndoManager().flush(); ExceptionHandler.handle(e, PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), RefactoringUIMessages.UndoManagerAction_internal_error_title, RefactoringUIMessages.UndoManagerAction_internal_error_message); } catch (InterruptedException e) { // Operation isn't cancelable. } catch (OperationCanceledException e) { // the waiting dialog got canceled. } } }
final boolean valid= history != null && !history.isEmpty(); if (valid) RefactoringCore.getUndoManager().flush(); if (valid || changed) fJavaProject.setRawClasspath(entries, changed, new SubProgressMonitor(monitor, 60, SubProgressMonitor.SUPPRESS_SUBTASK_LABEL));
boolean successful= false; try { manager.aboutToPerformChange(change); undoChange= change.perform(new NullProgressMonitor()); successful= true; } finally { manager.changePerformed(change, successful); manager.addUndo(getName(), undoChange);
if (fUndoManager != null) { ResourcesPlugin.getWorkspace().checkpoint(false); fUndoManager.aboutToPerformChange(fChange); aboutToPerformChangeCalled= true; ResourcesPlugin.getWorkspace().checkpoint(false); if (aboutToPerformChangeCalled) fUndoManager.changePerformed(fChange, !fChangeExecutionFailed); fUndoManager.addUndo(fUndoName, fUndoChange); } else { fUndoManager.flush(); fUndoManager.flush(); if (fUndoChange != null && undoInitialized) { Change ch= fUndoChange; } catch (RuntimeException e) { if (fUndoManager != null) fUndoManager.flush(); if (fUndoChange != null && undoInitialized) { Change ch= fUndoChange;
final boolean valid= history != null && !history.isEmpty(); if (valid) RefactoringCore.getUndoManager().flush(); if (valid || changed) fJavaProject.setRawClasspath(entries, changed, new SubProgressMonitor(monitor, 60, SubProgressMonitor.SUPPRESS_SUBTASK_LABEL));
@Override public void stop(BundleContext context) throws Exception { if (fRefactoringUndoContext != null) { IUndoContext workspaceContext= ResourcesPlugin.getWorkspace().getAdapter(IUndoContext.class); if (workspaceContext instanceof ObjectUndoContext) { ((ObjectUndoContext)workspaceContext).removeMatch(fRefactoringUndoContext); } } if (fgUndoManager != null) fgUndoManager.shutdown(); final RefactoringHistoryService service= RefactoringHistoryService.getInstance(); service.disconnect(); if (fRefactoringHistoryListener != null) service.removeHistoryListener(fRefactoringHistoryListener); RefactoringContributionManager.getInstance().disconnect(); super.stop(context); }
} else { IUndoManager manager= RefactoringCore.getUndoManager(); manager.aboutToPerformChange(change); Change undoChange= change.perform(new NullProgressMonitor()); manager.changePerformed(change, true); if (undoChange != null) { undoChange.initializeValidationData(new NullProgressMonitor()); manager.addUndo(getName(), undoChange);
if (fUndoManager != null) { ResourcesPlugin.getWorkspace().checkpoint(false); fUndoManager.aboutToPerformChange(fChange); aboutToPerformChangeCalled= true; ResourcesPlugin.getWorkspace().checkpoint(false); if (aboutToPerformChangeCalled) fUndoManager.changePerformed(fChange, !fChangeExecutionFailed); fUndoManager.addUndo(fUndoName, fUndoChange); } else { fUndoManager.flush(); fUndoManager.flush(); if (fUndoChange != null && undoInitialized) { Change ch= fUndoChange; } catch (RuntimeException e) { if (fUndoManager != null) fUndoManager.flush(); if (fUndoChange != null && undoInitialized) { Change ch= fUndoChange;
final boolean valid= history != null && !history.isEmpty(); if (valid) RefactoringCore.getUndoManager().flush(); if (valid || changed) fJavaProject.setRawClasspath(entries, changed, new SubProgressMonitor(monitor, 60, SubProgressMonitor.SUPPRESS_SUBTASK_LABEL));
@Override public void stop(BundleContext context) throws Exception { if (fRefactoringUndoContext != null) { IUndoContext workspaceContext= ResourcesPlugin.getWorkspace().getAdapter(IUndoContext.class); if (workspaceContext instanceof ObjectUndoContext) { ((ObjectUndoContext)workspaceContext).removeMatch(fRefactoringUndoContext); } } if (fgUndoManager != null) fgUndoManager.shutdown(); final RefactoringHistoryService service= RefactoringHistoryService.getInstance(); service.disconnect(); if (fRefactoringHistoryListener != null) service.removeHistoryListener(fRefactoringHistoryListener); RefactoringContributionManager.getInstance().disconnect(); super.stop(context); }
boolean successful = false; try { manager.aboutToPerformChange(documentChange); undoChange = documentChange.perform(new NullProgressMonitor()); successful = true; } finally { manager.changePerformed(documentChange, successful); manager.addUndo("Undo formatting", undoChange);
manager.aboutToPerformChange(result); } while (cleanUps.length > 0); } finally { manager.changePerformed(result, true); CleanUpSaveUndo undo= new CleanUpSaveUndo(result.getName(), (IFile)unit.getResource(), undoEditArray, oldDocValue, oldFileValue); undo.initializeValidationData(new NullProgressMonitor()); manager.addUndo(result.getName(), undo);
boolean successful= false; try { manager.aboutToPerformChange(change); undoChange= change.perform(new NullProgressMonitor()); successful= true; } finally { manager.changePerformed(change, successful); manager.addUndo(getName(), undoChange);
manager.aboutToPerformChange(result); success= true; } finally { manager.changePerformed(result, success); CleanUpSaveUndo undo= new CleanUpSaveUndo(result.getName(), (IFile)unit.getResource(), undoEditArray, oldDocValue, oldFileValue); undo.initializeValidationData(new NullProgressMonitor()); manager.addUndo(result.getName(), undo);
boolean successful= false; try { manager.aboutToPerformChange(change); undoChange= change.perform(new NullProgressMonitor()); successful= true; } finally { manager.changePerformed(change, successful); manager.addUndo(getName(), undoChange);
manager.aboutToPerformChange(result); success= true; } finally { manager.changePerformed(result, success); CleanUpSaveUndo undo= new CleanUpSaveUndo(result.getName(), (IFile)unit.getResource(), undoEditArray, oldDocValue, oldFileValue); undo.initializeValidationData(new NullProgressMonitor()); manager.addUndo(result.getName(), undo);