当前位置: 首页>>代码示例>>Java>>正文


Java KeyCodes.KEY_PAGEUP属性代码示例

本文整理汇总了Java中com.google.gwt.event.dom.client.KeyCodes.KEY_PAGEUP属性的典型用法代码示例。如果您正苦于以下问题:Java KeyCodes.KEY_PAGEUP属性的具体用法?Java KeyCodes.KEY_PAGEUP怎么用?Java KeyCodes.KEY_PAGEUP使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在com.google.gwt.event.dom.client.KeyCodes的用法示例。


在下文中一共展示了KeyCodes.KEY_PAGEUP属性的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;    
}
 
开发者ID:jorkey,项目名称:Wiab.pro,代码行数:19,代码来源:EditorEventImpl.java

示例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;
		}
	}
}
 
开发者ID:bonprix,项目名称:vaadin-combobox-multiselect,代码行数:34,代码来源:VComboBoxMultiselect.java

示例3: createKeyHandler

private KeyUpHandler createKeyHandler() {
	return new KeyUpHandler() {
		@Override
		public void onKeyUp(final KeyUpEvent event) {
			if (KeyCodes.KEY_PAGEUP == event.getNativeEvent().getKeyCode()) {
				onRelease();
			}
		}
	};
}
 
开发者ID:geowe,项目名称:sig-seguimiento-vehiculos,代码行数:10,代码来源:ZoomOutTool.java

示例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;
	}

}
 
开发者ID:bonprix,项目名称:vaadin-combobox-multiselect,代码行数:42,代码来源:VComboBoxMultiselect.java

示例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;
	}
}
 
开发者ID:openkm,项目名称:document-management-system,代码行数:8,代码来源:EventUtils.java

示例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();
    }
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:33,代码来源:CubaSearchSelectWidget.java

示例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;
        }
    }
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:31,代码来源:CubaComboBoxWidget.java

示例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();
  }
}
 
开发者ID:jorkey,项目名称:Wiab.pro,代码行数:36,代码来源:EventWrapper.java

示例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();
  }
}
 
开发者ID:codeaudit,项目名称:gwt-chronoscope,代码行数:34,代码来源:ChartKeyDownHandler.java

示例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;
	}
}
 
开发者ID:bonprix,项目名称:vaadin-combobox-multiselect,代码行数:73,代码来源:VComboBoxMultiselect.java

示例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;
}
 
开发者ID:TatuLund,项目名称:GridFastNavigation,代码行数:6,代码来源:Keys.java

示例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;
    }
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:56,代码来源:CubaSearchSelectWidget.java

示例13: isPageUp

private static boolean isPageUp(int keyCode) {
  return keyCode == KeyCodes.KEY_PAGEUP
    || keyCode == SafariKeyboardConstants.SAFARI_PGUP;    
}
 
开发者ID:codeaudit,项目名称:gwt-chronoscope,代码行数:4,代码来源:ChartKeyUpHandler.java

示例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;
  }
}
 
开发者ID:eclipse,项目名称:che,代码行数:55,代码来源:ContentAssistWidget.java

示例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;
  }
}
 
开发者ID:eclipse,项目名称:che,代码行数:50,代码来源:FindActionViewImpl.java


注:本文中的com.google.gwt.event.dom.client.KeyCodes.KEY_PAGEUP属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。