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

Side by Side 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, 2 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 package autotest.afe;
2
3 import java.util.ArrayList;
4 import java.util.List;
5
6 public class CheckBoxPanel {
7 public static interface Display {
8 public ICheckBox generateCheckBox(int index);
9 }
10
11 private List<ICheckBox> checkBoxes = new ArrayList<ICheckBox>();
12 private Display display;
13
14 public void bindDisplay(Display display) {
15 this.display = display;
16 }
17
18 public ICheckBox generateCheckBox() {
19 return display.generateCheckBox(checkBoxes.size());
20 }
21
22 public void add(ICheckBox checkBox) {
23 checkBoxes.add(checkBox);
24 }
25
26 public List<ICheckBox> getChecked() {
27 List<ICheckBox> result = new ArrayList<ICheckBox>();
28 for(ICheckBox checkBox : checkBoxes) {
29 if (checkBox.getValue()) {
30 result.add(checkBox);
31 }
32 }
33 return result;
34 }
35
36 public void setEnabled(boolean enabled) {
37 for(ICheckBox thisBox : checkBoxes) {
38 thisBox.setEnabled(enabled);
39 }
40 }
41
42 public void reset() {
43 for (ICheckBox thisBox : checkBoxes) {
44 thisBox.setValue(false);
45 }
46 }
47 }
OLDNEW
« 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