javax.swing.text.Keymap.getAction()方法的使用及代码示例

x33g5p2x  于2022-01-23 转载在 其他  
字(3.7k)|赞(0)|评价(0)|浏览(88)

本文整理了Java中javax.swing.text.Keymap.getAction()方法的一些代码示例,展示了Keymap.getAction()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Keymap.getAction()方法的具体详情如下:
包路径:javax.swing.text.Keymap
类名称:Keymap
方法名:getAction

Keymap.getAction介绍

暂无

代码示例

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-visualweb-designer

public Action getAction(KeyStroke key) {
  Action a = bindings.get(key);
  if ((a == null) && (parent != null)) {
    a = parent.getAction(key);
  }
  return a;
}

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/org-netbeans-modules-editor-lib

Action getActionImpl(KeyStroke key) {
  Action a = null;
  if (context != null) {
    a = context.getAction(key);
    if (a == null) { // possibly ignore modifier keystrokes
      switch (key.getKeyCode()) {
      case KeyEvent.VK_SHIFT:
      case KeyEvent.VK_CONTROL:
      case KeyEvent.VK_ALT:
      case KeyEvent.VK_META:
        return EMPTY_ACTION;
      }
      if (key.isOnKeyRelease()
        || (key.getKeyChar() != 0 && key.getKeyChar() != KeyEvent.CHAR_UNDEFINED)
      ) {
        return EMPTY_ACTION; // ignore releasing and typed events
      }
    }
  } else {
    a = delegate.getAction(key);
  }
  return a;
}

代码示例来源:origin: net.java.abeille/abeille

Action getActionImpl(KeyStroke key) {
  Action a = null;
  if (context != null) {
    a = context.getAction(key);
    if (a == null) { // possibly ignore modifier keystrokes
      switch (key.getKeyCode()) {
      case KeyEvent.VK_SHIFT:
      case KeyEvent.VK_CONTROL:
      case KeyEvent.VK_ALT:
      case KeyEvent.VK_META:
        return EMPTY_ACTION;
      }
      if (key.isOnKeyRelease() || (key.getKeyChar() != 0 && key.getKeyChar() != KeyEvent.CHAR_UNDEFINED)) {
        return EMPTY_ACTION; // ignore releasing and typed events
      }
    }
  }
  else {
    a = delegate.getAction(key);
  }
  return a;
}

代码示例来源:origin: dcaoyuan/nbscala

public Action getAction(KeyStroke key) {
  if (enter.equals(key) ||
    esc.equals(key) ||
    tab.equals(key)) {
    return null;
  } else {
    return keyMap.getAction(key);
  }
}
public Action[] getBoundActions() {

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-visualweb-designer

public Object get(KeyStroke keyStroke) {
    Object retValue = keymap.getAction(keyStroke);
    if (retValue == null) {
      retValue = super.get(keyStroke);
      if ((retValue == null) && (keyStroke.getKeyChar() != KeyEvent.CHAR_UNDEFINED) &&
          (keymap.getDefaultAction() != null)) {
        // Implies this is a KeyTyped event, use the default
        // action.
        retValue = DefaultActionKey;
      }
    }
    return retValue;
  }
}

代码示例来源:origin: net.sf.squirrel-sql.thirdpary-non-maven/openide

Action action = (km != null) ? km.getAction(ks) : null;

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide

Action action = (km != null) ? km.getAction(ks) : null;

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-remotefs-versioning-api

@Override
protected boolean processKeyBinding(KeyStroke ks, KeyEvent e, int condition, boolean pressed) {
  boolean ret = super.processKeyBinding(ks, e, condition, pressed);
  // XXX #250546 Reason of overriding: to process global shortcut.
  if ((JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT == condition) && (ret == false) && !e.isConsumed()) {
    Keymap km = Lookup.getDefault().lookup(Keymap.class);
    Action action = (km != null) ? km.getAction(ks) : null;
    if (action == null) {
      return false;
    }
    if (action instanceof CallbackSystemAction) {
      CallbackSystemAction csAction = (CallbackSystemAction) action;
      if (tabbedPane != null) {
        Action a = tabbedPane.getActionMap().get(csAction.getActionMapKey());
        if (a != null) {
          a.actionPerformed(new ActionEvent(this, ActionEvent.ACTION_PERFORMED, Utilities.keyToString(ks)));
          return true;
        }
      }
    }
    return false;
  } else {
    return ret;
  }
}

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/org-netbeans-modules-editor-lib

cur.addActionForKeyStroke(mb.keys[j], a);
} else { // not the last keystroke
  Action sca = cur.getAction(mb.keys[j]);
  if (!(sca instanceof KeymapSetContextAction)) {
    sca = new KeymapSetContextAction(JTextComponent.addKeymap(null, null));

代码示例来源:origin: net.java.abeille/abeille

Action sca = cur.getAction(mb.keys[j]);
if (!(sca instanceof KeymapSetContextAction)) {
  sca = new KeymapSetContextAction(JTextComponent.addKeymap(null, null));

相关文章