Examples of KeyMap


Examples of javax.swing.text.Keymap

     *
     */
    protected void installKeyboardActions() {
        installUIActionMap();
        installUIInputMap();
        Keymap keymap = createKeymap();
        component.setKeymap(keymap);
    }
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

    SessionPane.add(passwdField, new GridBagConstraints(1, 6, 1, 1, 0, 0,
            GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL,
      new Insets(0, 0, 0, 0), 0, 0));

  /* Remove the RETURN key from the shared map of JTextFields */
    Keymap map = hostField.getKeymap();
    KeyStroke key = KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0);
    map.removeKeyStrokeBinding(key);

  /* Make the OK button the default button */
    this.getRootPane().setDefaultButton(okButton);

  } //private jbInit()
View Full Code Here

Examples of javax.swing.text.Keymap

    SessionPane.add(passwdField, new GridBagConstraints(1, 6, 1, 1, 0, 0,
            GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL,
      new Insets(0, 0, 0, 0), 0, 0));

  /* Remove the RETURN key from the shared map of JTextFields */
    Keymap map = hostField.getKeymap();
    KeyStroke key = KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0);
    map.removeKeyStrokeBinding(key);

  /* Make the OK button the default button */
    this.getRootPane().setDefaultButton(okButton);

  } //private jbInit()
View Full Code Here

Examples of javax.swing.text.Keymap

    SessionPane.add(passwdField, new GridBagConstraints(1, 6, 1, 1, 0, 0,
            GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL,
      new Insets(0, 0, 0, 0), 0, 0));

  /* Remove the RETURN key from the shared map of JTextFields */
    Keymap map = hostField.getKeymap();
    KeyStroke key = KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0);
    map.removeKeyStrokeBinding(key);

  /* Make the OK button the default button */
    this.getRootPane().setDefaultButton(okButton);

  } //private jbInit()
View Full Code Here

Examples of javax.swing.text.Keymap

    SessionPane.add(userField, new GridBagConstraints(1, 4, 1, 1, 0, 0,
            GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL,
      new Insets(0, 0, 0, 0), 0, 0));

  /* Remove the RETURN key from the shared map of JTextFields */
    Keymap map = hostField.getKeymap();
    KeyStroke key = KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0);
    map.removeKeyStrokeBinding(key);

  /* Make the OK button the default button */
    this.getRootPane().setDefaultButton(okButton);

  } //private jbInit()
View Full Code Here

Examples of javax.swing.text.Keymap

    SessionPane.add(passwdField, new GridBagConstraints(1, 6, 1, 1, 0, 0,
            GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL,
      new Insets(0, 0, 0, 0), 0, 0));

  /* Remove the RETURN key from the shared map of JTextFields */
    Keymap map = hostField.getKeymap();
    KeyStroke key = KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0);
    map.removeKeyStrokeBinding(key);

  /* Make the OK button the default button */
    this.getRootPane().setDefaultButton(okButton);

  } //private jbInit()
View Full Code Here

Examples of javax.swing.text.Keymap

        return new BasicHighlighter();
    }

    protected Keymap createKeymap() {
        String name = getKeymapName();
        Keymap keymap = JTextComponent.getKeymap(name);
        if (keymap == null) {
            keymap = JTextComponent.addKeymap(name, JTextComponent
                    .getKeymap(JTextComponent.DEFAULT_KEYMAP));
        }
        Object bindings = UIManager.get(addPrefix(".keyBindings"));
View Full Code Here

Examples of javax.swing.text.Keymap

     *
     */
    protected void installKeyboardActions() {
        installUIActionMap();
        installUIInputMap();
        Keymap keymap = createKeymap();
        component.setKeymap(keymap);
    }
View Full Code Here

Examples of javax.swing.text.Keymap

                }
            };

        textComponent.getDocument().addUndoableEditListener(undoListener);

        Keymap keymap = JTextComponent.addKeymap("TextUndoRedoKeymap", textComponent.getKeymap()); //$NON-NLS-1$
        keymap.addActionForKeyStroke(KeyStroke.getKeyStroke(KeyEvent.VK_Z, InputEvent.CTRL_MASK), undoAction);
        keymap.addActionForKeyStroke(KeyStroke.getKeyStroke(KeyEvent.VK_Y, InputEvent.CTRL_MASK), redoAction);
        textComponent.setKeymap(keymap);
    }
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.