void (final MouseEvent e) { myMousePressedEvent = e; EditorMouseEvent event = new EditorMouseEvent(this, e, getMouseEventArea(e)); EditorMouseListener[] mouseListeners = myMouseListeners.toArray(new EditorMouseListener[myMouseListeners.size()]); for (int i = 0; i < mouseListeners.length; i++) { mouseListeners[i].mousePressed(event); } // On some systems (for example on Linux) popup trigger is MOUSE_PRESSED event. // But this trigger is always consumed by popup handler. In that case we have to // also move caret. if (event.isConsumed() && !(event.getMouseEvent().isPopupTrigger() || event.getArea() == EditorMouseEventArea.EDITING_AREA)) { return; } if (myCommandProcessor != null) { Runnable runnable = new Runnable() { public void run() { processMousePressed(e); } }; myCommandProcessor.executeCommand(myProject, runnable, "", null); } else { processMousePressed(e); } }