MCPcopy Create free account
hub / github.com/akeranen/the-one / createCheckItem

Method createCheckItem

gui/SimMenuBar.java:153–168  ·  view source on GitHub ↗

Creates a new check box menu item to the given container @param c The container @param txt Text for the menu item @param selected Is the check box selected (by default) @param setting Name of the setting where the check-box-selected true/false value is read from (if not found, the "selected" paramet

(Container c,String txt, 
			boolean selected, String setting)

Source from the content-addressed store, hash-verified

151 * @return The created check box menu item
152 */
153 private JCheckBoxMenuItem createCheckItem(Container c,String txt,
154 boolean selected, String setting) {
155 Settings s = new Settings(gui.MainWindow.GUI_NS);
156
157 JCheckBoxMenuItem i = new JCheckBoxMenuItem(txt);
158 if (setting == null) {
159 i.setSelected(selected);
160 } else {
161 i.setSelected(s.getBoolean(setting, selected));
162 }
163
164 i.addActionListener(this);
165 c.add(i);
166
167 return i;
168 }
169
170
171 private void updatePlayfieldSettings() {

Callers 1

initMethod · 0.95

Calls 2

getBooleanMethod · 0.95
addMethod · 0.80

Tested by

no test coverage detected