本文整理汇总了Java中com.google.gwt.event.dom.client.KeyCodes.KEY_PAGEDOWN属性的典型用法代码示例。如果您正苦于以下问题:Java KeyCodes.KEY_PAGEDOWN属性的具体用法?Java KeyCodes.KEY_PAGEDOWN怎么用?Java KeyCodes.KEY_PAGEDOWN使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.google.gwt.event.dom.client.KeyCodes
的用法示例。
在下文中一共展示了KeyCodes.KEY_PAGEDOWN属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: shouldTrackCursor
@Override
public boolean shouldTrackCursor() {
if (isMouseButtonEvent()) {
return true;
}
if (isKeyEvent()) {
KeySignalType keySignalType = getKeySignalType();
// The cursor location should move if the user either has modified the
// content (typed or delete), or move the cursor deliberately. However, page up/down
// doesn't actually move the cursor, so we don't want to move the view port
int keyCode = getKeyCode();
return keySignalType == KeySignalType.INPUT ||
keySignalType == KeySignalType.DELETE ||
keySignalType == KeySignalType.NAVIGATION && (
keyCode != KeyCodes.KEY_PAGEDOWN &&
keyCode != KeyCodes.KEY_PAGEUP);
}
return false;
}
示例2: onKeyUp
/**
* Triggered when a key was depressed.
*
* @param event
* The KeyUpEvent of the key depressed
*/
@Override
public void onKeyUp(KeyUpEvent event) {
debug("VComboBoxMultiselect: onKeyUp(" + event.getNativeKeyCode() + ")");
if (this.enabled && !this.readonly) {
switch (event.getNativeKeyCode()) {
case KeyCodes.KEY_ENTER:
case KeyCodes.KEY_TAB:
case KeyCodes.KEY_SHIFT:
case KeyCodes.KEY_CTRL:
case KeyCodes.KEY_ALT:
case KeyCodes.KEY_DOWN:
case KeyCodes.KEY_UP:
case KeyCodes.KEY_PAGEDOWN:
case KeyCodes.KEY_PAGEUP:
case KeyCodes.KEY_ESCAPE:
// NOP
break;
default:
if (this.textInputEnabled) {
// when filtering, we always want to see the results on the
// first page first.
filterOptions(0);
}
break;
}
}
}
示例3: createKeyHandler
private KeyUpHandler createKeyHandler() {
KeyUpHandler handler= new KeyUpHandler() {
@Override
public void onKeyUp(final KeyUpEvent event) {
if (KeyCodes.KEY_PAGEDOWN == event.getNativeEvent().getKeyCode()) {
onRelease();
}
}
};
return handler;
}
示例4: inputFieldKeyDown
/**
* Triggered when a key is pressed in the text box
*
* @param event
* The KeyDownEvent
*/
private void inputFieldKeyDown(KeyDownEvent event) {
debug("VComboBoxMultiselect: inputFieldKeyDown(" + event.getNativeKeyCode() + ")");
switch (event.getNativeKeyCode()) {
case KeyCodes.KEY_DOWN:
case KeyCodes.KEY_UP:
case KeyCodes.KEY_PAGEDOWN:
case KeyCodes.KEY_PAGEUP:
// open popup as from gadget
filterOptions(-1, "");
this.tb.selectAll();
this.dataReceivedHandler.popupOpenerClicked();
break;
case KeyCodes.KEY_ENTER:
/*
* This only handles the case when new items is allowed, a text is
* entered, the popup opener button is clicked to close the popup
* and enter is then pressed (see #7560).
*/
if (!this.allowNewItems) {
return;
}
if (this.currentSuggestion != null && this.tb.getText()
.equals(this.currentSuggestion.getReplacementString())) {
// Retain behavior from #6686 by returning without stopping
// propagation if there's nothing to do
return;
}
this.dataReceivedHandler.reactOnInputWhenReady(this.tb.getText());
event.stopPropagation();
break;
}
}
示例5: isNavigationKey
public static boolean isNavigationKey(int keyCode) {
if (isArrowKey(keyCode) || KeyCodes.KEY_HOME == keyCode || KeyCodes.KEY_END == keyCode ||
KeyCodes.KEY_PAGEUP == keyCode || KeyCodes.KEY_PAGEDOWN == keyCode) {
return true;
} else {
return false;
}
}
示例6: onKeyUp
@Override
public void onKeyUp(KeyUpEvent event) {
if (enabled && !readonly) {
switch (event.getNativeKeyCode()) {
case KeyCodes.KEY_ENTER:
String tbText = tb.getText() == null ? "" : tb.getText();
String currentText = currentSuggestion == null ? "" : currentSuggestion.getReplacementString();
if (!this.preventFilterAfterSelect && !tbText.equals(currentText))
filterOptions(currentPage);
else {
if (!event.isAnyModifierKeyDown())
event.stopPropagation();
}
this.preventFilterAfterSelect = false;
break;
case KeyCodes.KEY_TAB:
case KeyCodes.KEY_SHIFT:
case KeyCodes.KEY_CTRL:
case KeyCodes.KEY_ALT:
case KeyCodes.KEY_DOWN:
case KeyCodes.KEY_UP:
case KeyCodes.KEY_PAGEDOWN:
case KeyCodes.KEY_PAGEUP:
// NOP
break;
case KeyCodes.KEY_ESCAPE:
reset();
break;
}
updateEditState();
}
}
示例7: onKeyUp
@Override
public void onKeyUp(KeyUpEvent event) {
if (enabled && !readonly) {
switch (event.getNativeKeyCode()) {
case KeyCodes.KEY_ENTER:
case KeyCodes.KEY_TAB:
case KeyCodes.KEY_SHIFT:
case KeyCodes.KEY_CTRL:
case KeyCodes.KEY_ALT:
case KeyCodes.KEY_DOWN:
case KeyCodes.KEY_UP:
case KeyCodes.KEY_PAGEDOWN:
case KeyCodes.KEY_PAGEUP:
case KeyCodes.KEY_ESCAPE:
// NOP
break;
default:
// special case for "clear" shortcut action
if (event.isShiftKeyDown() && event.getNativeKeyCode() == KeyCodes.KEY_DELETE) {
suggestionPopup.hide();
} else {
// do not show options popup if we handle shortcut action
if (!event.isControlKeyDown()
&& !event.isAltKeyDown()) {
super.onKeyUp(event);
}
}
break;
}
}
}
示例8: keyToString
private static String keyToString(int code) {
switch (code) {
case KeyCodes.KEY_SPACE:
return "Space";
case KeyCodes.KEY_BACKSPACE:
return "Backspace";
case KeyCodes.KEY_DELETE:
return "Del";
case KeyCodes.KEY_INSERT:
return "Insert";
case KeyCodes.KEY_ENTER:
return "Enter";
case KeyCodes.KEY_ESCAPE:
return "Esc";
case KeyCodes.KEY_TAB:
return "Tab";
case KeyCodes.KEY_HOME:
return "Home";
case KeyCodes.KEY_END:
return "End";
case KeyCodes.KEY_PAGEUP:
return "PageUp";
case KeyCodes.KEY_PAGEDOWN:
return "PageDown";
case KeyCodes.KEY_LEFT:
return "\u2190";
case KeyCodes.KEY_UP:
return "\u2191";
case KeyCodes.KEY_RIGHT:
return "\u2192";
case KeyCodes.KEY_DOWN:
return "\u2193";
default:
return new Character((char) code).toString();
}
}
示例9: onKeyDown
public void onKeyDown(KeyDownEvent event) {
ChartState chartInfo = getChartState(event);
Chart chart = chartInfo.chart;
boolean handled = true;
int keyCode = event.getNativeKeyCode();
// all checks (except TAB) are to prevent focus stealing by the browser.
if (keyCode == KeyCodes.KEY_PAGEUP) {
} else if (keyCode == KeyCodes.KEY_PAGEDOWN) {
} else if (keyCode == KeyCodes.KEY_UP) {
if (UP_NUM < KEY_DOWN_MAX) {
if (UP_NUM != 0) {
chart.nextZoom();
}
UP_NUM++;
}
} else if (keyCode == KeyCodes.KEY_DOWN) {
if (DOWN_NUM < KEY_DOWN_MAX) {
if (DOWN_NUM != 0) {
chart.prevZoom();
}
DOWN_NUM++;
}
} else if (keyCode == KeyCodes.KEY_TAB) {
handled = handleTabKey((Event) event.getNativeEvent(), chartInfo, keyCode,
event.isShiftKeyDown());
} else {
handled = false;
}
chartInfo.setHandled(handled);
if (handled) {
event.stopPropagation();
event.preventDefault();
}
}
示例10: popupKeyDown
/**
* Triggered when a key was pressed in the suggestion popup.
*
* @param event
* The KeyDownEvent of the key
*/
private void popupKeyDown(KeyDownEvent event) {
debug("VComboBoxMultiselect: popupKeyDown(" + event.getNativeKeyCode() + ")");
// Propagation of handled events is stopped so other handlers such as
// shortcut key handlers do not also handle the same events.
switch (event.getNativeKeyCode()) {
case KeyCodes.KEY_DOWN:
this.suggestionPopup.selectNextItem();
DOM.eventPreventDefault(DOM.eventGetCurrentEvent());
event.stopPropagation();
break;
case KeyCodes.KEY_UP:
this.suggestionPopup.selectPrevItem();
DOM.eventPreventDefault(DOM.eventGetCurrentEvent());
event.stopPropagation();
break;
case KeyCodes.KEY_PAGEDOWN:
selectNextPage();
event.stopPropagation();
break;
case KeyCodes.KEY_PAGEUP:
selectPrevPage();
event.stopPropagation();
break;
case KeyCodes.KEY_ESCAPE:
reset();
DOM.eventPreventDefault(DOM.eventGetCurrentEvent());
event.stopPropagation();
break;
case KeyCodes.KEY_TAB:
case KeyCodes.KEY_ENTER:
// queue this, may be cancelled by selection
int selectedIndex = this.suggestionPopup.menu.getSelectedIndex();
if (!this.allowNewItems && selectedIndex != -1) {
debug("index before: " + selectedIndex);
if (this.showClearButton) {
selectedIndex = selectedIndex - 1;
}
if (this.showSelectAllButton) {
selectedIndex = selectedIndex - 1;
}
debug("index after: " + selectedIndex);
if (selectedIndex == -2) {
this.clearCmd.execute();
} else if (selectedIndex == -1) {
if (this.showSelectAllButton) {
this.selectAllCmd.execute();
} else {
this.clearCmd.execute();
}
}
debug("entered suggestion: " + this.currentSuggestions.get(selectedIndex).caption);
onSuggestionSelected(this.currentSuggestions.get(selectedIndex));
} else {
this.dataReceivedHandler.reactOnInputWhenReady(this.tb.getText());
}
event.stopPropagation();
break;
}
}
示例11: isUpDownArrowKey
public static boolean isUpDownArrowKey(int keycode) {
if(keycode == KeyCodes.KEY_UP || keycode == KeyCodes.KEY_DOWN || keycode == KeyCodes.KEY_PAGEUP || keycode == KeyCodes.KEY_PAGEDOWN) {
return true;
}
return false;
}
示例12: popupKeyDown
@Override
protected void popupKeyDown(KeyDownEvent event) {
// Propagation of handled events is stopped so other handlers such as
// shortcut key handlers do not also handle the same events.
switch (event.getNativeKeyCode()) {
case KeyCodes.KEY_DOWN:
keyboardNavigation = true;
suggestionPopup.selectNextItem();
suggestionPopup.menu.selectItem(suggestionPopup.menu
.getSelectedItem());
DOM.eventGetCurrentEvent().preventDefault();
event.stopPropagation();
break;
case KeyCodes.KEY_UP:
keyboardNavigation = true;
suggestionPopup.selectPrevItem();
suggestionPopup.menu.selectItem(suggestionPopup.menu
.getSelectedItem());
DOM.eventGetCurrentEvent().preventDefault();
event.stopPropagation();
break;
case KeyCodes.KEY_PAGEDOWN:
keyboardNavigation = false;
if (hasNextPage()) {
filterOptions(currentPage + 1, lastFilter);
}
event.stopPropagation();
break;
case KeyCodes.KEY_PAGEUP:
keyboardNavigation = false;
if (currentPage > 0) {
filterOptions(currentPage - 1, lastFilter);
}
event.stopPropagation();
break;
case KeyCodes.KEY_ESCAPE:
keyboardNavigation = false;
reset();
event.stopPropagation();
break;
case KeyCodes.KEY_TAB:
case KeyCodes.KEY_ENTER:
int selectedIndex = suggestionPopup.menu.getSelectedIndex();
currentSuggestion = currentSuggestions.get(selectedIndex);
if (currentSuggestion != null &&
currentSuggestion.getReplacementString().equals(tb.getText())) {
this.preventFilterAfterSelect = true;
onSuggestionSelected(currentSuggestion);
}
keyboardNavigation = false;
event.stopPropagation();
break;
}
}
示例13: isPageDown
private static boolean isPageDown(int keyCode) {
return keyCode == KeyCodes.KEY_PAGEDOWN
|| keyCode == SafariKeyboardConstants.SAFARI_PDWN;
}
示例14: handleEvent
@Override
public void handleEvent(Event evt) {
if (Event.KEYDOWN.equalsIgnoreCase(evt.getType())) {
final KeyboardEvent keyEvent = (KeyboardEvent) evt;
switch (keyEvent.getKeyCode()) {
case KeyCodes.KEY_ESCAPE:
Scheduler.get().scheduleDeferred(this::hide);
break;
case KeyCodes.KEY_DOWN:
selectNext();
evt.preventDefault();
break;
case KeyCodes.KEY_UP:
selectPrevious();
evt.preventDefault();
break;
case KeyCodes.KEY_PAGEUP:
selectPreviousPage();
evt.preventDefault();
break;
case KeyCodes.KEY_PAGEDOWN:
selectNextPage();
evt.preventDefault();
break;
case KeyCodes.KEY_HOME:
selectFirst();
break;
case KeyCodes.KEY_END:
selectLast();
break;
case KeyCodes.KEY_ENTER:
evt.preventDefault();
evt.stopImmediatePropagation();
validateItem(true);
break;
case KeyCodes.KEY_TAB:
evt.preventDefault();
evt.stopImmediatePropagation();
validateItem(false);
break;
}
} else if (Event.SCROLL.equalsIgnoreCase(evt.getType())) {
updateIfNecessary();
} else if (Event.FOCUS.equalsIgnoreCase(evt.getType())) {
focused = true;
}
}
示例15: handleKeyDown
@UiHandler("nameField")
void handleKeyDown(KeyDownEvent event) {
switch (event.getNativeKeyCode()) {
case KeyCodes.KEY_UP:
event.stopPropagation();
event.preventDefault();
list.getSelectionModel().selectPrevious();
break;
case KeyCodes.KEY_DOWN:
event.stopPropagation();
event.preventDefault();
list.getSelectionModel().selectNext();
break;
case KeyCodes.KEY_PAGEUP:
event.stopPropagation();
event.preventDefault();
list.getSelectionModel().selectPreviousPage();
break;
case KeyCodes.KEY_PAGEDOWN:
event.stopPropagation();
event.preventDefault();
list.getSelectionModel().selectNextPage();
break;
case KeyCodes.KEY_ENTER:
event.stopPropagation();
event.preventDefault();
delegate.onActionSelected(list.getSelectionModel().getSelectedItem());
break;
case KeyCodes.KEY_ESCAPE:
event.stopPropagation();
event.preventDefault();
hide();
break;
default:
// here we need some delay to be sure that input box initiated with given value
// in manually testing hard to reproduce this problem but it reproduced with selenium tests
new Timer() {
@Override
public void run() {
delegate.nameChanged(nameField.getText(), includeNonMenu.getValue());
}
}.schedule(300);
break;
}
}