| Index: frontend/client/src/autotest/afe/CheckBoxPanel.java
|
| diff --git a/frontend/client/src/autotest/afe/CheckBoxPanel.java b/frontend/client/src/autotest/afe/CheckBoxPanel.java
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..83776e475f434fbabc9b14cb15f7e4ff35cae7f2
|
| --- /dev/null
|
| +++ b/frontend/client/src/autotest/afe/CheckBoxPanel.java
|
| @@ -0,0 +1,47 @@
|
| +package autotest.afe;
|
| +
|
| +import java.util.ArrayList;
|
| +import java.util.List;
|
| +
|
| +public class CheckBoxPanel {
|
| + public static interface Display {
|
| + public ICheckBox generateCheckBox(int index);
|
| + }
|
| +
|
| + private List<ICheckBox> checkBoxes = new ArrayList<ICheckBox>();
|
| + private Display display;
|
| +
|
| + public void bindDisplay(Display display) {
|
| + this.display = display;
|
| + }
|
| +
|
| + public ICheckBox generateCheckBox() {
|
| + return display.generateCheckBox(checkBoxes.size());
|
| + }
|
| +
|
| + public void add(ICheckBox checkBox) {
|
| + checkBoxes.add(checkBox);
|
| + }
|
| +
|
| + public List<ICheckBox> getChecked() {
|
| + List<ICheckBox> result = new ArrayList<ICheckBox>();
|
| + for(ICheckBox checkBox : checkBoxes) {
|
| + if (checkBox.getValue()) {
|
| + result.add(checkBox);
|
| + }
|
| + }
|
| + return result;
|
| + }
|
| +
|
| + public void setEnabled(boolean enabled) {
|
| + for(ICheckBox thisBox : checkBoxes) {
|
| + thisBox.setEnabled(enabled);
|
| + }
|
| + }
|
| +
|
| + public void reset() {
|
| + for (ICheckBox thisBox : checkBoxes) {
|
| + thisBox.setValue(false);
|
| + }
|
| + }
|
| +}
|
|
|