Package com.intellij.openapi.actionSystem

Examples of com.intellij.openapi.actionSystem.KeyboardShortcut


    List<KeyStroke> result = new ArrayList<KeyStroke>();
    Shortcut[] shortcuts = KeymapManager.getInstance().getActiveKeymap().getShortcuts(actionId);
    for (Shortcut shortcut : shortcuts) {
      if (!(shortcut instanceof KeyboardShortcut)) continue;

      KeyboardShortcut keyboardShortcut = (KeyboardShortcut) shortcut;
      if (keyboardShortcut.getSecondKeyStroke() == null && keyboardShortcut.getFirstKeyStroke() != null) {
        result.add(keyboardShortcut.getFirstKeyStroke());
      }
    }
    if (result.isEmpty()) result.add(defaultKeyStroke);
    return result;
  }
View Full Code Here


  public static String getShortcutText(Shortcut shortcut) {
    String s = "";

    if (shortcut instanceof KeyboardShortcut) {
      KeyboardShortcut keyboardShortcut = (KeyboardShortcut)shortcut;

      String acceleratorText = getKeystrokeText(keyboardShortcut.getFirstKeyStroke());
      if (acceleratorText.length() > 0) {
        s = acceleratorText;
      }

      acceleratorText = getKeystrokeText(keyboardShortcut.getSecondKeyStroke());
      if (acceleratorText.length() > 0) {
        s += ", " + acceleratorText;
      }
    }
    else if (shortcut instanceof MouseShortcut) {
View Full Code Here

    }

    public void initComponent(){
        //hack: hooking into ctrl+shift+T ;)
        final Keymap keymap = KeymapManagerImpl.getInstance().getActiveKeymap();
        keymap.addShortcut("GoToFlexUnitTestOrCode", new KeyboardShortcut(KeyStroke.getKeyStroke('T', InputEvent.CTRL_MASK + InputEvent.SHIFT_MASK), null));
    }
View Full Code Here

TOP

Related Classes of com.intellij.openapi.actionSystem.KeyboardShortcut

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.