예제 #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);
 }
예제 #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;
 }
예제 #3
0
 public final void registerAction(
     @NonNls String aActionName, KeyStroke keyStroke, Action aAction) {
   myInputMap.put(keyStroke, aActionName);
   myActionMap.put(aActionName, aAction);
 }