Search in sources :

Example 16 with KeyDownHandler

use of com.google.gwt.event.dom.client.KeyDownHandler in project kie-wb-common by kiegroup.

the class DefaultImportListItemWidgetViewTest method init.

@Test
public void init() {
    tested.init();
    verify(customClassName, times(1)).addKeyDownHandler(keyDownHandlerCaptor.capture());
    KeyDownHandler handler = keyDownHandlerCaptor.getValue();
    doReturn(Integer.valueOf('1')).when(keyDownEvent).getNativeKeyCode();
    handler.onKeyDown(keyDownEvent);
    verify(keyDownEvent, times(0)).preventDefault();
    doReturn(Integer.valueOf(' ')).when(keyDownEvent).getNativeKeyCode();
    handler.onKeyDown(keyDownEvent);
    verify(keyDownEvent, times(1)).preventDefault();
}
Also used : KeyDownHandler(com.google.gwt.event.dom.client.KeyDownHandler) Test(org.junit.Test)

Example 17 with KeyDownHandler

use of com.google.gwt.event.dom.client.KeyDownHandler in project kie-wb-common by kiegroup.

the class VariableListItemWidgetViewImplTest method testTagTypeHandlerSpace.

@Test
public void testTagTypeHandlerSpace() {
    view.init();
    verify(customTagName, times(1)).addKeyDownHandler(keyDownHandlerCaptor.capture());
    KeyDownHandler handler = keyDownHandlerCaptor.getValue();
    doReturn(Integer.valueOf(' ')).when(keyDownEvent).getNativeKeyCode();
    handler.onKeyDown(keyDownEvent);
    verify(keyDownEvent, times(1)).preventDefault();
}
Also used : KeyDownHandler(com.google.gwt.event.dom.client.KeyDownHandler) Test(org.junit.Test)

Example 18 with KeyDownHandler

use of com.google.gwt.event.dom.client.KeyDownHandler in project kie-wb-common by kiegroup.

the class VariableListItemWidgetViewImplTest method testTagTypeHandlerAlphabetical.

@Test
public void testTagTypeHandlerAlphabetical() {
    view.init();
    verify(customTagName, times(1)).addKeyDownHandler(keyDownHandlerCaptor.capture());
    KeyDownHandler handler = keyDownHandlerCaptor.getValue();
    doReturn(Integer.valueOf('a')).when(keyDownEvent).getNativeKeyCode();
    handler.onKeyDown(keyDownEvent);
    verify(keyDownEvent, never()).preventDefault();
}
Also used : KeyDownHandler(com.google.gwt.event.dom.client.KeyDownHandler) Test(org.junit.Test)

Example 19 with KeyDownHandler

use of com.google.gwt.event.dom.client.KeyDownHandler in project kie-wb-common by kiegroup.

the class VariableListItemWidgetViewImplTest method testDataTypeHandlerAlphabetical.

@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();
}
Also used : KeyDownHandler(com.google.gwt.event.dom.client.KeyDownHandler) Test(org.junit.Test)

Example 20 with KeyDownHandler

use of com.google.gwt.event.dom.client.KeyDownHandler in project kie-wb-common by kiegroup.

the class VariableListItemWidgetViewImplTest method testDataTypeHandlerSpace.

@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();
}
Also used : KeyDownHandler(com.google.gwt.event.dom.client.KeyDownHandler) Test(org.junit.Test)

Aggregations

KeyDownHandler (com.google.gwt.event.dom.client.KeyDownHandler)25 KeyDownEvent (com.google.gwt.event.dom.client.KeyDownEvent)15 Test (org.junit.Test)12 ClickEvent (com.google.gwt.event.dom.client.ClickEvent)4 ClickHandler (com.google.gwt.event.dom.client.ClickHandler)4 KeyPressEvent (com.google.gwt.event.dom.client.KeyPressEvent)3 KeyPressHandler (com.google.gwt.event.dom.client.KeyPressHandler)3 KeyUpEvent (com.google.gwt.event.dom.client.KeyUpEvent)3 KeyUpHandler (com.google.gwt.event.dom.client.KeyUpHandler)3 WindowEx (org.rstudio.core.client.dom.WindowEx)3 CanFocus (org.rstudio.core.client.widget.CanFocus)3 FindTextBox (org.rstudio.core.client.widget.FindTextBox)3 MouseDownEvent (com.google.gwt.event.dom.client.MouseDownEvent)2 MouseDownHandler (com.google.gwt.event.dom.client.MouseDownHandler)2 EventHandler (com.google.gwt.event.shared.EventHandler)2 ToolbarButton (org.rstudio.core.client.widget.ToolbarButton)2 ToolbarLabel (org.rstudio.core.client.widget.ToolbarLabel)2 RSConnectPublishButton (org.rstudio.studio.client.rsconnect.ui.RSConnectPublishButton)2 Transform (com.ait.lienzo.client.core.types.Transform)1 AccountInfo (com.google.gerrit.client.info.AccountInfo)1