?? checkboxgroup.java
字號(hào):
package com.jmobilecore.ui.core;
/**
* The <code>CheckboxGroup</code> class is used to group together
* a set of <code>Checkbox</code> buttons.
* Exactly one check box button in a <code>CheckboxGroup</code> can
* be in the "on" state at any given time. Pushing any
* button sets its state to "on" and forces any other button that
* is in the "on" state into the "off" state.
*
* @author Greg Gridin
* @see com.jmobilecore.ui.core.Checkbox
*/
public class CheckboxGroup {
/**
* The current choice.
*/
public Checkbox selectedCheckbox = null;
/**
* Sets the currently selected check box in this group
* to be the specified check box.
* This method sets the state of that check box to "on" and
* sets all other check boxes in the group to be off.
* <p/>
* If the check box argument is <tt>null</tt>, all check boxes
* in this check box group are deselected. If the check box argument
* belongs to a different check box group, this method does
* nothing.
*
* @param box the <code>Checkbox</code> to set as the
* current selection.
* @see com.jmobilecore.ui.core.Checkbox
* @see com.jmobilecore.ui.core.CheckboxGroup#setSelectedCheckbox
*/
public void setSelectedCheckbox(Checkbox box) {
if (box != null && box.group != this) {
return;
}
Checkbox oldChoice = this.selectedCheckbox;
this.selectedCheckbox = box;
if (oldChoice != null && oldChoice != box && oldChoice.group == this) {
oldChoice.state = false;
}
if (box != null && oldChoice != box && !box.state) {
box.state = true;
}
}
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -