diff options
author | Pacien TRAN-GIRARD | 2014-03-19 18:46:15 +0100 |
---|---|---|
committer | Pacien TRAN-GIRARD | 2014-03-19 18:46:15 +0100 |
commit | 11b3ee8d6ebd78c361fbcebd46c4c816b806ccdf (patch) | |
tree | 0d92642c5197edf0500f8445105918fd92403f57 | |
parent | e6ac81c34218bf359e69fea4c30f7d715f738b93 (diff) | |
download | esieequest-11b3ee8d6ebd78c361fbcebd46c4c816b806ccdf.tar.gz |
Add key binding draft
-rw-r--r-- | src/esieequest/view/web/WebInterface.java | 19 |
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; | |||
6 | import com.google.gwt.event.dom.client.KeyCodes; | 6 | import com.google.gwt.event.dom.client.KeyCodes; |
7 | import com.google.gwt.event.dom.client.KeyDownEvent; | 7 | import com.google.gwt.event.dom.client.KeyDownEvent; |
8 | import com.google.gwt.event.dom.client.KeyDownHandler; | 8 | import com.google.gwt.event.dom.client.KeyDownHandler; |
9 | import com.google.gwt.event.dom.client.KeyPressEvent; | ||
10 | import com.google.gwt.event.dom.client.KeyPressHandler; | ||
11 | import com.google.gwt.event.dom.client.KeyUpEvent; | ||
12 | import com.google.gwt.event.dom.client.KeyUpHandler; | ||
9 | import com.google.gwt.uibinder.client.UiBinder; | 13 | import com.google.gwt.uibinder.client.UiBinder; |
10 | import com.google.gwt.uibinder.client.UiField; | 14 | import com.google.gwt.uibinder.client.UiField; |
15 | import com.google.gwt.user.client.Event; | ||
16 | import com.google.gwt.user.client.Event.NativePreviewEvent; | ||
17 | import com.google.gwt.user.client.Event.NativePreviewHandler; | ||
11 | import com.google.gwt.user.client.ui.Button; | 18 | import com.google.gwt.user.client.ui.Button; |
12 | import com.google.gwt.user.client.ui.Composite; | 19 | import com.google.gwt.user.client.ui.Composite; |
13 | import com.google.gwt.user.client.ui.Frame; | 20 | import 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() { |