Search in sources :

Example 1 with ChoicePref

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

the class SimpleGUI method addToMenu.

/**
 * Creates a menu item for each choice preference (from <code>prefs</code>) and
 * adds it to a given parent menu (<code>parent</code>).
 */
@SuppressWarnings({ "rawtypes", "unchecked" })
private JMenu addToMenu(JMenu parent, ChoicePref... prefs) {
    JMenu last = null;
    for (ChoicePref pref : prefs) {
        last = new JMenu(pref.title + ": " + pref.renderValueShort(pref.get()));
        addSubmenuItems(last, pref);
        parent.add(last);
    }
    return last;
}
Also used : JMenu(javax.swing.JMenu) ChoicePref(edu.mit.csail.sdg.alloy4.A4Preferences.ChoicePref)

Aggregations

ChoicePref (edu.mit.csail.sdg.alloy4.A4Preferences.ChoicePref)1 JMenu (javax.swing.JMenu)1