use of com.google.gwt.uibinder.client.UiHandler in project che by eclipse.
the class FindActionViewImpl method handleKeyDown.
@UiHandler("nameField")
void handleKeyDown(KeyDownEvent event) {
switch(event.getNativeKeyCode()) {
case KeyCodes.KEY_UP:
event.stopPropagation();
event.preventDefault();
list.getSelectionModel().selectPrevious();
return;
case KeyCodes.KEY_DOWN:
event.stopPropagation();
event.preventDefault();
list.getSelectionModel().selectNext();
return;
case KeyCodes.KEY_PAGEUP:
event.stopPropagation();
event.preventDefault();
list.getSelectionModel().selectPreviousPage();
return;
case KeyCodes.KEY_PAGEDOWN:
event.stopPropagation();
event.preventDefault();
list.getSelectionModel().selectNextPage();
return;
case KeyCodes.KEY_ENTER:
event.stopPropagation();
event.preventDefault();
delegate.onActionSelected(list.getSelectionModel().getSelectedItem());
return;
case KeyCodes.KEY_ESCAPE:
event.stopPropagation();
event.preventDefault();
hide();
return;
}
Scheduler.get().scheduleDeferred(new Command() {
@Override
public void execute() {
delegate.nameChanged(nameField.getText(), includeNonMenu.getValue());
}
});
}
use of com.google.gwt.uibinder.client.UiHandler in project che by eclipse.
the class QuickOpenViewImpl method handleKeyDown.
@UiHandler("nameField")
void handleKeyDown(KeyDownEvent event) {
switch(event.getNativeKeyCode()) {
case KeyCodes.KEY_UP:
event.stopPropagation();
event.preventDefault();
list.getSelectionModel().selectPrevious();
run(list.getSelectionModel().getSelectedItem(), false);
return;
case KeyCodes.KEY_DOWN:
event.stopPropagation();
event.preventDefault();
list.getSelectionModel().selectNext();
run(list.getSelectionModel().getSelectedItem(), false);
return;
case KeyCodes.KEY_PAGEUP:
event.stopPropagation();
event.preventDefault();
list.getSelectionModel().selectPreviousPage();
run(list.getSelectionModel().getSelectedItem(), false);
return;
case KeyCodes.KEY_PAGEDOWN:
event.stopPropagation();
event.preventDefault();
list.getSelectionModel().selectNextPage();
run(list.getSelectionModel().getSelectedItem(), false);
return;
case KeyCodes.KEY_ENTER:
event.stopPropagation();
event.preventDefault();
run(list.getSelectionModel().getSelectedItem(), true);
return;
case KeyCodes.KEY_ESCAPE:
event.stopPropagation();
event.preventDefault();
hide(true);
return;
}
Scheduler.get().scheduleDeferred(new Command() {
@Override
public void execute() {
delegate.valueChanged(nameField.getText());
}
});
}
use of com.google.gwt.uibinder.client.UiHandler in project jhybrid by Sfeir.
the class Calc method clicButton.
@UiHandler("button")
void clicButton(ClickEvent event) {
CalcEngineImpl calcEngine = new CalcEngineImpl();
String expr = text.getText();
int result = calcEngine.evaluate(expr);
label.setText("" + result);
}
use of com.google.gwt.uibinder.client.UiHandler in project platformlayer by platformlayer.
the class SplashPanelImpl method onGoButtonClick.
@UiHandler("goButton")
public void onGoButtonClick(ClickEvent e) {
HomePlace root = new HomePlace(parent);
app.goTo(root);
}
use of com.google.gwt.uibinder.client.UiHandler in project gwt-test-utils by gwt-test-utils.
the class UiBinderInvocationHandler method addHandlers.
@SuppressWarnings("unchecked")
private <H extends EventHandler> void addHandlers(Object owner) {
Map<Method, UiHandler> uiHandlerMethods = GwtReflectionUtils.getAnnotatedMethod(owner.getClass(), UiHandler.class);
for (Map.Entry<Method, UiHandler> entry : uiHandlerMethods.entrySet()) {
for (String uiFieldName : entry.getValue().value()) {
Widget uiField = GwtReflectionUtils.getPrivateFieldValue(owner, uiFieldName);
GwtEvent.Type<H> eventType = (GwtEvent.Type<H>) getEventType(entry.getKey());
H handler = (H) createHandler(uiField, entry.getKey(), owner);
if (eventType instanceof DomEvent.Type) {
uiField.addDomHandler(handler, (DomEvent.Type<H>) eventType);
} else {
if (uiField instanceof HasValueChangeHandlers && handler instanceof ValueChangeHandler) {
((HasValueChangeHandlers<Object>) uiField).addValueChangeHandler((ValueChangeHandler<Object>) handler);
} else {
uiField.addHandler(handler, eventType);
}
}
}
}
}
Aggregations