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


Java KeyUpEvent類代碼示例

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


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

示例1: addRVKeyUpEvent

import com.google.gwt.event.dom.client.KeyUpEvent; //導入依賴的package包/類
/**
 * @param eventBus
 */
private void addRVKeyUpEvent(HandlerManager eventBus) {
	eventBus.addHandler(RVKeyUpEvent.type, new RVKeyUpEventHandler() {

		@Override
		public void onKeyUp(RVKeyUpEvent event) {
			KeyUpEvent keyEvent = event.getEvent();
			if (keyEvent.isControlKeyDown()) {
				int keyCode = keyEvent.getNativeEvent().getKeyCode();
				switch (keyCode) {
					case 'n':
					case 'N':
						keyNUpEvent(keyEvent);
						break;
					case 'p':
					case 'P':
						keyPUpEvent(keyEvent);
						break;
					default:
						break;
				}
			}
		}

	});
}
 
開發者ID:kuzavas,項目名稱:ephesoft,代碼行數:29,代碼來源:DocumentTree.java

示例2: postConstruct

import com.google.gwt.event.dom.client.KeyUpEvent; //導入依賴的package包/類
/**
 * Called after construction.
 */
@PostConstruct
protected void postConstruct() {
	servicesPanel.add(serviceFlowListWidget);

	String filterTxt = (String)stateService.get(ApplicationStateKeys.SERVICES_LIBRARY_FILTER_TEXT);
	filterServicesTextBox.setText(filterTxt);
	
 filterServicesTextBox.addKeyUpHandler(new KeyUpHandler() {
        @Override
        public void onKeyUp(KeyUpEvent event) {
        	stateService.put(ApplicationStateKeys.SERVICES_LIBRARY_FILTER_TEXT, filterServicesTextBox.getText());
        	// Update status
        	populateGrid(currentServices);
        }
    });
 
	// Tooltips
	createServiceButton.setTitle(i18n.format("dslibrary.createServiceButton.tooltip"));
	manageSourcesButton.setTitle(i18n.format("dslibrary.manageSourcesButton.tooltip"));
}
 
開發者ID:Teiid-Designer,項目名稱:teiid-webui,代碼行數:24,代碼來源:DataServicesLibraryScreen.java

示例3: getInstance

import com.google.gwt.event.dom.client.KeyUpEvent; //導入依賴的package包/類
public static AriaStatus getInstance() {
	if (sStatus == null) {
		RootPanel statusPanel = RootPanel.get("UniTimeGWT:AriaStatus");
		if (statusPanel != null && "1".equals(Window.Location.getParameter("aria"))) {
			sStatus = new AriaStatus(statusPanel.getElement(), false);
			sStatus.setStyleName("unitime-VisibleAriaStatus");
		} else {
			sStatus  = new AriaStatus(false);
			RootPanel.get().add(sStatus);
		}
		
		RootPanel.get().addDomHandler(new KeyUpHandler() {
			@Override
			public void onKeyUp(KeyUpEvent event) {
   				if (event.getNativeEvent().getKeyCode() == 191 && (event.isControlKeyDown() || event.isAltKeyDown())) {
   					sStatus.setHTML(sStatus.getHTML());
   				}
   			}
   		}, KeyUpEvent.getType());
	}
	return sStatus;
}
 
開發者ID:Jenner4S,項目名稱:unitimes,代碼行數:23,代碼來源:AriaStatus.java

示例4: setEscapeHandler

import com.google.gwt.event.dom.client.KeyUpEvent; //導入依賴的package包/類
private KeyUpHandler setEscapeHandler() {
	KeyUpHandler handler = new KeyUpHandler() {
		@Override
		public void onKeyUp(final KeyUpEvent event) {
			if (KeyCodes.KEY_ESCAPE == event.getNativeEvent().getKeyCode()) {
				for (Control control : controls) {
					try {
						((DrawFeature) control).cancel();
					} catch (Exception e) {
						LOGGER.error("ACTION CANCELED: "
								+ control.getControlId());
					}
				}
			}
		}
	};
	return handler;
}
 
開發者ID:geowe,項目名稱:sig-seguimiento-vehiculos,代碼行數:19,代碼來源:ToggleTool.java

示例5: setUndoHandler

import com.google.gwt.event.dom.client.KeyUpEvent; //導入依賴的package包/類
private KeyUpHandler setUndoHandler() {
	final KeyUpHandler handler = new KeyUpHandler() {
		@Override
		public void onKeyUp(final KeyUpEvent event) {
			if (KeyCodes.KEY_U == event.getNativeEvent().getKeyCode()) {
				for (final Control control : controls) {
					try {
						((DrawFeature) control).undo();
					} catch (Exception e) {
						LOGGER.error(
								"ACTION UNDO: " + control.getControlId(), e);
					}
				}
			}
		}
	};
	return handler;
}
 
開發者ID:geowe,項目名稱:sig-seguimiento-vehiculos,代碼行數:19,代碼來源:ToggleTool.java

示例6: setRedoHandler

import com.google.gwt.event.dom.client.KeyUpEvent; //導入依賴的package包/類
private KeyUpHandler setRedoHandler() {
	final KeyUpHandler handler = new KeyUpHandler() {
		@Override
		public void onKeyUp(final KeyUpEvent event) {
			if (KeyCodes.KEY_R == event.getNativeEvent().getKeyCode()) {
				for (final Control control : controls) {
					try {
						((DrawFeature) control).redo();
					} catch (Exception e) {
						LOGGER.error("ACTION REDO: "
								+ control.getControlId());
					}
				}
			}
		}
	};
	return handler;
}
 
