use of com.google.gwt.uibinder.client.UiHandler in project gerrit by GerritCodeReview.
the class EditPreferencesBox method onKeyMap.
@UiHandler("keyMap")
void onKeyMap(@SuppressWarnings("unused") ChangeEvent e) {
KeyMapType keyMapType = KeyMapType.valueOf(keyMap.getValue(keyMap.getSelectedIndex()));
prefs.keyMapType(keyMapType);
if (view != null) {
view.setOption("keyMap", keyMapType.name().toLowerCase());
}
}
use of com.google.gwt.uibinder.client.UiHandler in project gerrit by GerritCodeReview.
the class EditPreferencesBox method onTheme.
@UiHandler("theme")
void onTheme(@SuppressWarnings("unused") ChangeEvent e) {
final Theme newTheme = Theme.valueOf(theme.getValue(theme.getSelectedIndex()));
prefs.theme(newTheme);
if (view != null) {
ThemeLoader.loadTheme(newTheme, new GerritCallback<Void>() {
@Override
public void onSuccess(Void result) {
view.setTheme(newTheme);
}
});
}
}
use of com.google.gwt.uibinder.client.UiHandler in project gerrit by GerritCodeReview.
the class DraftBox method onDiscard.
@UiHandler({ "discard1", "discard2" })
void onDiscard(ClickEvent e) {
e.stopPropagation();
if (isNew()) {
removeUI();
restoreSelection();
} else {
setEdit(false);
pendingGroup = new CallbackGroup();
CommentApi.deleteDraft(psId, comment.id(), pendingGroup.addFinal(new GerritCallback<JavaScriptObject>() {
@Override
public void onSuccess(JavaScriptObject result) {
pendingGroup = null;
removeUI();
}
}));
}
}
use of com.google.gwt.uibinder.client.UiHandler in project gerrit by GerritCodeReview.
the class DraftBox method onKeyDown.
@UiHandler("editArea")
void onKeyDown(KeyDownEvent e) {
resizeTimer.cancel();
if ((e.isControlKeyDown() || e.isMetaKeyDown()) && !e.isAltKeyDown() && !e.isShiftKeyDown()) {
switch(e.getNativeKeyCode()) {
case 's':
case 'S':
e.preventDefault();
CallbackGroup group = new CallbackGroup();
save(group);
group.done();
return;
}
} else if (e.getNativeKeyCode() == KeyCodes.KEY_ESCAPE && !isDirty()) {
if (isNew()) {
removeUI();
restoreSelection();
return;
}
setEdit(false);
if (autoClosed) {
setOpen(false);
}
getCm().focus();
return;
}
expandTimer.schedule(250);
}
use of com.google.gwt.uibinder.client.UiHandler in project GwtMobile by dennisjzh.
the class CheckBoxPage method onGroup2SelectionChanged.
@UiHandler("group2")
void onGroup2SelectionChanged(SelectionChangedEvent e) {
CheckBox radio = (CheckBox) group2.getWidget(e.getSelection());
Utils.Console("group2 " + e.getSelection() + " " + radio.getText());
}
Aggregations