Search in sources :

Example 21 with HTMLElement

use of org.jboss.errai.common.client.dom.HTMLElement in project kie-wb-common by kiegroup.

the class CollapsedDefinitionPaletteItemWidgetTest method testGetElement.

@Test
public void testGetElement() {
    final HTMLElement element = mock(HTMLElement.class);
    when(view.getElement()).thenReturn(element);
    assertEquals(element, widget.getElement());
}
Also used : HTMLElement(org.jboss.errai.common.client.dom.HTMLElement) Test(org.junit.Test)

Example 22 with HTMLElement

use of org.jboss.errai.common.client.dom.HTMLElement in project kie-wb-common by kiegroup.

the class DefinitionPaletteItemWidgetTest method testGetElement.

@Test
public void testGetElement() {
    HTMLElement element = mock(HTMLElement.class);
    when(view.getElement()).thenReturn(element);
    assertEquals(element, widget.getElement());
}
Also used : HTMLElement(org.jboss.errai.common.client.dom.HTMLElement) Test(org.junit.Test)

Example 23 with HTMLElement

use of org.jboss.errai.common.client.dom.HTMLElement in project kie-wb-common by kiegroup.

the class ZoomLevelSelectorViewTest method testAdd.

@Test
public void testAdd() {
    ZoomLevelSelectorItem item = mock(ZoomLevelSelectorItem.class);
    HTMLElement itemElement = mock(HTMLElement.class);
    when(item.getElement()).thenReturn(itemElement);
    when(items.get()).thenReturn(item);
    Command c = mock(Command.class);
    tested.add("item1", c);
    verify(item, times(1)).setText(eq("item1"));
    verify(item, times(1)).setOnClick(eq(c));
    verify(dropDownMenu, times(1)).appendChild(eq(itemElement));
}
Also used : HTMLElement(org.jboss.errai.common.client.dom.HTMLElement) Command(org.uberfire.mvp.Command) Test(org.junit.Test)

Example 24 with HTMLElement

use of org.jboss.errai.common.client.dom.HTMLElement in project kie-wb-common by kiegroup.

the class SimpleConditionEditorPresenterTest method mockParamPresenter.

private ConditionParamPresenter mockParamPresenter() {
    ConditionParamPresenter paramPresenter = mock(ConditionParamPresenter.class);
    ConditionParamPresenter.View paramPresenterView = mock(ConditionParamPresenter.View.class);
    HTMLElement element = mock(HTMLElement.class);
    when(paramPresenter.getView()).thenReturn(paramPresenterView);
    when(paramPresenterView.getElement()).thenReturn(element);
    return paramPresenter;
}
Also used : HTMLElement(org.jboss.errai.common.client.dom.HTMLElement)

Example 25 with HTMLElement

use of org.jboss.errai.common.client.dom.HTMLElement in project kie-wb-common by kiegroup.

the class CustomGroupItem method createAnchor.

@JsOverlay
public static CustomGroupItem createAnchor(final String text, final IconType iconType, final Command command) {
    final CustomGroupItem anchor = (CustomGroupItem) Window.getDocument().createElement("a");
    anchor.setClassName(Styles.LIST_GROUP_ITEM);
    if (iconType != null) {
        final HTMLElement icon = Window.getDocument().createElement("i");
        icon.getClassList().add("fa");
        icon.getClassList().add(iconType.getCssName());
        anchor.setInnerHTML(icon.getOuterHTML() + " " + text);
    } else {
        anchor.setTextContent(checkNotEmpty("text", text));
    }
    anchor.setHref("#");
    // can't use lambda here; GWT limitation (bug!)!
    anchor.setOnclick(new EventListener() {

        @Override
        public void call(final Event event) {
            command.execute();
        }
    });
    return anchor;
}
Also used : HTMLElement(org.jboss.errai.common.client.dom.HTMLElement) Event(org.jboss.errai.common.client.dom.Event) EventListener(org.jboss.errai.common.client.dom.EventListener) JsOverlay(jsinterop.annotations.JsOverlay)

Aggregations

HTMLElement (org.jboss.errai.common.client.dom.HTMLElement)46 Test (org.junit.Test)29 DecisionNavigatorItem (org.kie.workbench.common.dmn.client.docks.navigator.DecisionNavigatorItem)10 ClickEvent (com.google.gwt.event.dom.client.ClickEvent)2 TreeSet (java.util.TreeSet)2 Node (org.jboss.errai.common.client.dom.Node)2 LayoutComponent (org.uberfire.ext.layout.editor.api.editor.LayoutComponent)2 IsWidget (com.google.gwt.user.client.ui.IsWidget)1 Element (elemental2.dom.Element)1 HTMLDivElement (elemental2.dom.HTMLDivElement)1 HTMLInputElement (elemental2.dom.HTMLInputElement)1 HTMLUListElement (elemental2.dom.HTMLUListElement)1 Text (elemental2.dom.Text)1 JsOverlay (jsinterop.annotations.JsOverlay)1 FlowPanel (org.gwtbootstrap3.client.ui.gwt.FlowPanel)1 Button (org.jboss.errai.common.client.dom.Button)1 CSSStyleDeclaration (org.jboss.errai.common.client.dom.CSSStyleDeclaration)1 Event (org.jboss.errai.common.client.dom.Event)1 EventListener (org.jboss.errai.common.client.dom.EventListener)1 ParameterItem (org.kie.workbench.common.dmn.client.widgets.decisionservice.parameters.parametergroup.ParameterGroup.ParameterItem)1