/bundles/plugins-trunk/Console/console/bsh/commandoCHOICE.bsh
# · Unknown · 26 lines · 23 code · 3 blank · 0 comment · 0 complexity · 98e2903307441073b73610605841a6d9 MD5 · raw file
- commandoCHOICE(view,pane,ns,label,var,options)
- {
- choice = new JComboBox(options);
- value = ns.getVariable(var);
- if(value != null)
- {
- for(int i = 0; i < options.size(); i++)
- {
- opt = options.elementAt(i);
- if(value.equals(opt.value))
- {
- choice.setSelectedIndex(i);
- break;
- }
- }
- }
- valueChanged()
- {
- ns.setVariable(var,choice.getSelectedItem().value);
- }
- pane.addComponent(label,choice);
- return this;
- }