mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-123075 "Suspend breakpoint" (Alt+Button1) conflicts with keymap-defined Alt+Button1
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2013 JetBrains s.r.o.
|
||||
* 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.
|
||||
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
package com.intellij.openapi.editor;
|
||||
|
||||
import com.intellij.openapi.actionSystem.DataKey;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
@@ -26,6 +27,8 @@ import org.jetbrains.annotations.NotNull;
|
||||
* @see Editor#getGutter()
|
||||
*/
|
||||
public interface EditorGutter {
|
||||
DataKey<EditorGutter> KEY = DataKey.create("EditorGutter");
|
||||
|
||||
/**
|
||||
* Adds a provider for drawing custom text annotations in the editor gutter.
|
||||
*
|
||||
|
||||
+6
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2009 JetBrains s.r.o.
|
||||
* 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.
|
||||
@@ -26,6 +26,7 @@ import com.intellij.featureStatistics.FeatureUsageTracker;
|
||||
import com.intellij.openapi.actionSystem.*;
|
||||
import com.intellij.openapi.command.CommandProcessor;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.editor.EditorGutter;
|
||||
import com.intellij.openapi.project.DumbAware;
|
||||
import com.intellij.openapi.project.IndexNotReadyException;
|
||||
import com.intellij.openapi.project.Project;
|
||||
@@ -92,6 +93,10 @@ public class ShowQuickDocInfoAction extends BaseCodeInsightAction implements Hin
|
||||
}
|
||||
else {
|
||||
if (editor != null) {
|
||||
if (EditorGutter.KEY.getData(event.getDataContext()) != null) {
|
||||
presentation.setEnabled(false);
|
||||
return;
|
||||
}
|
||||
PsiFile file = PsiDocumentManager.getInstance(project).getPsiFile(editor.getDocument());
|
||||
if (file == null) {
|
||||
presentation.setEnabled(false);
|
||||
|
||||
+8
-1
@@ -62,6 +62,7 @@ import gnu.trove.TIntArrayList;
|
||||
import gnu.trove.TIntFunction;
|
||||
import gnu.trove.TIntObjectHashMap;
|
||||
import gnu.trove.TObjectProcedure;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@@ -73,7 +74,7 @@ import java.awt.geom.AffineTransform;
|
||||
import java.util.*;
|
||||
import java.util.List;
|
||||
|
||||
class EditorGutterComponentImpl extends EditorGutterComponentEx implements MouseListener, MouseMotionListener {
|
||||
class EditorGutterComponentImpl extends EditorGutterComponentEx implements MouseListener, MouseMotionListener, DataProvider {
|
||||
private static final Logger LOG = Logger.getInstance("#com.intellij.openapi.editor.impl.EditorGutterComponentImpl");
|
||||
private static final int START_ICON_AREA_WIDTH = 15;
|
||||
private static final int FREE_PAINTERS_AREA_WIDTH = 5;
|
||||
@@ -480,6 +481,12 @@ class EditorGutterComponentImpl extends EditorGutterComponentEx implements Mouse
|
||||
return Math.max(0, myEditor.getDocument().getLineCount() - 1);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public Object getData(@NonNls String dataId) {
|
||||
return EditorGutter.KEY.is(dataId) ? this : null;
|
||||
}
|
||||
|
||||
private interface RangeHighlighterProcessor {
|
||||
void process(@NotNull RangeHighlighter highlighter);
|
||||
}
|
||||
|
||||
+4
-18
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2012 JetBrains s.r.o.
|
||||
* 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.
|
||||
@@ -18,8 +18,8 @@ package com.intellij.xdebugger.impl.actions;
|
||||
import com.intellij.openapi.actionSystem.AnActionEvent;
|
||||
import com.intellij.openapi.actionSystem.CommonDataKeys;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.editor.EditorGutter;
|
||||
import com.intellij.openapi.editor.LogicalPosition;
|
||||
import com.intellij.openapi.editor.event.EditorMouseEventArea;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.xdebugger.impl.DebuggerSupport;
|
||||
import com.intellij.xdebugger.impl.evaluate.quick.common.QuickEvaluateHandler;
|
||||
@@ -27,11 +27,6 @@ import com.intellij.xdebugger.impl.evaluate.quick.common.ValueHintType;
|
||||
import com.intellij.xdebugger.impl.evaluate.quick.common.ValueLookupManager;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.awt.event.InputEvent;
|
||||
import java.awt.event.MouseEvent;
|
||||
|
||||
/**
|
||||
* @author nik
|
||||
*/
|
||||
@@ -74,17 +69,8 @@ public class QuickEvaluateAction extends XDebuggerActionBase {
|
||||
return false;
|
||||
}
|
||||
|
||||
InputEvent inputEvent = event.getInputEvent();
|
||||
if (inputEvent instanceof MouseEvent && inputEvent.isAltDown()) {
|
||||
MouseEvent mouseEvent = (MouseEvent)inputEvent;
|
||||
Component component = SwingUtilities.getDeepestComponentAt(mouseEvent.getComponent(), mouseEvent.getX(), mouseEvent.getY());
|
||||
if (SwingUtilities.isDescendingFrom(component, editor.getComponent())) {
|
||||
MouseEvent convertedEvent = SwingUtilities.convertMouseEvent(mouseEvent.getComponent(), mouseEvent, component);
|
||||
EditorMouseEventArea area = editor.getMouseEventArea(convertedEvent);
|
||||
if (area != EditorMouseEventArea.EDITING_AREA) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (EditorGutter.KEY.getData(event.getDataContext()) != null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user