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

x33g5p2x  于2022-01-21 转载在 其他  
字(4.2k)|赞(0)|评价(0)|浏览(112)

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

JTextComponent.addKeymap介绍

暂无

代码示例

代码示例来源:origin: bobbylight/RSyntaxTextArea

/**
 * Creates the keymap for this text area.  This takes the super class's
 * keymap, but sets the default keystroke to be RTextAreaEditorKit's
 * DefaultKeyTypedAction.  This must be done to override the default
 * keymap's default key-typed action.
 *
 * @return The keymap.
 */
@Override
protected Keymap createKeymap() {
  // Load the keymap we'll be using (it's saved by
  // JTextComponent.addKeymap).
  Keymap map = JTextComponent.getKeymap(RTEXTAREA_KEYMAP_NAME);
  if (map==null) {
    Keymap parent = JTextComponent.getKeymap(JTextComponent.DEFAULT_KEYMAP);
    map = JTextComponent.addKeymap(RTEXTAREA_KEYMAP_NAME, parent);
    map.setDefaultAction(new RTextAreaEditorKit.DefaultKeyTypedAction());
  }
  return map;
}

代码示例来源:origin: nodebox/nodebox

consolePrompt.setFont(Theme.EDITOR_FONT);
Keymap defaultKeymap = JTextComponent.getKeymap(JTextComponent.DEFAULT_KEYMAP);
Keymap keymap = JTextComponent.addKeymap(null, defaultKeymap);
keymap.addActionForKeyStroke(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), new EnterAction());
keymap.addActionForKeyStroke(KeyStroke.getKeyStroke(KeyEvent.VK_UP, 0), new HistoryUpAction());

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

/** Construct new keymap.
* @param name name of new keymap
*/
public MultiKeymap(String name) {
  delegate = JTextComponent.addKeymap(name, null);
}

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

/**
 * Construct new keymap.
 * 
 * @param name
 *            name of new keymap
 */
public MultiKeymap(String name) {
  delegate = JTextComponent.addKeymap(name, null);
}

代码示例来源:origin: com.fifesoft/rsyntaxtextarea

/**
 * Creates the keymap for this text area.  This takes the super class's
 * keymap, but sets the default keystroke to be RTextAreaEditorKit's
 * DefaultKeyTypedAction.  This must be done to override the default
 * keymap's default key-typed action.
 *
 * @return The keymap.
 */
@Override
protected Keymap createKeymap() {
  // Load the keymap we'll be using (it's saved by
  // JTextComponent.addKeymap).
  Keymap map = JTextComponent.getKeymap(RTEXTAREA_KEYMAP_NAME);
  if (map==null) {
    Keymap parent = JTextComponent.getKeymap(JTextComponent.DEFAULT_KEYMAP);
    map = JTextComponent.addKeymap(RTEXTAREA_KEYMAP_NAME, parent);
    map.setDefaultAction(new RTextAreaEditorKit.DefaultKeyTypedAction());
  }
  return map;
}

代码示例来源:origin: org.nuiton.thirdparty/rsyntaxtextarea

/**
 * Creates the keymap for this text area.  This takes the super class's
 * keymap, but sets the default keystroke to be RTextAreaEditorKit's
 * DefaultKeyTypedAction.  This must be done to override the default
 * keymap's default key-typed action.
 *
 * @return The keymap.
 */
protected Keymap createKeymap() {
  // Load the keymap we'll be using (it's saved by
  // JTextComponent.addKeymap).
  Keymap map = JTextComponent.getKeymap(RTEXTAREA_KEYMAP_NAME);
  if (map==null) {
    Keymap parent = JTextComponent.getKeymap(JTextComponent.DEFAULT_KEYMAP);
    map = JTextComponent.addKeymap(RTEXTAREA_KEYMAP_NAME, parent);
    map.setDefaultAction(new RTextAreaEditorKit.DefaultKeyTypedAction());
  }
  return map;
}

代码示例来源:origin: org.codehaus.jtstand/jtstand-editor

/**
 * Creates the keymap for this text area.  This takes the super class's
 * keymap, but sets the default keystroke to be RTextAreaEditorKit's
 * DefaultKeyTypedAction.  This must be done to override the default
 * keymap's default key-typed action.
 *
 * @return The keymap.
 */
protected Keymap createKeymap() {
  // Load the keymap we'll be using (it's saved by
  // JTextComponent.addKeymap).
  Keymap map = JTextComponent.getKeymap(RTEXTAREA_KEYMAP_NAME);
  if (map==null) {
    Keymap parent = JTextComponent.getKeymap(JTextComponent.DEFAULT_KEYMAP);
    map = JTextComponent.addKeymap(RTEXTAREA_KEYMAP_NAME, parent);
    map.setDefaultAction(new RTextAreaEditorKit.DefaultKeyTypedAction());
  }
  return map;
}

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

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

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

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

相关文章

JTextComponent类方法