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


Java KeyUpEvent.getNativeKeyCode方法代码示例

本文整理汇总了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;
		}
	}
}
 
开发者ID:bonprix,项目名称:vaadin-combobox-multiselect,代码行数:35,代码来源:VComboBoxMultiselect.java

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

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

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

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

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

}
 
开发者ID:YoungDigitalPlanet,项目名称:empiria.player,代码行数:9,代码来源:VideoFullScreenHelper.java

示例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();
	}
}
 
开发者ID:ICT-BDA,项目名称:EasyML,代码行数:13,代码来源:DiagramController.java

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

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

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

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

}
 
开发者ID:codeaudit,项目名称:gwt-chronoscope,代码行数:37,代码来源:ChartKeyUpHandler.java

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

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

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

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


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