開發者ID:geowe,項目名稱:sig-seguimiento-vehiculos,代碼行數:19,代碼來源:ToggleTool.java

示例7: install

import com.google.gwt.event.dom.client.KeyUpEvent; //導入依賴的package包/類
/**
 * Installs a key handler for key events on this window.
 *
 * @param handler handler to receive key events.
 */
static void install(KeySignalHandler handler) {
  //
  // NOTE: There are three potential candidate elements for sinking keyboard
  // events: the window, the document, and the document body. IE7 does not
  // fire events on the window element, and GWT's RootPanel is already a
  // listener on the body, leaving the document as the only cross-browser
  // whole-window event-sinking 'element'.
  //
  DocumentPanel panel = new DocumentPanel(handler);
  panel.setElement(Document.get().<Element>cast());
  panel.addDomHandler(panel, KeyDownEvent.getType());
  panel.addDomHandler(panel, KeyPressEvent.getType());
  panel.addDomHandler(panel, KeyUpEvent.getType());
  RootPanel.detachOnWindowClose(panel);
  panel.onAttach();
}
 
開發者ID:jorkey,項目名稱:Wiab.pro,代碼行數:22,代碼來源:FocusManager.java

示例8: onKeyUp

import com.google.gwt.event.dom.client.KeyUpEvent; //導入依賴的package包/類
/**
 * 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,代碼行數:35,代碼來源:VComboBoxMultiselect.java

示例9: extend

import com.google.gwt.event.dom.client.KeyUpEvent; //導入依賴的package包/類
@Override
protected void extend(final ServerConnector target) {
    textFieldWidget = (VTextField) ((ComponentConnector) target).getWidget();
    textFieldWidget.setImmediate(true);
    textFieldWidget.textChangeEventMode = "EAGER";
    panel.setWidget(select);
    panel.setStyleName("suggestion-popup");
    panel.setOwner(textFieldWidget);

    textFieldWidget.addKeyUpHandler(new KeyUpHandler() {
        @Override
        public void onKeyUp(final KeyUpEvent event) {
            if (panel.isAttached()) {
                handlePanelEventDelegation(event);
            } else if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) {
                rpc.executeQuery(textFieldWidget.getValue(), textFieldWidget.getCursorPos());
            } else {
                doAskForSuggestion();
            }
        }
    });
}
 
開發者ID:eclipse,項目名稱:hawkbit,代碼行數:23,代碼來源:AutoCompleteTextFieldConnector.java

示例10: handlePanelEventDelegation

import com.google.gwt.event.dom.client.KeyUpEvent; //導入依賴的package包/類
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,代碼行數:19,代碼來源:AutoCompleteTextFieldConnector.java

示例11: onProjectNameChanged

import com.google.gwt.event.dom.client.KeyUpEvent; //導入依賴的package包/類
@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,代碼行數:17,代碼來源:CategoriesPageViewImpl.java

示例12: onFilterChanged

import com.google.gwt.event.dom.client.KeyUpEvent; //導入依賴的package包/類
@UiHandler({"filterField"})
void onFilterChanged(KeyUpEvent event) {
  switch (event.getNativeKeyCode()) {
    case KEY_UP:
      tree.getSelectionModel().selectPrevious();
      break;
    case KEY_DOWN:
      tree.getSelectionModel().selectNext();
      break;
    case KEY_ENTER:
      final List<Node> selectedNodes = tree.getSelectionModel().getSelectedNodes();

      if (!selectedNodes.isEmpty()) {
        final Node node = selectedNodes.get(0);

        if (node instanceof ExecutableCommandNode) {
          delegate.onCommandExecute(((ExecutableCommandNode) node).getData());
        } else if (node instanceof CommandGoalNode) {
          tree.setExpanded(node, !tree.isExpanded(node));
        }
      }
      break;
    default:
      delegate.onFilterChanged(filterField.getValue());
  }
}
 
開發者ID:eclipse,項目名稱:che,代碼行數:27,代碼來源:CommandsPaletteViewImpl.java

示例13: onProjectDescriptionChanged

import com.google.gwt.event.dom.client.KeyUpEvent; //導入依賴的package包/類
@UiHandler("projectDescription")
void onProjectDescriptionChanged(KeyUpEvent event) {
  if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) {
    return;
  }
  delegate.onProjectDescriptionChanged(projectDescription.getValue());
}
 
開發者ID:eclipse,項目名稱:che,代碼行數:8,代碼來源:GithubImporterPageViewImpl.java

示例14: OwnTextArea

import com.google.gwt.event.dom.client.KeyUpEvent; //導入依賴的package包/類
public OwnTextArea() {
	super();
	sinkEvents(Event.ONPASTE);
	addKeyUpHandler(new KeyUpHandler() {
		@Override
		public void onKeyUp(KeyUpEvent event) {
			fireHandler();
		}
	});
}
 
開發者ID:umlet,項目名稱:umlet,代碼行數:11,代碼來源:OwnTextArea.java

示例15: getFullScreenView

import com.google.gwt.event.dom.client.KeyUpEvent; //導入依賴的package包/類
private VideoFullScreenView getFullScreenView() {
    if (view == null) {
        view = fullScreenViewProvider.get();
        controlsHideTimer = mediaFactory.getVideoControlHideTimer(view);
        RootPanel.get().addDomHandler(this, KeyUpEvent.getType());
    }
    return view;
}
 
開發者ID:YoungDigitalPlanet,項目名稱:empiria.player,代碼行數:9,代碼來源:VideoFullScreenHelper.java


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