本文整理汇总了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;
}
}
}
});
}
示例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"));
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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();
}
示例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;
}
}
}
示例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();
}
}
});
}
示例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();
}
}
示例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());
}
示例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());
}
}
示例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());
}
示例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();
}
});
}
示例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;
}