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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: frontend/client/src/autotest/planner/TestPlanSelector.java
diff --git a/frontend/client/src/autotest/planner/TestPlanSelector.java b/frontend/client/src/autotest/planner/TestPlanSelector.java
new file mode 100644
index 0000000000000000000000000000000000000000..6eabc5e60dd81fe993207a0414bcc20bb810997a
--- /dev/null
+++ b/frontend/client/src/autotest/planner/TestPlanSelector.java
@@ -0,0 +1,49 @@
+package autotest.planner;
+
+import com.google.gwt.event.dom.client.ClickEvent;
+import com.google.gwt.event.dom.client.ClickHandler;
+import com.google.gwt.event.dom.client.HasClickHandlers;
+import com.google.gwt.event.dom.client.HasKeyPressHandlers;
+import com.google.gwt.event.dom.client.KeyCodes;
+import com.google.gwt.event.dom.client.KeyPressEvent;
+import com.google.gwt.event.dom.client.KeyPressHandler;
+import com.google.gwt.user.client.ui.HasText;
+
+public class TestPlanSelector implements ClickHandler, KeyPressHandler {
+
+ public static interface Display {
+ public HasText getInputText();
+ public HasClickHandlers getShowButton();
+ public HasKeyPressHandlers getInputField();
+ }
+
+
+ private Display display;
+ private String selectedPlan;
+
+ public void bindDisplay(Display display) {
+ this.display = display;
+ display.getShowButton().addClickHandler(this);
+ display.getInputField().addKeyPressHandler(this);
+ }
+
+ @Override
+ public void onClick(ClickEvent event) {
+ selectPlan();
+ }
+
+ @Override
+ public void onKeyPress(KeyPressEvent event) {
+ if (event.getCharCode() == KeyCodes.KEY_ENTER) {
+ selectPlan();
+ }
+ }
+
+ private void selectPlan() {
+ selectedPlan = display.getInputText().getText();
+ }
+
+ public String getSelectedPlan() {
+ return selectedPlan;
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698