本文整理汇总了Java中com.intellij.openapi.actionSystem.Shortcut.isKeyboard方法的典型用法代码示例。如果您正苦于以下问题:Java Shortcut.isKeyboard方法的具体用法?Java Shortcut.isKeyboard怎么用?Java Shortcut.isKeyboard使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.openapi.actionSystem.Shortcut
的用法示例。
在下文中一共展示了Shortcut.isKeyboard方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: skipAction
import com.intellij.openapi.actionSystem.Shortcut; //导入方法依赖的package包/类
private static boolean skipAction(KeyEvent e, List<AnAction> actionsToSkip)
{
if(actionsToSkip != null)
{
final KeyboardShortcut eventShortcut = new KeyboardShortcut(KeyStroke.getKeyStrokeForEvent(e), null);
for(AnAction action : actionsToSkip)
{
for(Shortcut sc : action.getShortcutSet().getShortcuts())
{
if(sc.isKeyboard() && sc.startsWith(eventShortcut))
{
return true;
}
}
}
}
return false;
}
示例2: getLabel
import com.intellij.openapi.actionSystem.Shortcut; //导入方法依赖的package包/类
@NotNull
private static String getLabel() {
Shortcut[] shortcuts = KeymapManager.getInstance().getActiveKeymap().getShortcuts("EditSource");
if (shortcuts.length > 0) {
Shortcut shortcut = shortcuts[0];
if (shortcut.isKeyboard()) {
KeyboardShortcut key = (KeyboardShortcut) shortcut;
String s = KeyStrokeAdapter.toString(key.getFirstKeyStroke());
if (s != null) {
return "Jump To Source [" + s.toUpperCase() + "]";
}
}
}
return "Jump To Source";
}
示例3: registerKeymapActions
import com.intellij.openapi.actionSystem.Shortcut; //导入方法依赖的package包/类
private static void registerKeymapActions(final TerminalPanel terminalPanel)
{
ActionManager actionManager = ActionManager.getInstance();
for(String actionId : ACTIONS_TO_SKIP)
{
final AnAction action = actionManager.getAction(actionId);
if(action != null)
{
AnAction a = new DumbAwareAction()
{
@Override
public void actionPerformed(AnActionEvent e)
{
if(e.getInputEvent() instanceof KeyEvent)
{
AnActionEvent event = new AnActionEvent(e.getInputEvent(), e.getDataContext(),
e.getPlace(), new Presentation(), e.getActionManager(), e.getModifiers());
action.update(event);
if(event.getPresentation().isEnabled())
{
action.actionPerformed(event);
}
else
{
terminalPanel.handleKeyEvent((KeyEvent) event.getInputEvent());
}
event.getInputEvent().consume();
}
}
};
for(Shortcut sc : action.getShortcutSet().getShortcuts())
{
if(sc.isKeyboard() && sc instanceof KeyboardShortcut)
{
KeyboardShortcut ksc = (KeyboardShortcut) sc;
a.registerCustomShortcutSet(ksc.getFirstKeyStroke().getKeyCode(),
ksc.getFirstKeyStroke().getModifiers(), terminalPanel);
}
}
}
}
}