@Override public void setMaximalUndoLevel(int undoLimit) { fHistory.setLimit(fUndoContext, undoLimit); }
@Override public void setMaximalUndoLevel(int undoLimit) { fHistory.setLimit(fUndoContext, undoLimit); }
@Override public void setMaximalUndoLevel(int undoLevel) { fUndoLevel= Math.max(0, undoLevel); if (isConnected()) { fHistory.setLimit(fUndoContext, fUndoLevel); } }
@Override public void setMaximalUndoLevel(int undoLevel) { fUndoLevel= Math.max(0, undoLevel); if (isConnected()) { fHistory.setLimit(fUndoContext, fUndoLevel); } }
public static IUndoContext getUndoContext() { if (fRefactoringUndoContext == null) { fRefactoringUndoContext= new RefactoringUndoContext(); IUndoContext workspaceContext= ResourcesPlugin.getWorkspace().getAdapter(IUndoContext.class); if (workspaceContext instanceof ObjectUndoContext) { ((ObjectUndoContext)workspaceContext).addMatch(fRefactoringUndoContext); } IOperationHistory operationHistory= OperationHistoryFactory.getOperationHistory(); operationHistory.setLimit(fRefactoringUndoContext, 5); } return fRefactoringUndoContext; }
public static IUndoContext getUndoContext() { if (fRefactoringUndoContext == null) { fRefactoringUndoContext= new RefactoringUndoContext(); IUndoContext workspaceContext= (IUndoContext)ResourcesPlugin.getWorkspace().getAdapter(IUndoContext.class); if (workspaceContext instanceof ObjectUndoContext) { ((ObjectUndoContext)workspaceContext).addMatch(fRefactoringUndoContext); } IOperationHistory operationHistory= OperationHistoryFactory.getOperationHistory(); operationHistory.setLimit(fRefactoringUndoContext, 5); } return fRefactoringUndoContext; }
public static IUndoContext getUndoContext() { if (fRefactoringUndoContext == null) { fRefactoringUndoContext= new RefactoringUndoContext(); IUndoContext workspaceContext= ResourcesPlugin.getWorkspace().getAdapter(IUndoContext.class); if (workspaceContext instanceof ObjectUndoContext) { ((ObjectUndoContext)workspaceContext).addMatch(fRefactoringUndoContext); } IOperationHistory operationHistory= OperationHistoryFactory.getOperationHistory(); operationHistory.setLimit(fRefactoringUndoContext, 5); } return fRefactoringUndoContext; }
@Override public void connect(ITextViewer textViewer) { if (!isConnected() && textViewer != null) { fTextViewer= textViewer; fTextBuffer= new StringBuffer(); fPreservedTextBuffer= new StringBuffer(); if (fUndoContext == null) fUndoContext= new ObjectUndoContext(this); fHistory.setLimit(fUndoContext, fUndoLevel); initializeCommandStack(); // open up the current command fCurrent= new TextCommand(fUndoContext); fPreviousDelete= new TextCommand(fUndoContext); addListeners(); } }
@Override public void connect(ITextViewer textViewer) { if (!isConnected() && textViewer != null) { fTextViewer= textViewer; fTextBuffer= new StringBuilder(); fPreservedTextBuffer= new StringBuilder(); if (fUndoContext == null) fUndoContext= new ObjectUndoContext(this); fHistory.setLimit(fUndoContext, fUndoLevel); initializeCommandStack(); // open up the current command fCurrent= new TextCommand(fUndoContext); fPreviousDelete= new TextCommand(fUndoContext); addListeners(); } }
/** * Returns the workbench operation history. * * @return the operation history for workbench operations. * @since 3.1 */ @Override public IOperationHistory getOperationHistory() { IOperationHistory history = OperationHistoryFactory.getOperationHistory(); /* * Set up the history if we have not done so before. */ if (approver == null) { /* * install an operation approver that prevents linear undo violations * in any context */ approver = new AdvancedValidationUserApprover(getUndoContext()); history.addOperationApprover(approver); /* * set a limit for the workbench undo context */ history.setLimit(getUndoContext(), 25); } return history; }