Package javax.swing

Examples of javax.swing.ActionMap


        // JW: changed (0.9.6) to when-ancestor just to be on the safe side
        // if the title contain active comps
        installKeyBindings(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
        // JW: removed the automatic keybindings in WHEN_IN_FOCUSED
        // which caused #555-swingx (binding active if not focused)
        ActionMap actionMap = monthView.getActionMap();
        KeyboardAction acceptAction = new KeyboardAction(KeyboardAction.ACCEPT_SELECTION);
        actionMap.put("acceptSelection", acceptAction);
        KeyboardAction cancelAction = new KeyboardAction(KeyboardAction.CANCEL_SELECTION);
        actionMap.put("cancelSelection", cancelAction);

        actionMap.put("selectPreviousDay", new KeyboardAction(KeyboardAction.SELECT_PREVIOUS_DAY));
        actionMap.put("selectNextDay", new KeyboardAction(KeyboardAction.SELECT_NEXT_DAY));
        actionMap.put("selectDayInPreviousWeek", new KeyboardAction(KeyboardAction.SELECT_DAY_PREVIOUS_WEEK));
        actionMap.put("selectDayInNextWeek", new KeyboardAction(KeyboardAction.SELECT_DAY_NEXT_WEEK));

        actionMap.put("adjustSelectionPreviousDay", new KeyboardAction(KeyboardAction.ADJUST_SELECTION_PREVIOUS_DAY));
        actionMap.put("adjustSelectionNextDay", new KeyboardAction(KeyboardAction.ADJUST_SELECTION_NEXT_DAY));
        actionMap.put("adjustSelectionPreviousWeek", new KeyboardAction(KeyboardAction.ADJUST_SELECTION_PREVIOUS_WEEK));
        actionMap.put("adjustSelectionNextWeek", new KeyboardAction(KeyboardAction.ADJUST_SELECTION_NEXT_WEEK));

       
        actionMap.put(JXMonthView.COMMIT_KEY, acceptAction);
        actionMap.put(JXMonthView.CANCEL_KEY, cancelAction);
       
        // PENDING JW: complete (year-, decade-, ?? ) and consolidate with KeyboardAction
        // additional navigation actions
        AbstractActionExt prev = new AbstractActionExt() {
View Full Code Here


    }


    private void initActions() {
        // Register the actions that this class can handle.
        ActionMap map = getActionMap();
        map.put("expand-all", new Actions("expand-all"));
        map.put("collapse-all", new Actions("collapse-all"));
    }
View Full Code Here

        // Changing the l&f can change the combobox' editor which in turn
        // would not be autocompletion-enabled. The new editor needs to be set-up.
        comboBox.addPropertyChangeListener("editor", new AutoComplete.PropertyChangeListener(comboBox));
       
        if (!strictMatching) {
            ActionMap map = comboBox.getActionMap();
           
            for (String key : COMBO_BOX_ACTIONS) {
                Action a = map.get(key);
                map.put(key, new AutoComplete.SelectionAction(a));
            }
        }
    }
View Full Code Here

       
        if (editorComponent.getDocument() instanceof AutoCompleteDocument) {
            AutoCompleteDocument doc = (AutoCompleteDocument) editorComponent.getDocument();
           
            if (doc.strictMatching) {
                ActionMap map = comboBox.getActionMap();
               
                for (String key : COMBO_BOX_ACTIONS) {
                    map.put(key, null);
                }
            }
           
            //remove old property change listener
            for (PropertyChangeListener l : comboBox.getPropertyChangeListeners("editor")) {
View Full Code Here

            }
           
            editorInputMap = parent;
        }
       
        ActionMap editorActionMap = textComponent.getActionMap();
        editorActionMap.put("nonstrict-backspace", new NonStrictBackspaceAction(
                editorActionMap.get(DefaultEditorKit.deletePrevCharAction),
                editorActionMap.get(DefaultEditorKit.selectionBackwardAction),
                adaptor));
    }
View Full Code Here

        menuKeyListener = null;
        mouseInputListener = null;
    }

    protected void installKeyboardActions() {
        ActionMap actionMap = new ActionMapUIResource();
        actionMap.put(StringConstants.MNEMONIC_ACTION, MNEMONIC_ACTION);
        actionMap.setParent(((BasicLookAndFeel)UIManager.getLookAndFeel()).getAudioActionMap());
        SwingUtilities.replaceUIActionMap(menuItem, actionMap);
    }
View Full Code Here

    public void uninstallKeyboardActions(final JComponent c) {
        SwingUtilities.replaceUIActionMap(c, null);
    }

    public void installKeyboardActions(final JComponent c) {
        ActionMap actionMap = new ActionMapUIResource();
        actionMap.put(StringConstants.BUTTON_PRESSED_ACTION, PRESS_ACTION);
        actionMap.put(StringConstants.BUTTON_RELEASED_ACTION, RELEASE_ACTION);
        actionMap.put(StringConstants.MNEMONIC_ACTION, MNEMONIC_ACTION);
        SwingUtilities.replaceUIActionMap(c, actionMap);
    }
View Full Code Here

        super.installDefaults();
        LookAndFeel.installProperty(menuItem, "opaque", Boolean.FALSE);
    }

    protected void installKeyboardActions() {
        ActionMap actionMap = new ActionMapUIResource();
        actionMap.put(StringConstants.MNEMONIC_ACTION, MNEMONIC_ACTION);
        actionMap.setParent(((BasicLookAndFeel)UIManager.getLookAndFeel()).getAudioActionMap());
        SwingUtilities.replaceUIActionMap(menuItem, actionMap);
    }
View Full Code Here

    protected void installKeyboardActions() {
        SwingUtilities.replaceUIInputMap(optionPane, JComponent.WHEN_IN_FOCUSED_WINDOW,
                       LookAndFeel.makeComponentInputMap(optionPane, (Object[])UIManager.get(PROPERTY_PREFIX + "windowBindings")));

        ActionMap actionMap = new ActionMapUIResource();
        actionMap.put(StringConstants.CLOSE_ACTION, closeAction);
        actionMap.setParent(((BasicLookAndFeel)UIManager.getLookAndFeel())
                            .getAudioActionMap());
        SwingUtilities.replaceUIActionMap(optionPane, actionMap);
    }
View Full Code Here

            @Override
            public void actionPerformed(ActionEvent actionEvent) {
                doSearch(actionEvent);
            }
        };
        ActionMap actionMap = rootPane.getActionMap();
        actionMap.put(escapeAction.getValue(Action.NAME), escapeAction);
        actionMap.put(enterAction.getValue(Action.NAME), enterAction);
        InputMap inputMap = rootPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
        inputMap.put(KeyStrokes.ESC, escapeAction.getValue(Action.NAME));
        inputMap.put(KeyStrokes.ENTER, enterAction.getValue(Action.NAME));

        return rootPane;
View Full Code Here

TOP

Related Classes of javax.swing.ActionMap

Copyright © 2018 www.massapicom. 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.