Search in sources :

Example 1 with EditorMouseListener

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

the class EditorWindowImpl method addEditorMouseListener.

@Override
public void addEditorMouseListener(@NotNull final EditorMouseListener listener) {
    checkValid();
    EditorMouseListener wrapper = new EditorMouseListener() {

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

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

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

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

        @Override
        public void mouseExited(EditorMouseEvent e) {
            listener.mouseExited(new EditorMouseEvent(EditorWindowImpl.this, e.getMouseEvent(), e.getArea()));
        }
    };
    myEditorMouseListeners.registerWrapper(listener, wrapper);
    myDelegate.addEditorMouseListener(wrapper);
}
Also used : EditorMouseListener(com.intellij.openapi.editor.event.EditorMouseListener) EditorMouseEvent(com.intellij.openapi.editor.event.EditorMouseEvent)

Example 2 with EditorMouseListener

use of com.intellij.openapi.editor.event.EditorMouseListener 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

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