PageRenderTime 43ms CodeModel.GetById 40ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/bundles/plugins-trunk/Console/console/bsh/commandoTOGGLE.bsh

#
Unknown | 21 lines | 18 code | 3 blank | 0 comment | 0 complexity | d36f7e0101033e184a1d394b3f707f15 MD5 | raw file
 1commandoTOGGLE(view,pane,ns,label,var,options)
 2{
 3	toggle = new JCheckBox(label);
 4	value = ns.getVariable(var);
 5	if("true".equals(value))
 6	{
 7		toggle.setSelected(true);
 8		ns.setVariable(var,true);
 9	}
10	else if("false".equals(value))
11		ns.setVariable(var,false);
12
13	valueChanged()
14	{
15		ns.setVariable(var,toggle.isSelected());
16	}
17
18	pane.addComponent(toggle);
19
20	return this;
21}