當前位置: 首頁>>代碼示例>>Java>>正文


Java KeyCodes.KEY_ENTER屬性代碼示例

本文整理匯總了Java中com.google.gwt.event.dom.client.KeyCodes.KEY_ENTER屬性的典型用法代碼示例。如果您正苦於以下問題:Java KeyCodes.KEY_ENTER屬性的具體用法?Java KeyCodes.KEY_ENTER怎麽用?Java KeyCodes.KEY_ENTER使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在com.google.gwt.event.dom.client.KeyCodes的用法示例。


在下文中一共展示了KeyCodes.KEY_ENTER屬性的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onPreviewNativeEvent

@Override
protected void onPreviewNativeEvent(NativePreviewEvent preview) {
	super.onPreviewNativeEvent(preview);

	NativeEvent evt = preview.getNativeEvent();
	if (evt.getType().equals("keydown")) {
		// Use the popup's key preview hooks to close the dialog when either
		// enter or escape is pressed.
		switch (evt.getKeyCode()) {
		case KeyCodes.KEY_ENTER:
		case KeyCodes.KEY_ESCAPE:
			hide();
			break;
		default:
			break;
		}
	}
}
 
開發者ID:kuzavas,項目名稱:ephesoft,代碼行數:18,代碼來源:AboutDialog.java

示例2: onPreviewNativeEvent

@Override
protected void onPreviewNativeEvent(NativePreviewEvent preview) {
  super.onPreviewNativeEvent(preview);

  NativeEvent evt = preview.getNativeEvent();
  if (evt.getType()
         .equals("keydown")) {
    // Use the popup's key preview hooks to close the dialog when either
    // enter or escape is pressed.
    switch (evt.getKeyCode()) {
      case KeyCodes.KEY_ENTER:
      case KeyCodes.KEY_ESCAPE:
        hide();
        break;
    }
  }
}
 
開發者ID:mvp4g,項目名稱:mvp4g-examples,代碼行數:17,代碼來源:AboutDialog.java

示例3: searchBoxEnter

@UiHandler("searchBox")
void searchBoxEnter(KeyDownEvent event) {
  if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) {
    SuggestionDisplay suggestionDisplay = searchBox.getSuggestionDisplay();

    // This should always be true unless GWT changes the type of the suggestion generated by the
    // SuggestBox. It is too complicated and nasty to switch out the SuggestBox suggestion display
    // factory, so we're left with this type safety check and broken functionality if GWT changes.
    Preconditions.checkState(suggestionDisplay instanceof DefaultSuggestionDisplay);

    // At this point this should always be true.
    if (suggestionDisplay instanceof DefaultSuggestionDisplay) {
      DefaultSuggestionDisplay suggestions = (DefaultSuggestionDisplay) suggestionDisplay;
      if (!suggestions.isSuggestionListShowing()) {
        presenter.handleSearch(searchBox.getValue());
      }
    }
  }
}
 
開發者ID:showlowtech,項目名稱:google-apis-explorer,代碼行數:19,代碼來源:FullView.java

示例4: handlePanelEventDelegation

private void handlePanelEventDelegation(final KeyUpEvent event) {
    switch (event.getNativeKeyCode()) {
    case KeyCodes.KEY_DOWN:
        arrowKeyDown(event);
        break;
    case KeyCodes.KEY_UP:
        arrorKeyUp(event);
        break;
    case KeyCodes.KEY_ESCAPE:
        escapeKey();
        break;
    case KeyCodes.KEY_ENTER:
        enterKey();
        break;
    default:
        doAskForSuggestion();
    }
}
 
開發者ID:eclipse,項目名稱:hawkbit,代碼行數:18,代碼來源:AutoCompleteTextFieldConnector.java

示例5: onProjectNameChanged

@UiHandler("projectName")
void onProjectNameChanged(KeyUpEvent event) {
  if (projectName.getValue() != null && projectName.getValue().contains(" ")) {
    String tmp = projectName.getValue();
    while (tmp.contains(" ")) {
      tmp = tmp.replaceAll(" ", "-");
    }
    projectName.setValue(tmp);
  }

  if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) {
    return;
  }

  delegate.projectNameChanged(projectName.getText());
}
 
開發者ID:eclipse,項目名稱:che,代碼行數:16,代碼來源:CategoriesPageViewImpl.java

示例6: titleKeyDownHandler

@UiHandler("titleTextBox")
public void titleKeyDownHandler(KeyDownEvent event) {
    if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) {
        presenter.applyBookmark();
    } else if (event.getNativeKeyCode() == KeyCodes.KEY_ESCAPE) {
        presenter.discardChanges();
    }
}
 
開發者ID:YoungDigitalPlanet,項目名稱:empiria.player,代碼行數:8,代碼來源:BookmarkPopupContents.java

示例7: onPreviewNativeEvent

@Override
protected void onPreviewNativeEvent(NativePreviewEvent event) {
	super.onPreviewNativeEvent(event);
	if (isEscapeToHide() && event.getNativeEvent().getKeyCode() == KeyCodes.KEY_ESCAPE) {
		AriaStatus.getInstance().setText(ARIA.dialogClosed(getText()));
		hide();
	} if (isEnterToSubmit() && event.getNativeEvent().getKeyCode() == KeyCodes.KEY_ENTER) {
		event.getNativeEvent().stopPropagation();
		event.getNativeEvent().preventDefault();
    	iSubmitHandler.execute();
	}
}
 
開發者ID:Jenner4S,項目名稱:unitimes,代碼行數:12,代碼來源:UniTimeDialogBox.java

