Search in sources :

Example 1 with EditorMouseMotionListener

use of com.intellij.openapi.editor.event.EditorMouseMotionListener in project intellij-community by JetBrains.

the class EditorWindowImpl method addEditorMouseMotionListener.

@Override
public void addEditorMouseMotionListener(@NotNull final EditorMouseMotionListener listener) {
    checkValid();
    EditorMouseMotionListener wrapper = new EditorMouseMotionListener() {

        @Override
        public void mouseMoved(EditorMouseEvent e) {
            listener.mouseMoved(new EditorMouseEvent(EditorWindowImpl.this, e.getMouseEvent(), e.getArea()));
        }

        @Override
        public void mouseDragged(EditorMouseEvent e) {
            listener.mouseDragged(new EditorMouseEvent(EditorWindowImpl.this, e.getMouseEvent(), e.getArea()));
        }
    };
    myEditorMouseMotionListeners.registerWrapper(listener, wrapper);
    myDelegate.addEditorMouseMotionListener(wrapper);
}
Also used : EditorMouseEvent(com.intellij.openapi.editor.event.EditorMouseEvent) EditorMouseMotionListener(com.intellij.openapi.editor.event.EditorMouseMotionListener)

Example 2 with EditorMouseMotionListener

use of com.intellij.openapi.editor.event.EditorMouseMotionListener in project intellij-community by JetBrains.

the class EditorWindowImpl method dispose.

private void dispose() {
    assert !myDisposed;
    myCaretModelDelegate.disposeModel();
    for (EditorMouseListener wrapper : myEditorMouseListeners.wrappers()) {
        myDelegate.removeEditorMouseListener(wrapper);
    }
    myEditorMouseListeners.clear();
    for (EditorMouseMotionListener wrapper : myEditorMouseMotionListeners.wrappers()) {
        myDelegate.removeEditorMouseMotionListener(wrapper);
    }
    myEditorMouseMotionListeners.clear();
    myDisposed = true;
    Disposer.dispose(myDocumentWindow);
}
Also used : EditorMouseListener(com.intellij.openapi.editor.event.EditorMouseListener) EditorMouseMotionListener(com.intellij.openapi.editor.event.EditorMouseMotionListener)

Aggregations

EditorMouseMotionListener (com.intellij.openapi.editor.event.EditorMouseMotionListener)2 EditorMouseEvent (com.intellij.openapi.editor.event.EditorMouseEvent)1 EditorMouseListener (com.intellij.openapi.editor.event.EditorMouseListener)1