mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
always prefer getRightButtonClickAction to allow extra breakpoint actions in getPopupMenuActions for IDEA-125463
This commit is contained in:
+8
-15
@@ -1,18 +1,4 @@
|
||||
/*
|
||||
* Copyright 2000-2015 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.openapi.editor.markup;
|
||||
|
||||
import com.intellij.codeInsight.daemon.GutterMark;
|
||||
@@ -42,6 +28,7 @@ public abstract class GutterIconRenderer implements GutterMark, PossiblyDumbAwar
|
||||
* displayed when the icon is right-clicked.
|
||||
*
|
||||
* @return the group of actions for the context menu, or null if no context menu is required.
|
||||
* @see #getRightButtonClickAction()
|
||||
*/
|
||||
@Nullable
|
||||
public ActionGroup getPopupMenuActions() {
|
||||
@@ -79,6 +66,12 @@ public abstract class GutterIconRenderer implements GutterMark, PossiblyDumbAwar
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the action executed when the icon is right-clicked.
|
||||
*
|
||||
* @return the action instance, or null to show the popup menu
|
||||
* @see #getPopupMenuActions()
|
||||
*/
|
||||
@Nullable
|
||||
public AnAction getRightButtonClickAction() {
|
||||
return null;
|
||||
|
||||
+11
-13
@@ -1863,22 +1863,20 @@ class EditorGutterComponentImpl extends EditorGutterComponentEx implements Mouse
|
||||
else {
|
||||
GutterIconRenderer renderer = getGutterRenderer(e);
|
||||
if (renderer != null) {
|
||||
ActionGroup actionGroup = renderer.getPopupMenuActions();
|
||||
if (actionGroup != null) {
|
||||
if (checkDumbAware(actionGroup)) {
|
||||
ActionPopupMenu popupMenu = actionManager.createActionPopupMenu(ActionPlaces.UNKNOWN,
|
||||
actionGroup);
|
||||
popupMenu.getComponent().show(this, e.getX(), e.getY());
|
||||
}
|
||||
else {
|
||||
notifyNotDumbAware();
|
||||
}
|
||||
AnAction rightButtonAction = renderer.getRightButtonClickAction();
|
||||
if (rightButtonAction != null) {
|
||||
performAction(rightButtonAction, e, "ICON_NAVIGATION_SECONDARY_BUTTON", myEditor.getDataContext());
|
||||
e.consume();
|
||||
}
|
||||
else {
|
||||
AnAction rightButtonAction = renderer.getRightButtonClickAction();
|
||||
if (rightButtonAction != null) {
|
||||
performAction(rightButtonAction, e, "ICON_NAVIGATION_SECONDARY_BUTTON", myEditor.getDataContext());
|
||||
ActionGroup actionGroup = renderer.getPopupMenuActions();
|
||||
if (actionGroup != null) {
|
||||
if (checkDumbAware(actionGroup)) {
|
||||
actionManager.createActionPopupMenu(ActionPlaces.UNKNOWN, actionGroup).getComponent().show(this, e.getX(), e.getY());
|
||||
}
|
||||
else {
|
||||
notifyNotDumbAware();
|
||||
}
|
||||
e.consume();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user