/** * The <code>AbstractTextEditor</code> implementation of this <code>IWorkbenchPart</code> method * may be extended by subclasses. Subclasses must call <code>super.dispose()</code>. * * <p>Note that many methods may return <code>null</code> after the editor is disposed. */ @Override public void dispose() { if (fTitleImage != null) { fTitleImage.dispose(); fTitleImage = null; } disposeDocumentProvider(); if (fSourceViewer != null) { fSourceViewer = null; } if (fConfiguration != null) fConfiguration = null; IOperationHistory history = OperationHistoryFactory.getOperationHistory(); if (history != null) { if (fNonLocalOperationApprover != null) history.removeOperationApprover(fNonLocalOperationApprover); if (fLinearUndoViolationApprover != null) history.removeOperationApprover(fLinearUndoViolationApprover); } fNonLocalOperationApprover = null; fLinearUndoViolationApprover = null; super.dispose(); }
@Override public void dispose() { OperationHistoryFactory.getOperationHistory().removeOperationHistoryListener(historyListener); sessionManager.removeSarosSessionListener(sessionListener); editorManager.removeActivityListener(activityListener); enabled = false; eclipseHistory.removeOperationApprover(operationBlocker); editorManager.removeSharedEditorListener(sharedEditorListener); }
@Override public void sessionEnded(ISarosSession oldSarosSession) { oldSarosSession.removeActivityProvider(UndoManager.this); undoHistory.clear(); enabled = false; eclipseHistory.removeOperationApprover(operationBlocker); UndoManager.this.sarosSession = null; currentLocalCompositeOperation = null; currentLocalAtomicOperation = null; }