Java 类com.google.gwt.event.dom.client.HasAllKeyHandlers 实例源码

项目:gwt-material    文件:MaterialWidgetTestCase.java   
protected <H extends HasAllKeyHandlers & HasEnabled> void checkKeyEvents(H widget) {
    // Key Down
    final boolean[] isKeyDownFired = {false};
    widget.addKeyDownHandler(keyDownEvent -> isKeyDownFired[0] = true);
    fireKeyDownEvent(widget);

    // Key Up
    final boolean[] isKeyUpFired = {false};
    widget.addKeyUpHandler(keyUpEvent -> isKeyUpFired[0] = true);
    fireKeyUpEvent(widget);

    // Key Press
    final boolean[] isKeyPressFired = {false};
    widget.addKeyPressHandler(keyPressEvent -> isKeyPressFired[0] = true);
    fireKeyPressEvent(widget);

    assertEquals(widget.isEnabled(), isKeyDownFired[0]);
    assertEquals(widget.isEnabled(), isKeyUpFired[0]);
    assertEquals(widget.isEnabled(), isKeyPressFired[0]);
}
项目:qafe-platform    文件:LabeledTextAreaFieldWidget.java   
public HandlerRegistration addKeyUpHandler(KeyUpHandler handler) {
    if (uiObject instanceof HasAllKeyHandlers) {
        return ((HasAllKeyHandlers)uiObject).addKeyUpHandler(handler);
    }
    return null;
}
项目:qafe-platform    文件:LabeledTextAreaFieldWidget.java   
public HandlerRegistration addKeyDownHandler(KeyDownHandler handler) {
    if (uiObject instanceof HasAllKeyHandlers) {
        return ((HasAllKeyHandlers)uiObject).addKeyDownHandler(handler);
    }
    return null;
}
项目:qafe-platform    文件:LabeledTextAreaFieldWidget.java   
public HandlerRegistration addKeyPressHandler(KeyPressHandler handler) {
    if (uiObject instanceof HasAllKeyHandlers) {
        return ((HasAllKeyHandlers)uiObject).addKeyPressHandler(handler);
    }
    return null;
}
项目:qafe-platform    文件:LabeledTextFieldWidget.java   
public HandlerRegistration addKeyUpHandler(KeyUpHandler handler) {
    if (textbox instanceof HasAllKeyHandlers){
        return ((HasAllKeyHandlers)textbox).addKeyUpHandler(handler);
    }
    return null;
}
项目:qafe-platform    文件:LabeledTextFieldWidget.java   
public HandlerRegistration addKeyDownHandler(KeyDownHandler handler) {
    if (textbox instanceof HasAllKeyHandlers){
        return ((HasAllKeyHandlers)textbox).addKeyDownHandler(handler);
    }
    return null;
}
项目:qafe-platform    文件:LabeledTextFieldWidget.java   
public HandlerRegistration addKeyPressHandler(KeyPressHandler handler) {
    if (textbox instanceof HasAllKeyHandlers){
        return ((HasAllKeyHandlers)textbox).addKeyPressHandler(handler);
    }
    return null;
}