Search in sources :

Example 41 with KeyDownEvent

use of com.google.gwt.event.dom.client.KeyDownEvent in project drools-wb by kiegroup.

the class BaseKeyDownHandlerTest method enterKeyWithShiftMovesUp.

@Test
public void enterKeyWithShiftMovesUp() {
    when(context.getRowIndex()).thenReturn(1);
    when(context.getColumnIndex()).thenReturn(0);
    final KeyDownEvent e = mockKeyDownEvent(Optional.of(KeyCodes.KEY_ENTER), Optional.of(true), Optional.of(false));
    handler.onKeyDown(e);
    verify(gridWidget).adjustSelection(eq(SelectionExtension.UP), eq(false));
}
Also used : KeyDownEvent(com.google.gwt.event.dom.client.KeyDownEvent) Test(org.junit.Test)

Example 42 with KeyDownEvent

use of com.google.gwt.event.dom.client.KeyDownEvent in project drools-wb by kiegroup.

the class BaseKeyDownHandlerTest method tabKeyWithShiftMovesLeft.

@Test
public void tabKeyWithShiftMovesLeft() {
    when(context.getRowIndex()).thenReturn(0);
    when(context.getColumnIndex()).thenReturn(1);
    final KeyDownEvent e = mockKeyDownEvent(Optional.of(KeyCodes.KEY_TAB), Optional.of(true), Optional.of(false));
    handler.onKeyDown(e);
    verify(gridWidget).adjustSelection(eq(SelectionExtension.LEFT), eq(false));
}
Also used : KeyDownEvent(com.google.gwt.event.dom.client.KeyDownEvent) Test(org.junit.Test)

Example 43 with KeyDownEvent

use of com.google.gwt.event.dom.client.KeyDownEvent in project drools-wb by kiegroup.

the class BaseKeyDownHandlerTest method enterKeyWithoutShiftMovesDown.

@Test
public void enterKeyWithoutShiftMovesDown() {
    when(context.getRowIndex()).thenReturn(1);
    when(context.getColumnIndex()).thenReturn(0);
    final KeyDownEvent e = mockKeyDownEvent(Optional.of(KeyCodes.KEY_ENTER), Optional.of(false), Optional.of(false));
    handler.onKeyDown(e);
    verify(gridWidget).adjustSelection(eq(SelectionExtension.DOWN), eq(false));
}
Also used : KeyDownEvent(com.google.gwt.event.dom.client.KeyDownEvent) Test(org.junit.Test)

Example 44 with KeyDownEvent

use of com.google.gwt.event.dom.client.KeyDownEvent in project drools-wb by kiegroup.

the class KeyDownHandlerDatePickerTest method tabKeyCanvasActions.

@Test
public void tabKeyCanvasActions() {
    final KeyDownEvent e = mockKeyDownEvent(Optional.of(KeyCodes.KEY_TAB), Optional.of(false), Optional.of(false));
    handler.onKeyDown(e);
    verify(gridCell, never()).flush();
    verify(gridCell).destroyResources();
    verifyCommonActions();
}
Also used : KeyDownEvent(com.google.gwt.event.dom.client.KeyDownEvent) Test(org.junit.Test)

Example 45 with KeyDownEvent

use of com.google.gwt.event.dom.client.KeyDownEvent in project drools-wb by kiegroup.

the class KeyDownHandlerDatePickerTest method escapeKeyCanvasActions.

@Test
public void escapeKeyCanvasActions() {
    final KeyDownEvent e = mockKeyDownEvent(Optional.of(KeyCodes.KEY_ESCAPE), Optional.of(false), Optional.of(false));
    handler.onKeyDown(e);
    verify(gridCell, never()).flush();
    verify(gridCell).destroyResources();
    verifyCommonActions();
}
Also used : KeyDownEvent(com.google.gwt.event.dom.client.KeyDownEvent) Test(org.junit.Test)

Aggregations

KeyDownEvent (com.google.gwt.event.dom.client.KeyDownEvent)46 Test (org.junit.Test)30 KeyDownHandler (com.google.gwt.event.dom.client.KeyDownHandler)15 ClickEvent (com.google.gwt.event.dom.client.ClickEvent)5 KeyPressEvent (com.google.gwt.event.dom.client.KeyPressEvent)5 KeyUpEvent (com.google.gwt.event.dom.client.KeyUpEvent)5 ClickHandler (com.google.gwt.event.dom.client.ClickHandler)4 KeyPressHandler (com.google.gwt.event.dom.client.KeyPressHandler)3 KeyUpHandler (com.google.gwt.event.dom.client.KeyUpHandler)3 WindowEx (org.rstudio.core.client.dom.WindowEx)3 FindTextBox (org.rstudio.core.client.widget.FindTextBox)3 NativeEvent (com.google.gwt.dom.client.NativeEvent)2 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 CanFocus (org.rstudio.core.client.widget.CanFocus)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