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;
}
Aggregations