Search in sources :

Example 11 with Event

use of elemental2.dom.Event in project kie-wb-common by kiegroup.

the class FlashMessagesViewTest method testOnCancelWarningButtonClick.

@Test
public void testOnCancelWarningButtonClick() {
    final ClickEvent event = mock(ClickEvent.class);
    doNothing().when(view).disableWarningHighlight();
    warningContainer.classList = mock(DOMTokenList.class);
    view.onCancelWarningButtonClick(event);
    verify(presenter).executeErrorWarningCallback();
    verify(warningContainer.classList).remove(OPENED_CONTAINER_CSS_CLASS);
    verify(view).disableWarningHighlight();
}
Also used : DOMTokenList(elemental2.dom.DOMTokenList) ClickEvent(com.google.gwt.event.dom.client.ClickEvent) Test(org.junit.Test)

Example 12 with Event

use of elemental2.dom.Event in project kie-wb-common by kiegroup.

the class FlashMessagesViewTest method testSetupDisableErrorHighlightCallbacks.

@Test
public void testSetupDisableErrorHighlightCallbacks() {
    final Event event = mock(Event.class);
    final Element errorElement = mock(Element.class);
    doNothing().when(view).disableErrorHighlight(any());
    view.setupDisableErrorHighlightCallbacks(errorElement);
    errorElement.onkeypress.onInvoke(event);
    errorElement.onblur.onInvoke(event);
    verify(view, times(2)).disableErrorHighlight(errorElement);
}
Also used : Element(elemental2.dom.Element) HTMLElement(elemental2.dom.HTMLElement) HTMLDivElement(elemental2.dom.HTMLDivElement) HTMLButtonElement(elemental2.dom.HTMLButtonElement) ClickEvent(com.google.gwt.event.dom.client.ClickEvent) Event(elemental2.dom.Event) Test(org.junit.Test)

Example 13 with Event

use of elemental2.dom.Event in project kie-wb-common by kiegroup.

the class ValueAndDataTypePopoverViewImpl method manageButtonKeyDownEventListener.

void manageButtonKeyDownEventListener(final Object event) {
    if (event instanceof KeyboardEvent) {
        final KeyboardEvent keyEvent = (KeyboardEvent) event;
        if (isEscapeKeyPressed(keyEvent)) {
            reset();
            hide(false);
            onClosedByKeyboard();
        }
    }
}
Also used : KeyboardEvent(elemental2.dom.KeyboardEvent)

Example 14 with Event

use of elemental2.dom.Event in project kie-wb-common by kiegroup.

the class DataTypeSelectView method onTypeTextClick.

@EventHandler("type-text")
public void onTypeTextClick(final ClickEvent event) {
    final String type = presenter.getDataType().getType();
    final HTMLElement element = getElement();
    if (!isBuiltInType(type)) {
        structureTypesTooltip.show(element, type);
    }
    skipClickListeners(event);
}
Also used : HTMLElement(elemental2.dom.HTMLElement) EventHandler(org.jboss.errai.ui.shared.api.annotations.EventHandler)

Example 15 with Event

use of elemental2.dom.Event in project kie-wb-common by kiegroup.

the class DataTypeSelectViewTest method testOnTypeTextClickWhenItsNotBuiltInType.

@Test
public void testOnTypeTextClickWhenItsNotBuiltInType() {
    final ClickEvent event = mock(ClickEvent.class);
    final String type = "tPerson";
    final DataType dataType = makeDataType(type);
    final HTMLElement element = mock(HTMLElement.class);
    when(presenter.getDataType()).thenReturn(dataType);
    doReturn(element).when(view).getElement();
    view.onTypeTextClick(event);
    verify(structureTypesTooltip).show(element, type);
    verify(event).preventDefault();
    verify(event).stopPropagation();
}
Also used : HTMLElement(elemental2.dom.HTMLElement) ClickEvent(com.google.gwt.event.dom.client.ClickEvent) DataType(org.kie.workbench.common.dmn.client.editors.types.common.DataType) ArgumentMatchers.anyString(org.mockito.ArgumentMatchers.anyString) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)50 HTMLElement (elemental2.dom.HTMLElement)27 Event (elemental2.dom.Event)26 KeyboardEvent (elemental2.dom.KeyboardEvent)19 Element (elemental2.dom.Element)18 MouseEvent (elemental2.dom.MouseEvent)16 HTMLDivElement (elemental2.dom.HTMLDivElement)15 HTMLInputElement (elemental2.dom.HTMLInputElement)13 HTMLButtonElement (elemental2.dom.HTMLButtonElement)12 ClickEvent (com.google.gwt.event.dom.client.ClickEvent)10 BlurEvent (com.google.gwt.event.dom.client.BlurEvent)7 CSSStyleDeclaration (elemental2.dom.CSSStyleDeclaration)7 JQuery (org.uberfire.client.views.pfly.selectpicker.JQuery)7 DOMRect (elemental2.dom.DOMRect)5 DOMTokenList (elemental2.dom.DOMTokenList)5 DomGlobal (elemental2.dom.DomGlobal)5 LazyReverseView (com.github.mvp4g.mvp4g2.core.ui.LazyReverseView)4 AbstractCell (com.google.gwt.cell.client.AbstractCell)4 Elements.button (org.jboss.gwt.elemento.core.Elements.button)4 Elements.div (org.jboss.gwt.elemento.core.Elements.div)4