Exemplo n.º 1
0
 public final void registerAction(
     @NonNls String aActionName,
     int aKeyCode,
     @JdkConstants.InputEventMask int aModifier,
     Action aAction) {
   myInputMap.put(KeyStroke.getKeyStroke(aKeyCode, aModifier), aActionName);
   myActionMap.put(aActionName, aAction);
 }
Exemplo n.º 2
0
 private boolean proceedKeyEvent(KeyEvent event, KeyStroke stroke) {
   if (myInputMap.get(stroke) != null) {
     final Action action = myActionMap.get(myInputMap.get(stroke));
     if (action != null && action.isEnabled()) {
       action.actionPerformed(
           new ActionEvent(
               getContent(), event.getID(), "", event.getWhen(), event.getModifiers()));
       return true;
     }
   }
   return false;
 }
Exemplo n.º 3
0
 public final void registerAction(
     @NonNls String aActionName, KeyStroke keyStroke, Action aAction) {
   myInputMap.put(keyStroke, aActionName);
   myActionMap.put(aActionName, aAction);
 }