示例8: addKeyShortcuts

private void addKeyShortcuts() {
	final KeyShortcutHandler keyShortcut = new KeyShortcutHandler(
			getButton(PredefinedButton.OK), KeyCodes.KEY_ENTER);

	latitudTextField.addKeyDownHandler(keyShortcut);
	longitudTextField.addKeyDownHandler(keyShortcut);
}
 
開發者ID:geowe,項目名稱:sig-seguimiento-vehiculos,代碼行數:7,代碼來源:CoordinateGeolocationDialog.java

示例9: addKeyShortcuts

private void addKeyShortcuts() {
	KeyShortcutHandler keyShortcut = new KeyShortcutHandler(searchButton,
			KeyCodes.KEY_ENTER);

	layerNameField.addKeyDownHandler(keyShortcut);
	valueAttributeField.addKeyDownHandler(keyShortcut);
	attributeCombo.addKeyDownHandler(keyShortcut);
}
 
開發者ID:geowe,項目名稱:sig-seguimiento-vehiculos,代碼行數:8,代碼來源:AttributeSearchDialog.java

示例10: addKeyShortcuts

private void addKeyShortcuts() {
	KeyShortcutHandler keyShortcut = new KeyShortcutHandler(
			getButton(PredefinedButton.OK), KeyCodes.KEY_ENTER);

	layerName.addKeyDownHandler(keyShortcut);
	projectionName.addKeyDownHandler(keyShortcut);
	vectorFormatCombo.addKeyDownHandler(keyShortcut);
	geoDataTextArea.addKeyDownHandler(keyShortcut);
}
 
開發者ID:geowe,項目名稱:sig-seguimiento-vehiculos,代碼行數:9,代碼來源:GeoDataImportDialog.java

示例11: addKeyShortcuts

private void addKeyShortcuts() {
	KeyShortcutHandler keyShortcut = new KeyShortcutHandler(
			getButton(PredefinedButton.OK), KeyCodes.KEY_ENTER);

	vectorFormatCombo.addKeyDownHandler(keyShortcut);
	epsgCombo.addKeyDownHandler(keyShortcut);
}
 
開發者ID:geowe,項目名稱:sig-seguimiento-vehiculos,代碼行數:7,代碼來源:ExportDataDialog.java

示例12: handleKeyPress

private void handleKeyPress(char keyCode) {
  if (keyCode == KeyCodes.KEY_ENTER || keyCode == KeyCodes.KEY_TAB) {
    // Pressing <tab>, <enter> or <return> will surrender focus.
    textEdit.cancelKey();
    textEdit.setFocus(false);
  } else if (!validateKeyCode(keyCode)) {
    textEdit.cancelKey();
  }
}
 
開發者ID:mit-cml,項目名稱:appinventor-extensions,代碼行數:9,代碼來源:TextPropertyEditorBase.java

示例13: handleKeyPress

private void handleKeyPress(char keyCode) {
  if (keyCode == KeyCodes.KEY_ENTER || keyCode == KeyCodes.KEY_TAB) {
    // Pressing <tab>, <enter> or <return> will surrender focus.
    urlField.cancelKey();
    urlField.setFocus(false);
  } else if (!validateKeyCode(keyCode)) {
    urlField.cancelKey();
  }
}
 
開發者ID:mit-cml,項目名稱:appinventor-extensions,代碼行數:9,代碼來源:YoungAndroidDefaultURLPropertyEditor.java

示例14: onKeyDown

@Override
public void onKeyDown(KeyDownEvent event) {
    switch (event.getNativeKeyCode()) {
        case KeyCodes.KEY_LEFT: game.addEvent(Event.LEFT); break;
        case KeyCodes.KEY_RIGHT: game.addEvent(Event.RIGHT); break;
        case KeyCodes.KEY_UP: game.addEvent(Event.UP); break;
        case KeyCodes.KEY_DOWN: game.addEvent(Event.DOWN); break;
        case KeyCodes.KEY_ENTER: game.addEvent(Event.SELECT); break;
        case KeyCodes.KEY_ESCAPE: game.addEvent(Event.BACK); break;
        default: return;
    }
}
 
開發者ID:czak,項目名稱:retronix,代碼行數:12,代碼來源:Application.java

示例15: onKeyDown

@Override
public void onKeyDown(KeyDownEvent event) {
	if (this.enabled && !this.readonly) {
		int keyCode = event.getNativeKeyCode();

		debug("VComboBoxMultiselect: key down: " + keyCode);

		if (this.dataReceivedHandler.isWaitingForFilteringResponse() && navigationKeyCodes.contains(keyCode)
				&& (!this.allowNewItems || keyCode != KeyCodes.KEY_ENTER)) {
			/*
			 * Keyboard navigation events should not be handled while we are
			 * waiting for a response. This avoids flickering, disappearing
			 * items, wrongly interpreted responses and more.
			 */
			debug("Ignoring " + keyCode + " because we are waiting for a filtering response");

			DOM.eventPreventDefault(DOM.eventGetCurrentEvent());
			event.stopPropagation();
			return;
		}

		if (this.suggestionPopup.isAttached()) {
			debug("Keycode " + keyCode + " target is popup");
			popupKeyDown(event);
		} else {
			debug("Keycode " + keyCode + " target is text field");
			inputFieldKeyDown(event);
		}
	}
}
 
開發者ID:bonprix,項目名稱:vaadin-combobox-multiselect,代碼行數:30,代碼來源:VComboBoxMultiselect.java


注:本文中的com.google.gwt.event.dom.client.KeyCodes.KEY_ENTER屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。