Examples of KeyboardShortcut


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

Examples of com.intellij.openapi.actionSystem.KeyboardShortcut

  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

Examples of com.intellij.openapi.actionSystem.KeyboardShortcut

    }

    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

Examples of edu.wpi.cs.wpisuitetng.janeway.gui.widgets.KeyboardShortcut

  @SuppressWarnings("serial")
  private void registerKeyboardShortcuts(JanewayTabModel tab) {
    String osName = System.getProperty("os.name").toLowerCase();
   
    // control + tab: switch to right tab
    tab.addKeyboardShortcut(new KeyboardShortcut(KeyStroke.getKeyStroke("control TAB"), new AbstractAction() {
      @Override
      public void actionPerformed(ActionEvent e) {
        mainTabController.switchToRightTab();
      }
    }));
   
    // control + shift + tab: switch to left tab
    tab.addKeyboardShortcut(new KeyboardShortcut(KeyStroke.getKeyStroke("control shift TAB"), new AbstractAction() {
      @Override
      public void actionPerformed(ActionEvent e) {
        mainTabController.switchToLeftTab();
      }
    }));
   
    // command + w for mac or control + w for windows: close the current tab
    if (osName.contains("mac")) {
      tab.addKeyboardShortcut(new KeyboardShortcut(KeyStroke.getKeyStroke("meta W"), new AbstractAction() {
        @Override
        public void actionPerformed(ActionEvent e) {
          mainTabController.closeCurrentTab();
        }
      }));
    }
    else {
      tab.addKeyboardShortcut(new KeyboardShortcut(KeyStroke.getKeyStroke("control W"), new AbstractAction() {
        @Override
        public void actionPerformed(ActionEvent e) {
          mainTabController.closeCurrentTab();
        }
      }));
View Full Code Here

Examples of edu.wpi.cs.wpisuitetng.janeway.gui.widgets.KeyboardShortcut

   * @param keyEventDispatcher the current key event dispatcher
   */
  private void addGlobalKeyboardShortcuts(JanewayKeyEventDispatcher keyEventDispatcher) {
   
    // control + page down: switch to the module tab to the right
    keyEventDispatcher.addGlobalKeyboardShortcut(new KeyboardShortcut(KeyStroke.getKeyStroke("control PAGE_DOWN"), new AbstractAction() {
      @Override
      public void actionPerformed(ActionEvent event) {
        tabPanel.switchToRightTab();
      }
    }));
   
    // control + page up: switch to the module tab to the left
    keyEventDispatcher.addGlobalKeyboardShortcut(new KeyboardShortcut(KeyStroke.getKeyStroke("control PAGE_UP"), new AbstractAction() {
      @Override
      public void actionPerformed(ActionEvent event) {
        tabPanel.switchToLeftTab();
      }
    }));
View Full Code Here

Examples of org.rstudio.core.client.command.KeyboardShortcut

         command.setVisible(false);
         command.setEnabled(false);
      }
     
      // fake shortcuts for commands which we handle at a lower level
      commands.goToHelp().setShortcut(new KeyboardShortcut(112));
      commands.goToFunctionDefinition().setShortcut(new KeyboardShortcut(113));
      commands.codeCompletion().setShortcut(
                                    new KeyboardShortcut(KeyCodes.KEY_TAB));

      // See bug 3673 and https://bugs.webkit.org/show_bug.cgi?id=41016
      if (BrowseCap.isMacintosh())
      {
         ShortcutManager.INSTANCE.register(
View Full Code Here

Examples of org.rstudio.core.client.command.KeyboardShortcut

            commands_.compileNotebook().createToolbarButton());
     
      int mod = BrowseCap.hasMetaKey() ? KeyboardShortcut.META :
         KeyboardShortcut.CTRL;
      String cmdText =
        new KeyboardShortcut(mod + KeyboardShortcut.SHIFT, 'K').toString(true);
      cmdText = DomUtils.htmlToText(cmdText);
      notebookToolbarButton_.setTitle("Compile Notebook (" + cmdText + ")");
     
      texSeparatorWidget_ = toolbar.addLeftSeparator();
      toolbar.addLeftWidget(texToolbarButton_ = createLatexFormatButton());
View Full Code Here

Examples of org.rstudio.core.client.command.KeyboardShortcut

   {
      VerticalPanel panel = new VerticalPanel();
     
      int mod = BrowseCap.hasMetaKey() ? KeyboardShortcut.META :
                                         KeyboardShortcut.CTRL;
      String cmdText = new KeyboardShortcut(mod, 'C').toString(true);
      HTML label = new HTML("Press " + cmdText +
                            " to copy the key to the clipboard");
      label.addStyleName(RES.styles().viewPublicKeyLabel());
      panel.add(label);
     
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.