Search in sources :

Example 1 with BooleanPref

use of edu.mit.csail.sdg.alloy4.A4Preferences.BooleanPref in project org.alloytools.alloy by AlloyTools.

the class SimpleGUI method addToMenu.

/**
 * Creates menu items from boolean preferences (<code>prefs</code>) and adds
 * them to a given parent menu (<code>parent</code>).
 */
private void addToMenu(JMenu parent, BooleanPref... prefs) {
    for (BooleanPref pref : prefs) {
        Action action = pref.getTitleAction();
        Object name = action.getValue(Action.NAME);
        menuItem(parent, name + ": " + (pref.get() ? "Yes" : "No"), action);
    }
}
Also used : Action(javax.swing.Action) BooleanPref(edu.mit.csail.sdg.alloy4.A4Preferences.BooleanPref)

Aggregations

BooleanPref (edu.mit.csail.sdg.alloy4.A4Preferences.BooleanPref)1 Action (javax.swing.Action)1