mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
propagate shortcut to the intention wrapper
if you have an intention which is wrap some real action, you could show an appropriate shortcut in the intention popup
This commit is contained in:
+10
-1
@@ -18,6 +18,8 @@ package com.intellij.codeInsight.intention.impl.config;
|
||||
|
||||
import com.intellij.codeInsight.intention.IntentionAction;
|
||||
import com.intellij.codeInsight.intention.IntentionActionBean;
|
||||
import com.intellij.openapi.actionSystem.ShortcutProvider;
|
||||
import com.intellij.openapi.actionSystem.ShortcutSet;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.project.Project;
|
||||
@@ -28,7 +30,7 @@ import com.intellij.util.IncorrectOperationException;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public class IntentionActionWrapper implements IntentionAction {
|
||||
public class IntentionActionWrapper implements IntentionAction, ShortcutProvider {
|
||||
private static final Logger LOG = Logger.getInstance("#com.intellij.codeInsight.intention.impl.config.IntentionActionWrapper");
|
||||
|
||||
private IntentionAction myDelegate;
|
||||
@@ -112,4 +114,11 @@ public class IntentionActionWrapper implements IntentionAction {
|
||||
public boolean equals(Object obj) {
|
||||
return super.equals(obj) || getDelegate().equals(obj);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public ShortcutSet getShortcut() {
|
||||
IntentionAction delegate = getDelegate();
|
||||
return delegate instanceof ShortcutProvider ? ((ShortcutProvider)delegate).getShortcut() : null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user