use of com.intellij.openapi.editor.event.EditorMouseEvent 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);
}
use of com.intellij.openapi.editor.event.EditorMouseEvent in project intellij-community by JetBrains.
the class EditorActionUtil method showEditorPopup.
private static void showEditorPopup(final EditorMouseEvent event, @NotNull final ActionGroup group) {
if (!event.isConsumed() && event.getArea() == EditorMouseEventArea.EDITING_AREA) {
ActionPopupMenu popupMenu = ActionManager.getInstance().createActionPopupMenu(ActionPlaces.EDITOR_POPUP, group);
MouseEvent e = event.getMouseEvent();
final Component c = e.getComponent();
if (c != null && c.isShowing()) {
popupMenu.getComponent().show(c, e.getX(), e.getY());
}
e.consume();
}
}
use of com.intellij.openapi.editor.event.EditorMouseEvent in project intellij-community by JetBrains.
the class EditorActionUtil method createEditorPopupHandler.
public static EditorPopupHandler createEditorPopupHandler(@NotNull final String groupId) {
return new EditorPopupHandler() {
@Override
public void invokePopup(final EditorMouseEvent event) {
if (!event.isConsumed() && event.getArea() == EditorMouseEventArea.EDITING_AREA) {
ActionGroup group = (ActionGroup) CustomActionsSchema.getInstance().getCorrectedAction(groupId);
showEditorPopup(event, group);
}
}
};
}
Aggregations