mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
tooltips: remove explicit actionid / use custom shortcut
This commit is contained in:
+7
-3
@@ -30,14 +30,18 @@ import com.intellij.util.ui.Html
|
||||
import com.intellij.util.ui.JBUI
|
||||
import com.intellij.util.ui.UIUtil
|
||||
import java.awt.*
|
||||
import java.awt.event.KeyEvent
|
||||
import java.awt.event.MouseEvent
|
||||
import java.util.*
|
||||
import javax.swing.JComponent
|
||||
import javax.swing.JPanel
|
||||
import javax.swing.KeyStroke
|
||||
import javax.swing.MenuSelectionManager
|
||||
import javax.swing.event.HyperlinkEvent
|
||||
|
||||
|
||||
val runActionCustomShortcutSet = CustomShortcutSet(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, KeyEvent.SHIFT_DOWN_MASK or KeyEvent.ALT_DOWN_MASK ))
|
||||
|
||||
internal class DaemonTooltipWithActionRenderer(text: String?,
|
||||
private val tooltipAction: TooltipAction?,
|
||||
width: Int,
|
||||
@@ -90,7 +94,7 @@ internal class DaemonTooltipWithActionRenderer(text: String?,
|
||||
actions: ArrayList<AnAction>,
|
||||
tooltipReloader: TooltipReloader) {
|
||||
super.fillPanel(editor, grid, hint, hintHint, actions, tooltipReloader)
|
||||
if (grid !is JPanel || tooltipAction == null && !LineTooltipRenderer.isActiveHtml(myText!!)) return
|
||||
if (tooltipAction == null && !LineTooltipRenderer.isActiveHtml(myText!!)) return
|
||||
|
||||
val settingsComponent = createSettingsComponent(hint, hintHint, tooltipReloader)
|
||||
|
||||
@@ -118,7 +122,7 @@ internal class DaemonTooltipWithActionRenderer(text: String?,
|
||||
tooltipAction.execute(editor)
|
||||
}
|
||||
|
||||
val shortcutRunActionText = getKeymap(IdeActions.ACTION_RUN_INTENTION_ACTION)
|
||||
val shortcutRunActionText = KeymapUtil.getShortcutsText(runActionCustomShortcutSet.shortcuts)
|
||||
val shortcutShowAllActionsText = getKeymap(IdeActions.ACTION_SHOW_INTENTION_ACTIONS)
|
||||
|
||||
val gridBag = GridBag()
|
||||
@@ -142,7 +146,7 @@ internal class DaemonTooltipWithActionRenderer(text: String?,
|
||||
}
|
||||
|
||||
init {
|
||||
registerCustomShortcutSet(getActiveKeymapShortcuts(IdeActions.ACTION_RUN_INTENTION_ACTION), editor.contentComponent)
|
||||
registerCustomShortcutSet(runActionCustomShortcutSet, editor.contentComponent)
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
@@ -291,7 +291,6 @@ public interface IdeActions {
|
||||
|
||||
@NonNls String GROUP_ANALYZE = "AnalyzeMenu";
|
||||
@NonNls String ACTION_SHOW_ERROR_DESCRIPTION = "ShowErrorDescription";
|
||||
@NonNls String ACTION_RUN_INTENTION_ACTION = "RunErrorIntentionAction";
|
||||
|
||||
@NonNls String ACTION_EDITOR_DUPLICATE = "EditorDuplicate";
|
||||
@NonNls String ACTION_EDITOR_DUPLICATE_LINES = "EditorDuplicateLines";
|
||||
|
||||
@@ -439,9 +439,6 @@
|
||||
<action id="ShowIntentionActions">
|
||||
<keyboard-shortcut first-keystroke="alt ENTER"/>
|
||||
</action>
|
||||
<action id="RunErrorIntentionAction">
|
||||
<keyboard-shortcut first-keystroke="alt shift ENTER"/>
|
||||
</action>
|
||||
<action id="ExpandAllRegions">
|
||||
<keyboard-shortcut first-keystroke="control shift ADD"/>
|
||||
<keyboard-shortcut first-keystroke="control shift EQUALS"/>
|
||||
|
||||
Reference in New Issue
Block a user