Examples of KeyMap


Examples of com.intellij.openapi.keymap.Keymap

  private static String createTooltip(SonarIssue issue) {
    String myShortcutText;
    final KeymapManager keymapManager = KeymapManager.getInstance();
    if (keymapManager != null) {
      final Keymap keymap = keymapManager.getActiveKeymap();
      myShortcutText = keymap == null ? "" : "(" + KeymapUtil.getShortcutsText(keymap.getShortcuts(IdeActions.ACTION_SHOW_ERROR_DESCRIPTION)) + ")";
    }
    else {
      myShortcutText = "";
    }
    @NonNls final String link = " <a "
View Full Code Here

Examples of com.intellij.openapi.keymap.Keymap

      if (settings.isOptimizeImports()) {
        PropertiesComponent.getInstance().setValue(LayoutCodeConstants.OPTIMIZE_IMPORTS_KEY,
            Boolean.toString(false));
      }
      Keymap keyMap = getKeyMap();
      installShortcut(keyMap, OPTIMIZE_IMPORTS);
      installShortcut(keyMap, OPTIMIZE_IMPORTS_OLD_PLUGIN);
    }

  }
View Full Code Here

Examples of com.intellij.openapi.keymap.Keymap

      keyMap.addShortcut(OPTIMIZE_IMPORTS_PLUGIN, shortcut);
    }
  }

  private Keymap getKeyMap() {
    Keymap keymap = KeymapManagerImpl.getInstance().getActiveKeymap().getParent();
    if (keymap == null) {
      keymap = KeymapManagerImpl.getInstance().getActiveKeymap();
    }
    return keymap;
  }
View Full Code Here

Examples of com.intellij.openapi.keymap.Keymap

  private void uninstallCodeFormatter() {
    CodeStyleManager manager = CodeStyleManager.getInstance(project);
    while (manager instanceof EclipseCodeStyleManager) {
      manager = ((EclipseCodeStyleManager) manager).getOriginal();
      registerCodeStyleManager(project, manager);
      Keymap parent = getKeyMap();
      uninstallShortcut(parent, OPTIMIZE_IMPORTS_OLD_PLUGIN);
      uninstallShortcut(parent, OPTIMIZE_IMPORTS_PLUGIN);
    }

  }
View Full Code Here

Examples of com.intellij.openapi.keymap.Keymap

    public BindCtrlShiftTtoFlexUnit(){
    }

    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 javax.swing.text.Keymap

              public void actionPerformed(ActionEvent e)
              {
              }
          };

            Keymap km = _txtComp.getEditor().getKeymap();

            if(null == _originalActions)
            {
               _originalActions = new Action[_keysToDisableWhenPopUpOpen.length];

               for (int i = 0; i < _keysToDisableWhenPopUpOpen.length; i++)
               {
                  _originalActions[i] = km.getAction(_keysToDisableWhenPopUpOpen[i]);
               }
            }

            for (int i = 0; i < _keysToDisableWhenPopUpOpen.length; i++)
            {
               km.addActionForKeyStroke(_keysToDisableWhenPopUpOpen[i], doNothingAction);
            }
         }
         else
         {
            _txtComp.getFilter().requestFocusInWindow();
View Full Code Here

Examples of javax.swing.text.Keymap

    }

    public void testCreateKeymap() {
        JTextComponent.removeKeymap("BasicTextAreaUI");
        TextUI ui = jta.getUI();
        Keymap keymap = ((BasicTextUI) ui).createKeymap();
        assertEquals(getKeymapName(jta), keymap.getName());
        assertTrue(keymap.getDefaultAction() instanceof DefaultEditorKit.DefaultKeyTypedAction);
        assertEquals(0, keymap.getBoundActions().length);
        assertEquals(0, keymap.getBoundKeyStrokes().length);
        assertEquals(JTextComponent.DEFAULT_KEYMAP, keymap.getResolveParent().getName());
    }
View Full Code Here

Examples of javax.swing.text.Keymap

    }

    public void testCreateKeymap() {
        JTextComponent.removeKeymap("BasicTextAreaUI");
        TextUI ui = jta.getUI();
        Keymap keymap = ((BasicTextUI) ui).createKeymap();
        assertEquals(getKeymapName(jta), keymap.getName());
        assertTrue(keymap.getDefaultAction() instanceof DefaultEditorKit.DefaultKeyTypedAction);
        assertEquals(0, keymap.getBoundActions().length);
        assertEquals(0, keymap.getBoundKeyStrokes().length);
        assertEquals(JTextComponent.DEFAULT_KEYMAP, keymap.getResolveParent().getName());
    }
View Full Code Here

Examples of javax.swing.text.Keymap

    return commandManager;
  }

  public void registerAccelerators() {
    CommandManager commandManager = getCommandManager();
    Keymap keymap = new DefaultKeymap(getClass().getName(), textComponent.getKeymap());
    for (int i = 0; i < COMMANDS.length; i++) {
      ActionCommand command = commandManager.getActionCommand(COMMANDS[i]);
      keymap.addActionForKeyStroke(command.getAccelerator(), command.getActionAdapter());
    }
    if (COMMANDS.length > 0) {
      textComponent.setKeymap(keymap);
    }
  }
View Full Code Here

Examples of javax.swing.text.Keymap

        init();
    }
   
    public void init() {
       
        Keymap parent = m_TCPane.getActiveTextPane().getKeymap();
        Keymap newmap = JTextComponent.addKeymap("KeymapExampleMap", parent);

        KeyStroke shiftF5key = KeyStroke.getKeyStroke(KeyEvent.VK_F5, InputEvent.SHIFT_MASK);
        newmap.addActionForKeyStroke(shiftF5key, new ShiftF5Action());

        KeyStroke F5key = KeyStroke.getKeyStroke(KeyEvent.VK_F5, 0);
        newmap.addActionForKeyStroke(F5key, new F5Action());
       
        KeyStroke F6Key = KeyStroke.getKeyStroke(KeyEvent.VK_F6, 0);
        newmap.addActionForKeyStroke(F6Key, new F6Action());

        KeyStroke F8Key = KeyStroke.getKeyStroke(KeyEvent.VK_F8, 0);
        newmap.addActionForKeyStroke(F8Key, new ShiftF5Action());

        KeyStroke CTRLF2Key = KeyStroke.getKeyStroke(KeyEvent.VK_F2, InputEvent.CTRL_DOWN_MASK);
        newmap.addActionForKeyStroke(CTRLF2Key, new CTRLF2Action());
        m_TCPane.getActiveTextPane().setKeymap(newmap);
        
    }
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.