Search in sources :

Example 6 with EditorMouseEvent

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);
}
Also used : EditorMouseEvent(com.intellij.openapi.editor.event.EditorMouseEvent) EditorMouseMotionListener(com.intellij.openapi.editor.event.EditorMouseMotionListener)

Example 7 with EditorMouseEvent

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();
    }
}
Also used : MouseEvent(java.awt.event.MouseEvent) EditorMouseEvent(com.intellij.openapi.editor.event.EditorMouseEvent) ActionPopupMenu(com.intellij.openapi.actionSystem.ActionPopupMenu)

Example 8 with EditorMouseEvent

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);
            }
        }
    };
}
Also used : EditorMouseEvent(com.intellij.openapi.editor.event.EditorMouseEvent) ActionGroup(com.intellij.openapi.actionSystem.ActionGroup) EditorPopupHandler(com.intellij.util.EditorPopupHandler)

Aggregations

EditorMouseEvent (com.intellij.openapi.editor.event.EditorMouseEvent)8 EditorPopupHandler (com.intellij.util.EditorPopupHandler)3 MouseEvent (java.awt.event.MouseEvent)3 HintManager (com.intellij.codeInsight.hint.HintManager)1 IProperty (com.intellij.lang.properties.IProperty)1 PropertiesFile (com.intellij.lang.properties.psi.PropertiesFile)1 XmlPropertiesFile (com.intellij.lang.properties.xml.XmlPropertiesFile)1 ActionGroup (com.intellij.openapi.actionSystem.ActionGroup)1 ActionPopupMenu (com.intellij.openapi.actionSystem.ActionPopupMenu)1 EditorColorsScheme (com.intellij.openapi.editor.colors.EditorColorsScheme)1 EditorMouseListener (com.intellij.openapi.editor.event.EditorMouseListener)1 EditorMouseMotionAdapter (com.intellij.openapi.editor.event.EditorMouseMotionAdapter)1 EditorMouseMotionListener (com.intellij.openapi.editor.event.EditorMouseMotionListener)1 EditorEx (com.intellij.openapi.editor.ex.EditorEx)1 LexerEditorHighlighter (com.intellij.openapi.editor.ex.util.LexerEditorHighlighter)1 Project (com.intellij.openapi.project.Project)1 ProjectManagerAdapter (com.intellij.openapi.project.ProjectManagerAdapter)1 LightweightHint (com.intellij.ui.LightweightHint)1 RelativePoint (com.intellij.ui.awt.RelativePoint)1 IncorrectOperationException (com.intellij.util.IncorrectOperationException)1