本文整理汇总了Java中com.google.gwt.event.dom.client.KeyUpEvent.getNativeKeyCode方法的典型用法代码示例。如果您正苦于以下问题:Java KeyUpEvent.getNativeKeyCode方法的具体用法?Java KeyUpEvent.getNativeKeyCode怎么用?Java KeyUpEvent.getNativeKeyCode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gwt.event.dom.client.KeyUpEvent
的用法示例。
在下文中一共展示了KeyUpEvent.getNativeKeyCode方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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;
}
}
}
示例2: 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();
}
}
示例3: 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());
}
示例4: 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());
}
}
示例5: 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());
}
示例6: onKeyUp
import com.google.gwt.event.dom.client.KeyUpEvent; //导入方法依赖的package包/类
@Override
public void onKeyUp(KeyUpEvent event) {
if (event.getNativeKeyCode() == KeyCodes.KEY_ESCAPE) {
event.preventDefault();
closeFullScreen();
}
}
示例7: onKeyUp
import com.google.gwt.event.dom.client.KeyUpEvent; //导入方法依赖的package包/类
/**
* Trigger action when key up event fired
*
* @param event
*/
protected void onKeyUp(KeyUpEvent event){
logger.info("key" +event.getNativeKeyCode() );
if(event.getNativeKeyCode()== 46){
logger.info("delete widget");
deleteWidget();
}
}
示例8: onKeyUp
import com.google.gwt.event.dom.client.KeyUpEvent; //导入方法依赖的package包/类
@Override
public void onKeyUp(KeyUpEvent event) {
if (iCourses.getRowCount() < 2 || iCourses.getData(1) == null) return;
int row = iCourses.getSelectedRow();
if (event.getNativeKeyCode() == KeyCodes.KEY_DOWN) {
if (row < 0 || iCourses.getSelectedRow() + 1 >= iCourses.getRowCount())
iCourses.setSelected(1, true);
else
iCourses.setSelected(row + 1, true);
scrollToSelectedRow();
updateCourseDetails();
} else if (event.getNativeKeyCode()==KeyCodes.KEY_UP) {
if (row - 1 < 1)
iCourses.setSelected(iCourses.getRowCount() - 1, true);
else
iCourses.setSelected(row - 1, true);
scrollToSelectedRow();
updateCourseDetails();
} else if (event.isControlKeyDown() || event.isAltKeyDown()) {
for (Map.Entry<Character, Integer> entry: iTabAccessKeys.entrySet())
if (event.getNativeKeyCode() == Character.toLowerCase(entry.getKey()) || event.getNativeKeyCode() == Character.toUpperCase(entry.getKey())) {
iCourseDetailsTabBar.selectTab(entry.getValue(), true);
event.preventDefault();
event.stopPropagation();
}
}
}
示例9: onKeyUp
import com.google.gwt.event.dom.client.KeyUpEvent; //导入方法依赖的package包/类
@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();
}
}
示例10: onKeyUp
import com.google.gwt.event.dom.client.KeyUpEvent; //导入方法依赖的package包/类
@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;
}
}
}
示例11: onKeyUp
import com.google.gwt.event.dom.client.KeyUpEvent; //导入方法依赖的package包/类
public void onKeyUp(KeyUpEvent event) {
ChartState chartInfo = getChartState(event);
Chart chart = chartInfo.chart;
int keyCode = event.getNativeKeyCode();
boolean handled = true;
if (isPageUp(keyCode)) {
chart.pageLeft(FULL_PAGE_SCROLL);
} else if (event.isLeftArrow() || isKeyLeft(keyCode)) {
chart.pageLeft(HALF_PAGE_SCROLL);
} else if (isPageDown(keyCode)) {
chart.pageRight(FULL_PAGE_SCROLL);
} else if (event.isRightArrow() || isKeyRight(keyCode)) {
chart.pageRight(HALF_PAGE_SCROLL);
} else if (event.isUpArrow() || isNextZoom(keyCode)) {
chart.nextZoom();
ChartKeyDownHandler.UP_NUM = 0;
} else if (event.isDownArrow() || isPrevZoom(keyCode)) {
chart.prevZoom();
ChartKeyDownHandler.DOWN_NUM = 0;
} else if (keyCode == KeyCodes.KEY_BACKSPACE) {
History.back();
} else if (isMaxZoomOut(keyCode)) {
chart.maxZoomOut();
} else {
handled = false;
}
chartInfo.setHandled(handled);
if (handled) {
event.stopPropagation();
event.preventDefault();
}
}
示例12: onProjectDescriptionChanged
import com.google.gwt.event.dom.client.KeyUpEvent; //导入方法依赖的package包/类
@UiHandler("projectDescription")
void onProjectDescriptionChanged(KeyUpEvent event) {
if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) {
return;
}
delegate.projectDescriptionChanged(projectDescription.getValue());
}
示例13: onProjectNameChanged
import com.google.gwt.event.dom.client.KeyUpEvent; //导入方法依赖的package包/类
@UiHandler("projectName")
void onProjectNameChanged(KeyUpEvent event) {
String projectNameValue = projectName.getValue();
if (projectNameValue != null && projectNameValue.contains(" ")) {
projectNameValue = projectNameValue.replace(" ", "-");
projectName.setValue(projectNameValue);
}
if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) {
return;
}
delegate.projectNameChanged(projectName.getValue());
}
示例14: onProjectDescriptionChanged
import com.google.gwt.event.dom.client.KeyUpEvent; //导入方法依赖的package包/类
@UiHandler("projectDescription")
void onProjectDescriptionChanged(KeyUpEvent event) {
if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) {
return;
}
delegate.projectDescriptionChanged(projectDescription.getValue());
}
示例15: onProjectNameChanged
import com.google.gwt.event.dom.client.KeyUpEvent; //导入方法依赖的package包/类
@UiHandler({"factoryName"})
public void onProjectNameChanged(KeyUpEvent event) {
if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER && createFactoryButton.isEnabled()) {
delegate.onCreateClicked();
} else {
String name = factoryName.getValue();
if (!Strings.isNullOrEmpty(name) && FACTORY_NAME_PATTERN.test(name)) {
name = name.replaceAll("[^A-Za-z0-9_]", "-");
factoryName.setValue(name);
}
delegate.onFactoryNameChanged(name);
}
}