public void disconnect() { IDocumentProvider provider = null; IEditorInput input = getDocumentKey(); synchronized(this) { if (fDocumentProvider != null) { provider = fDocumentProvider; fDocumentProvider = null; fDocumentKey = null; } } if (provider != null) { disconnect(provider, input); provider.removeElementStateListener(this); } // If we have a listener registered with the widget, remove it if (fSourceViewer != null) { StyledText textWidget = fSourceViewer.getSourceViewer().getTextWidget(); if (textWidget != null && !textWidget.isDisposed()) { if (fNeedsValidation) { textWidget.removeVerifyListener(this); fNeedsValidation = false; } IDocument oldDoc= internalGetDocument(fSourceViewer); if (oldDoc != null) { oldDoc.removeDocumentListener(this); } } } clearCachedDocument(); }
public void disconnect() { IDocumentProvider provider = null; IEditorInput input = getDocumentKey(); synchronized(this) { if (fDocumentProvider != null) { provider = fDocumentProvider; fDocumentProvider = null; fDocumentKey = null; } } if (provider != null) { disconnect(provider, input); provider.removeElementStateListener(this); } // If we have a listener registered with the widget, remove it if (fSourceViewer != null && !fSourceViewer.getTextWidget().isDisposed()) { if (fNeedsValidation) { fSourceViewer.getTextWidget().removeVerifyListener(this); fNeedsValidation = false; } IDocument oldDoc= internalGetDocument(fSourceViewer); if (oldDoc != null) { oldDoc.removeDocumentListener(this); } } clearCachedDocument(); }
private void unsetDocument(MergeSourceViewer tp) { IDocument oldDoc= internalGetDocument(tp); if (oldDoc != null) { tp.rememberDocument(null); try { oldDoc.removePositionCategory(DIFF_RANGE_CATEGORY); } catch (BadPositionCategoryException ex) { // Ignore } if (fPositionUpdater != null) oldDoc.removePositionUpdater(fPositionUpdater); oldDoc.removeDocumentListener(this); } }
private void unsetDocument(MergeSourceViewer tp) { IDocument oldDoc= internalGetDocument(tp); if (oldDoc != null) { tp.rememberDocument(null); try { oldDoc.removePositionCategory(DIFF_RANGE_CATEGORY); } catch (BadPositionCategoryException ex) { // Ignore } if (fPositionUpdater != null) oldDoc.removePositionUpdater(fPositionUpdater); oldDoc.removeDocumentListener(this); } }