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


Java HasKeyDownHandlers类代码示例

本文整理汇总了Java中com.google.gwt.event.dom.client.HasKeyDownHandlers的典型用法代码示例。如果您正苦于以下问题:Java HasKeyDownHandlers类的具体用法?Java HasKeyDownHandlers怎么用?Java HasKeyDownHandlers使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


HasKeyDownHandlers类属于com.google.gwt.event.dom.client包,在下文中一共展示了HasKeyDownHandlers类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setKeyPressed

import com.google.gwt.event.dom.client.HasKeyDownHandlers; //导入依赖的package包/类
public void setKeyPressed(JavaScriptObject aValue) {
	if (keyPressed != aValue) {
		if (keyDownReg != null) {
			keyDownReg.removeHandler();
			keyDownReg = null;
		}
		keyPressed = aValue;
		if (keyPressed != null && component instanceof HasKeyDownHandlers) {
			keyDownReg = ((HasKeyDownHandlers) component).addKeyDownHandler(new KeyDownHandler() {
				@Override
				public void onKeyDown(KeyDownEvent event) {
					if (keyPressed != null) {
						event.stopPropagation();
						executeEvent(keyPressed, EventsPublisher.publish(event));
					}
				}
			});
		}
	}
}
 
开发者ID:marat-gainullin,项目名称:platypus-js,代码行数:21,代码来源:EventsExecutor.java

示例2: fixHandlers

import com.google.gwt.event.dom.client.HasKeyDownHandlers; //导入依赖的package包/类
private void fixHandlers(final FilterBox box, Widget w) {
	if (w instanceof HasBlurHandlers)
		((HasBlurHandlers)w).addBlurHandler(box.iBlurHandler);
	if (w instanceof HasFocusHandlers)
		((HasFocusHandlers)w).addFocusHandler(box.iFocusHandler);
	if (w instanceof HasKeyDownHandlers)
		((HasKeyDownHandlers)w).addKeyDownHandler(new KeyDownHandler() {
			@Override
			public void onKeyDown(KeyDownEvent event) {
				if (event.getNativeEvent().getKeyCode() == KeyCodes.KEY_ESCAPE)
					if (box.isFilterPopupShowing()) box.hideFilterPopup();
			}
		});
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:15,代码来源:FilterBox.java

示例3: addKeyDownHandler

import com.google.gwt.event.dom.client.HasKeyDownHandlers; //导入依赖的package包/类
/**
 * Sets the KeyDown event handler in many widgets
 * @param handler the handler
 * @param widgets the widgets
 */
public static void addKeyDownHandler(final KeyDownHandler handler,final HasKeyDownHandlers... widgets) {
	if (handler != null && widgets != null && widgets.length > 0) {
		for (HasKeyDownHandlers w : widgets) {
			if (w != null) w.addKeyDownHandler(handler);
		}
	}
}
 
开发者ID:opendata-euskadi,项目名称:r01fb,代码行数:13,代码来源:GWTWidgets.java


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