Java Swing Key Action isActionSelected(Action action)

Here you can find the source of isActionSelected(Action action)

Description

is Action Selected

License

Open Source License

Parameter

Parameter Description
action a parameter

Declaration

public static boolean isActionSelected(Action action) 

Method Source Code

//package com.java2s;
//it under the terms of the GNU Affero General Public License as published by

import javax.swing.Action;

public class Main {
    /**//from   w  w w . j a  v a  2  s. c o m
     *
     * @param action
     * @return
     */
    public static boolean isActionSelected(Action action) {
        if (action == null)
            return false;
        Boolean result = (Boolean) action.getValue(Action.SELECTED_KEY);
        return result == null ? false : result;
    }
}

Related

  1. getTypePanel(final ActionListener typeListener)
  2. handleSliderAdjustmentViaKey(KeyEvent e)
  3. initButton(String text, String actionKey, int shortcutKey, int modifiers, JComponent component, AbstractAction action)
  4. installCloseKey(final RootPaneContainer c)
  5. invoke(Action action, Object source)
  6. isKeyStrokeEvent(@Nullable final KeyStroke keyStroke, final int keyEventType, @Nullable final KeyEvent event)
  7. isValidKey(int keyCode)
  8. keyEventPressed(KeyEvent event, KeyStroke keyStroke)
  9. keyStrokeToString(final KeyStroke keyStroke)