Java 类com.intellij.util.EditorPopupHandler 实例源码

项目:tools-idea    文件:EditorActionUtil.java   
public static EditorPopupHandler createEditorPopupHandler(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);
        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();
      }
    }
  };
}
项目:tools-idea    文件:EventLogConsole.java   
private Editor createLogEditor() {
  Project project = myProjectModel.getProject();
  final Editor editor = ConsoleViewUtil.setupConsoleEditor(project, false, false);
  Disposer.register(myProjectModel, new Disposable() {
    @Override
    public void dispose() {
      EditorFactory.getInstance().releaseEditor(editor);
    }
  });

  ((EditorMarkupModel)editor.getMarkupModel()).setErrorStripeVisible(true);

  final ClearLog clearLog = new ClearLog();
  clearLog.registerCustomShortcutSet(ActionManager.getInstance().getAction(IdeActions.CONSOLE_CLEAR_ALL).getShortcutSet(), editor.getContentComponent());

  editor.addEditorMouseListener(new EditorPopupHandler() {
    public void invokePopup(final EditorMouseEvent event) {
      final ActionManager actionManager = ActionManager.getInstance();
      final ActionPopupMenu menu = actionManager.createActionPopupMenu(ActionPlaces.EDITOR_POPUP, createPopupActions(actionManager, clearLog));
      final MouseEvent mouseEvent = event.getMouseEvent();
      menu.getComponent().show(mouseEvent.getComponent(), mouseEvent.getX(), mouseEvent.getY());
    }
  });
  return editor;
}
项目:intellij-ce-playground    文件:TextDiffViewerUtil.java   
@Override
public void invokePopup(final EditorMouseEvent event) {
  if (myEditorPopupActions.isEmpty()) return;
  ActionGroup group = new DefaultActionGroup(myEditorPopupActions);
  EditorPopupHandler handler = EditorActionUtil.createEditorPopupHandler(group);
  handler.invokePopup(event);
}
项目:intellij-ce-playground    文件:EditorActionUtil.java   
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);
      }
    }
  };
}
项目:intellij-ce-playground    文件:EditorActionUtil.java   
public static EditorPopupHandler createEditorPopupHandler(@NotNull final ActionGroup group) {
  return new EditorPopupHandler() {
    @Override
    public void invokePopup(final EditorMouseEvent event) {
      showEditorPopup(event, group);
    }
  };
}
项目:consulo    文件:TextDiffViewerUtil.java   
@Override
public void invokePopup(final EditorMouseEvent event) {
  if (myEditorPopupActions.isEmpty()) return;
  ActionGroup group = new DefaultActionGroup(myEditorPopupActions);
  EditorPopupHandler handler = EditorActionUtil.createEditorPopupHandler(group);
  handler.invokePopup(event);
}
项目:consulo    文件:EditorActionUtil.java   
public static EditorPopupHandler createEditorPopupHandler(@Nonnull 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);
      }
    }
  };
}
项目:consulo    文件:EditorActionUtil.java   
public static EditorPopupHandler createEditorPopupHandler(@Nonnull final ActionGroup group) {
  return new EditorPopupHandler() {
    @Override
    public void invokePopup(final EditorMouseEvent event) {
      showEditorPopup(event, group);
    }
  };
}