本文整理匯總了Java中com.google.gwt.event.dom.client.KeyDownHandler.onKeyDown方法的典型用法代碼示例。如果您正苦於以下問題:Java KeyDownHandler.onKeyDown方法的具體用法?Java KeyDownHandler.onKeyDown怎麽用?Java KeyDownHandler.onKeyDown使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.google.gwt.event.dom.client.KeyDownHandler
的用法示例。
在下文中一共展示了KeyDownHandler.onKeyDown方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: testDataTypeHandlerSpace
import com.google.gwt.event.dom.client.KeyDownHandler; //導入方法依賴的package包/類
@Test
public void testDataTypeHandlerSpace() {
view.init();
verify(customDataType,
times(1)).addKeyDownHandler(keyDownHandlerCaptor.capture());
KeyDownHandler handler = keyDownHandlerCaptor.getValue();
doReturn(Integer.valueOf(' ')).when(keyDownEvent).getNativeKeyCode();
handler.onKeyDown(keyDownEvent);
verify(keyDownEvent,
times(1)).preventDefault();
}
示例2: testDataTypeHandlerAlphabetical
import com.google.gwt.event.dom.client.KeyDownHandler; //導入方法依賴的package包/類
@Test
public void testDataTypeHandlerAlphabetical() {
view.init();
verify(customDataType,
times(1)).addKeyDownHandler(keyDownHandlerCaptor.capture());
KeyDownHandler handler = keyDownHandlerCaptor.getValue();
doReturn(Integer.valueOf('a')).when(keyDownEvent).getNativeKeyCode();
handler.onKeyDown(keyDownEvent);
verify(keyDownEvent,
never()).preventDefault();
}
示例3: testNameHandlerSpace
import com.google.gwt.event.dom.client.KeyDownHandler; //導入方法依賴的package包/類
@Test
public void testNameHandlerSpace() {
view.init();
verify(customName,
times(1)).addKeyDownHandler(keyDownHandlerCaptor.capture());
KeyDownHandler handler = keyDownHandlerCaptor.getValue();
doReturn(Integer.valueOf(' ')).when(keyDownEvent).getNativeKeyCode();
handler.onKeyDown(keyDownEvent);
verify(keyDownEvent,
times(1)).preventDefault();
}
示例4: testNameHandlerAlphabetical
import com.google.gwt.event.dom.client.KeyDownHandler; //導入方法依賴的package包/類
@Test
public void testNameHandlerAlphabetical() {
view.init();
verify(customName,
times(1)).addKeyDownHandler(keyDownHandlerCaptor.capture());
KeyDownHandler handler = keyDownHandlerCaptor.getValue();
doReturn(Integer.valueOf('a')).when(keyDownEvent).getNativeKeyCode();
handler.onKeyDown(keyDownEvent);
verify(keyDownEvent,
never()).preventDefault();
}