Example usage for javax.swing JRadioButtonMenuItem getAction

List of usage examples for javax.swing JRadioButtonMenuItem getAction

Introduction

In this page you can find the example usage for javax.swing JRadioButtonMenuItem getAction.

Prototype

public Action getAction() 

Source Link

Document

Returns the currently set Action for this ActionEvent source, or null if no Action is set.

Usage

From source file:net.sf.vfsjfilechooser.filepane.VFSFilePane.java

private void updateViewMenu() {
    if (viewMenu != null) {
        Component[] components = viewMenu.getMenuComponents();

        for (Component component : components) {
            if (component instanceof JRadioButtonMenuItem) {
                JRadioButtonMenuItem mi = (JRadioButtonMenuItem) component;

                if (((ViewTypeAction) mi.getAction()).viewType == viewType) {
                    mi.setSelected(true);
                }/*  w w w  .j a v a  2  s.c om*/
            }
        }
    }
}

From source file:com.googlecode.vfsjfilechooser2.filepane.VFSFilePane.java

private void updateViewMenu() {
    if (viewMenu != null) {
        Component[] components = viewMenu.getMenuComponents();

        for (Component component : components) {
            if (component instanceof JRadioButtonMenuItem) {
                JRadioButtonMenuItem mi = (JRadioButtonMenuItem) component;

                if (((ViewTypeAction) mi.getAction()).viewType == viewType) {
                    mi.setSelected(true);
                }//from   w  w  w .  ja v a 2  s  .  com
            } else if (component instanceof JCheckBoxMenuItem) {
                JCheckBoxMenuItem mi = (JCheckBoxMenuItem) component;
                if (mi.getActionCommand().equals(ACTION_VIEW_HIDDEN))
                    mi.setSelected(getFileChooser().isFileHidingEnabled());
            }
        }
    }
}