Java Code Examples for com.intellij.openapi.editor.Document#removeDocumentListener()

The following examples show how to use com.intellij.openapi.editor.Document#removeDocumentListener() . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: consulo   File: ListenerDiffViewerBase.java    License: Apache License 2.0 5 votes vote down vote up
@Override
protected void onDispose() {
  if (myFileListener != null) VirtualFileManager.getInstance().removeVirtualFileListener(myFileListener);

  for (Document document : getDocuments()) {
    document.removeDocumentListener(myDocumentListener);
  }
  super.onDispose();
}
 
Example 2
private void unRegisterListeners(@Nonnull Editor editor) {
  editor.removeEditorMouseListener(myMouseListener);
  editor.removeEditorMouseMotionListener(myMouseListener);
  editor.getScrollingModel().removeVisibleAreaListener(myVisibleAreaListener);
  editor.getCaretModel().removeCaretListener(myCaretListener);

  Document document = editor.getDocument();
  if (myMonitoredDocuments.remove(document) != null) {
    document.removeDocumentListener(myDocumentListener);
  }
}
 
Example 3
Source Project: consulo   File: DiffRangeMarker.java    License: Apache License 2.0 4 votes vote down vote up
private void onClientRemoved(@Nonnull Document document, @Nonnull DiffRangeMarker marker, @Nonnull RangeInvalidListener listener) {
  if (myDiffRangeMarkers.remove(marker) == listener && myDiffRangeMarkers.isEmpty()) {
    document.putUserData(KEY, null);
    document.removeDocumentListener(this);
  }
}
 
Example 4
Source Project: consulo   File: RangeMarkerTree.java    License: Apache License 2.0 4 votes vote down vote up
void dispose(@Nonnull Document document) {
  document.removeDocumentListener(this);
}
 
Example 5
Source Project: CppTools   File: CppSupportLoader.java    License: Apache License 2.0 4 votes vote down vote up
private void removeDocumentListener(Document document) {
  if (isAcceptableDocument(document) && document.getUserData(ourListenerKey) != null) {
    document.removeDocumentListener(myDocumentListener);
    document.putUserData(ourListenerKey, null);
  }
}