use of com.google.gwtexpui.globalkey.client.KeyCommand in project gerrit by GerritCodeReview.
the class SideBySide method registerKeys.
@Override
public void registerKeys() {
super.registerKeys();
getKeysNavigation().add(new NoOpKeyCommand(KeyCommand.M_SHIFT, KeyCodes.KEY_LEFT, PatchUtil.C.focusSideA()), new NoOpKeyCommand(KeyCommand.M_SHIFT, KeyCodes.KEY_RIGHT, PatchUtil.C.focusSideB()));
getKeysAction().add(new KeyCommand(KeyCommand.M_SHIFT, 'a', PatchUtil.C.toggleSideA()) {
@Override
public void onKeyPress(KeyPressEvent event) {
diffTable.toggleA().run();
}
});
registerHandlers();
}
use of com.google.gwtexpui.globalkey.client.KeyCommand in project gerrit by GerritCodeReview.
the class JumpKeys method register.
static void register(final Widget body) {
final KeyCommandSet jumps = new KeyCommandSet();
jumps.add(new KeyCommand(0, 'o', Gerrit.C.jumpAllOpen()) {
@Override
public void onKeyPress(final KeyPressEvent event) {
Gerrit.display(PageLinks.toChangeQuery("status:open"));
}
});
jumps.add(new KeyCommand(0, 'm', Gerrit.C.jumpAllMerged()) {
@Override
public void onKeyPress(final KeyPressEvent event) {
Gerrit.display(PageLinks.toChangeQuery("status:merged"));
}
});
jumps.add(new KeyCommand(0, 'a', Gerrit.C.jumpAllAbandoned()) {
@Override
public void onKeyPress(final KeyPressEvent event) {
Gerrit.display(PageLinks.toChangeQuery("status:abandoned"));
}
});
if (Gerrit.isSignedIn()) {
jumps.add(new KeyCommand(0, 'i', Gerrit.C.jumpMine()) {
@Override
public void onKeyPress(final KeyPressEvent event) {
Gerrit.display(PageLinks.MINE);
}
});
jumps.add(new KeyCommand(0, 'd', Gerrit.C.jumpMineDrafts()) {
@Override
public void onKeyPress(final KeyPressEvent event) {
Gerrit.display(PageLinks.toChangeQuery("owner:self is:draft"));
}
});
jumps.add(new KeyCommand(0, 'c', Gerrit.C.jumpMineDraftComments()) {
@Override
public void onKeyPress(final KeyPressEvent event) {
Gerrit.display(PageLinks.toChangeQuery("has:draft"));
}
});
jumps.add(new KeyCommand(0, 'w', Gerrit.C.jumpMineWatched()) {
@Override
public void onKeyPress(final KeyPressEvent event) {
Gerrit.display(PageLinks.toChangeQuery("is:watched status:open"));
}
});
jumps.add(new KeyCommand(0, 's', Gerrit.C.jumpMineStarred()) {
@Override
public void onKeyPress(final KeyPressEvent event) {
Gerrit.display(PageLinks.toChangeQuery("is:starred"));
}
});
}
keys = new KeyCommandSet(Gerrit.C.sectionJumping());
keys.add(new CompoundKeyCommand(0, 'g', "", jumps));
bodyWidget = body;
activeHandler = GlobalKey.add(body, keys);
}
use of com.google.gwtexpui.globalkey.client.KeyCommand in project gerrit by GerritCodeReview.
the class AccountDashboardScreen method onInitUI.
@Override
protected void onInitUI() {
super.onInitUI();
table = new ChangeTable() {
{
keysNavigation.add(new KeyCommand(0, 'R', Util.C.keyReloadSearch()) {
@Override
public void onKeyPress(final KeyPressEvent event) {
Gerrit.display(getToken());
}
});
}
};
table.addStyleName(Gerrit.RESOURCES.css().accountDashboard());
outgoing = new ChangeTable.Section();
incoming = new ChangeTable.Section();
closed = new ChangeTable.Section();
String who = mine ? "self" : ownerId.toString();
outgoing.setTitleWidget(new InlineHyperlink(Util.C.outgoingReviews(), PageLinks.toChangeQuery(queryOutgoing(who))));
incoming.setTitleWidget(new InlineHyperlink(Util.C.incomingReviews(), PageLinks.toChangeQuery(queryIncoming(who))));
incoming.setHighlightUnreviewed(mine);
closed.setTitleWidget(new InlineHyperlink(Util.C.recentlyClosed(), PageLinks.toChangeQuery(queryClosed(who))));
table.addSection(outgoing);
table.addSection(incoming);
table.addSection(closed);
add(table);
table.setSavePointerId("owner:" + ownerId);
}
Aggregations