Example usage for javax.swing JRadioButtonMenuItem getActionCommand

List of usage examples for javax.swing JRadioButtonMenuItem getActionCommand

Introduction

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

Prototype

public String getActionCommand() 

Source Link

Document

Returns the action command for this button.

Usage

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);
                }//w ww . ja  va2 s .co m
            } else if (component instanceof JCheckBoxMenuItem) {
                JCheckBoxMenuItem mi = (JCheckBoxMenuItem) component;
                if (mi.getActionCommand().equals(ACTION_VIEW_HIDDEN))
                    mi.setSelected(getFileChooser().isFileHidingEnabled());
            }
        }
    }
}