Package javax.swing

Examples of javax.swing.InputMap.keys()


        ActionMap am = jta.getActionMap().getParent().getParent();
        assertNotNull(am);
        assertNotNull(im);
        assertEquals(1, im.size());
        assertTrue(am.size() > 0);
        assertEquals(im.keys()[0], KeyStroke.getKeyStroke('A', InputEvent.ALT_DOWN_MASK));
        Object actionName = im.get(im.keys()[0]);
        assertNotNull(am.get(actionName));
    }
}
View Full Code Here


        assertNotNull(am);
        assertNotNull(im);
        assertEquals(1, im.size());
        assertTrue(am.size() > 0);
        assertEquals(im.keys()[0], KeyStroke.getKeyStroke('A', InputEvent.ALT_DOWN_MASK));
        Object actionName = im.get(im.keys()[0]);
        assertNotNull(am.get(actionName));
    }
}
View Full Code Here

     * @return
     */
    public static KeyStroke getKeyStroke(JComponent component) {
        InputMap inputMap = component.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
        if (inputMap != null) {
            KeyStroke[] keyStrokes = inputMap.keys();
            if (keyStrokes != null) {
                for (KeyStroke keyStroke : keyStrokes) {
                    if (KEYID.equals(inputMap.get(keyStroke))) {
                        return keyStroke;
                    }
View Full Code Here

     * @param component
     */
    public static void clearKeyStroke(JComponent component) {
        InputMap inputMap = component.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
        if (inputMap != null) {
            KeyStroke[] keyStrokes = inputMap.keys();
            if (keyStrokes != null) {
                for (KeyStroke keyStroke : inputMap.keys()) {
                    if (KEYID.equals(inputMap.get(keyStroke))) {
                        inputMap.remove(keyStroke);
                        break;
View Full Code Here

    public static void clearKeyStroke(JComponent component) {
        InputMap inputMap = component.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
        if (inputMap != null) {
            KeyStroke[] keyStrokes = inputMap.keys();
            if (keyStrokes != null) {
                for (KeyStroke keyStroke : inputMap.keys()) {
                    if (KEYID.equals(inputMap.get(keyStroke))) {
                        inputMap.remove(keyStroke);
                        break;
                    }
                }
View Full Code Here

      inputMap = inputMap.getParent();
      if (inputMap == null) {
        return null;
      }

      Object[] keys = inputMap.keys();
      if (keys == null) {
        return null;
      }

      for (Object keyStroke : keys) {
View Full Code Here

    @Override
    public void destroy() {
        if (this.contentPane != null) {
            InputMap inputMap = contentPane.getInputMap();
            KeyStroke[] inputKeys = inputMap.keys();
            if (inputKeys != null) {
                for (KeyStroke key : inputKeys) {
                    Object binding = inputMap.get(key);
                    if (binding instanceof String && ((String)binding).startsWith("MapMover.")) {
                        inputMap.remove(key);
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.