* Initializes the shortcut manager with our shortcuts of interest. The
* {@link ComponentHost} will handle actually notifying us of shortcuts being
* used.
*/
private void setupShortcuts() {
shortcutManager.addShortcut(0, KeyCode.ENTER, new ShortcutPressedCallback() {
@Override
public void onShortcutPressed(KeyboardEvent event) {
event.preventDefault();
if (searchModel != null) {
searchModel.getMatchManager().selectNextMatch();
}
}
});
shortcutManager.addShortcut(ModifierKeys.SHIFT, KeyCode.ENTER, new ShortcutPressedCallback() {
@Override
public void onShortcutPressed(KeyboardEvent event) {
event.preventDefault();
if (searchModel != null) {
searchModel.getMatchManager().selectPreviousMatch();
}
}
});
shortcutManager.addShortcut(ModifierKeys.ACTION, KeyCode.G, new ShortcutPressedCallback() {
@Override
public void onShortcutPressed(KeyboardEvent event) {
event.preventDefault();
if (focusManager != null) {
focusManager.focus();
}
}
});
shortcutManager.addShortcut(
ModifierKeys.ACTION | ModifierKeys.SHIFT, KeyCode.G, new ShortcutPressedCallback() {
@Override
public void onShortcutPressed(KeyboardEvent event) {
event.preventDefault();
searchModel.getMatchManager().selectPreviousMatch();