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

Side by Side Diff: frontend/client/src/autotest/planner/TestPlanSelector.java

Issue 1595019: Merge remote branch 'origin/upstream' into tempbranch (Closed)
Patch Set: Created 10 years, 8 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
OLDNEW
(Empty)
1 package autotest.planner;
2
3 import com.google.gwt.event.dom.client.ClickEvent;
4 import com.google.gwt.event.dom.client.ClickHandler;
5 import com.google.gwt.event.dom.client.HasClickHandlers;
6 import com.google.gwt.event.dom.client.HasKeyPressHandlers;
7 import com.google.gwt.event.dom.client.KeyCodes;
8 import com.google.gwt.event.dom.client.KeyPressEvent;
9 import com.google.gwt.event.dom.client.KeyPressHandler;
10 import com.google.gwt.user.client.ui.HasText;
11
12 public class TestPlanSelector implements ClickHandler, KeyPressHandler {
13
14 public static interface Display {
15 public HasText getInputText();
16 public HasClickHandlers getShowButton();
17 public HasKeyPressHandlers getInputField();
18 }
19
20
21 private Display display;
22 private String selectedPlan;
23
24 public void bindDisplay(Display display) {
25 this.display = display;
26 display.getShowButton().addClickHandler(this);
27 display.getInputField().addKeyPressHandler(this);
28 }
29
30 @Override
31 public void onClick(ClickEvent event) {
32 selectPlan();
33 }
34
35 @Override
36 public void onKeyPress(KeyPressEvent event) {
37 if (event.getCharCode() == KeyCodes.KEY_ENTER) {
38 selectPlan();
39 }
40 }
41
42 private void selectPlan() {
43 selectedPlan = display.getInputText().getText();
44 }
45
46 public String getSelectedPlan() {
47 return selectedPlan;
48 }
49 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698