Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(818)

Unified Diff: frontend/client/src/autotest/afe/CheckBoxPanel.java

Issue 3554003: Merge remote branch 'cros/upstream' into tempbranch3 (Closed) Base URL: http://git.chromium.org/git/autotest.git
Patch Set: Created 10 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);
+ }
+ }
+}
« no previous file with comments | « frontend/client/src/autotest/afe/AfeUtils.java ('k') | frontend/client/src/autotest/afe/CheckBoxPanelDisplay.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698