aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPacien TRAN-GIRARD2014-03-19 18:46:15 +0100
committerPacien TRAN-GIRARD2014-03-19 18:46:15 +0100
commit11b3ee8d6ebd78c361fbcebd46c4c816b806ccdf (patch)
tree0d92642c5197edf0500f8445105918fd92403f57
parente6ac81c34218bf359e69fea4c30f7d715f738b93 (diff)
downloadesieequest-11b3ee8d6ebd78c361fbcebd46c4c816b806ccdf.tar.gz
Add key binding draft
-rw-r--r--src/esieequest/view/web/WebInterface.java19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/esieequest/view/web/WebInterface.java b/src/esieequest/view/web/WebInterface.java
index 221eea9..f1abe9d 100644
--- a/src/esieequest/view/web/WebInterface.java
+++ b/src/esieequest/view/web/WebInterface.java
@@ -6,8 +6,15 @@ import com.google.gwt.event.dom.client.ClickHandler;
6import com.google.gwt.event.dom.client.KeyCodes; 6import com.google.gwt.event.dom.client.KeyCodes;
7import com.google.gwt.event.dom.client.KeyDownEvent; 7import com.google.gwt.event.dom.client.KeyDownEvent;
8import com.google.gwt.event.dom.client.KeyDownHandler; 8import com.google.gwt.event.dom.client.KeyDownHandler;
9import com.google.gwt.event.dom.client.KeyPressEvent;
10import com.google.gwt.event.dom.client.KeyPressHandler;
11import com.google.gwt.event.dom.client.KeyUpEvent;
12import com.google.gwt.event.dom.client.KeyUpHandler;
9import com.google.gwt.uibinder.client.UiBinder; 13import com.google.gwt.uibinder.client.UiBinder;
10import com.google.gwt.uibinder.client.UiField; 14import com.google.gwt.uibinder.client.UiField;
15import com.google.gwt.user.client.Event;
16import com.google.gwt.user.client.Event.NativePreviewEvent;
17import com.google.gwt.user.client.Event.NativePreviewHandler;
11import com.google.gwt.user.client.ui.Button; 18import com.google.gwt.user.client.ui.Button;
12import com.google.gwt.user.client.ui.Composite; 19import com.google.gwt.user.client.ui.Composite;
13import com.google.gwt.user.client.ui.Frame; 20import com.google.gwt.user.client.ui.Frame;
@@ -77,6 +84,7 @@ class WebInterface extends Composite implements View {
77 public WebInterface() { 84 public WebInterface() {
78 this.initWidget(WebInterface.uiBinder.createAndBindUi(this)); 85 this.initWidget(WebInterface.uiBinder.createAndBindUi(this));
79 this.bindInputField(); 86 this.bindInputField();
87 this.bindKeys();
80 this.bindButtons(); 88 this.bindButtons();
81 } 89 }
82 90
@@ -126,6 +134,17 @@ class WebInterface extends Composite implements View {
126 } 134 }
127 135
128 /** 136 /**
137 * Binds keys
138 */
139 private void bindKeys() {
140 Event.addNativePreviewHandler(new NativePreviewHandler() {
141 public void onPreviewNativeEvent(NativePreviewEvent event) {
142 int key = event.getNativeEvent().getKeyCode();
143 }
144 });
145 }
146
147 /**
129 * Binds the buttons to send a defined command to the controller. 148 * Binds the buttons to send a defined command to the controller.
130 */ 149 */
131 private void bindButtons() { 150 private void bindButtons() {