Search in sources :

Example 26 with HTMLElement

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

the class FormGeneratorDriverTest method testCreateContainers.

@Test
public void testCreateContainers() {
    HTMLElement container = driver.createContainer();
    verify(document).createElement(eq(CONTAINER_TAG));
    Assert.assertNotNull(container);
    verify(container).setClassName(ColumnSize.MD_12.getCssName());
    HTMLElement row = driver.createRow(new LayoutRow());
    verify(document, times(2)).createElement(eq(CONTAINER_TAG));
    Assert.assertNotNull(row);
    verify(row).setClassName(eq(ROW_CLASS));
    LayoutColumn layoutColumn = new LayoutColumn("12");
    HTMLElement column = driver.createColumn(layoutColumn);
    Assert.assertNotNull(column);
    verify(column).setClassName(ColumnSizeBuilder.buildColumnSize(12));
}
Also used : HTMLElement(org.jboss.errai.common.client.dom.HTMLElement) LayoutRow(org.uberfire.ext.layout.editor.api.editor.LayoutRow) LayoutColumn(org.uberfire.ext.layout.editor.api.editor.LayoutColumn) Test(org.junit.Test)

Example 27 with HTMLElement

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

the class FormGeneratorDriverTest method testGetComponentPart.

@Test
public void testGetComponentPart() {
    testCreateComponent();
    HTMLElement column = mock(HTMLElement.class);
    LayoutComponent layoutComponent = new LayoutComponent(FieldLayoutComponent.class.getName());
    Optional<IsWidget> result = driver.getComponentPart(column, layoutComponent, "");
    Assert.assertTrue(result.isPresent());
    verify(wrapperWidgetUtil, times(3)).getWidget(same(driver), any(HTMLElement.class));
    FieldLayoutComponent fieldLayoutComponent = driver.getLayoutFields().get(0);
    verify(fieldLayoutComponent).getContentPart(eq(""), any());
}
Also used : IsWidget(com.google.gwt.user.client.ui.IsWidget) HTMLElement(org.jboss.errai.common.client.dom.HTMLElement) LayoutComponent(org.uberfire.ext.layout.editor.api.editor.LayoutComponent) Test(org.junit.Test)

Example 28 with HTMLElement

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

the class DecisionServiceParametersListWidgetTest method testLoadGroupElements.

@Test
public void testLoadGroupElements() {
    final HTMLElement inputElement = mock(HTMLElement.class);
    final HTMLElement outputElement = mock(HTMLElement.class);
    final HTMLElement encapsulatedElement = mock(HTMLElement.class);
    when(groupInputs.getElement()).thenReturn(inputElement);
    when(groupOutputs.getElement()).thenReturn(outputElement);
    when(groupEncapsulated.getElement()).thenReturn(encapsulatedElement);
    final elemental2.dom.HTMLElement htmlInput = mock(elemental2.dom.HTMLElement.class);
    final elemental2.dom.HTMLElement htmlOutput = mock(elemental2.dom.HTMLElement.class);
    final elemental2.dom.HTMLElement htmlEncapsulated = mock(elemental2.dom.HTMLElement.class);
    when(util.asHTMLElement(inputElement)).thenReturn(htmlInput);
    when(util.asHTMLElement(outputElement)).thenReturn(htmlOutput);
    when(util.asHTMLElement(encapsulatedElement)).thenReturn(htmlEncapsulated);
    widget.loadGroupsElements();
    verify(container).appendChild(htmlInput);
    verify(container).appendChild(htmlOutput);
    verify(container).appendChild(htmlEncapsulated);
}
Also used : HTMLElement(org.jboss.errai.common.client.dom.HTMLElement) Test(org.junit.Test)

Example 29 with HTMLElement

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

the class ParameterGroupTest method testAddParameter.

@Test
public void testAddParameter() {
    final String name = "name";
    final String type = "type";
    final HTMLElement htmlElement = mock(HTMLElement.class);
    final ParameterItem parameterItem = mock(ParameterItem.class);
    final elemental2.dom.HTMLElement element = mock(elemental2.dom.HTMLElement.class);
    doReturn(parameterItem).when(parameterGroup).createParameterItem();
    when(parameterItem.getElement()).thenReturn(htmlElement);
    when(util.asHTMLElement(htmlElement)).thenReturn(element);
    parameterGroup.addParameter(name, type);
    verify(util).asHTMLElement(htmlElement);
    verify(parameters).appendChild(element);
    verify(parameterGroup).refreshNone();
    assertFalse(parameterGroup.isEmpty());
}
Also used : ParameterItem(org.kie.workbench.common.dmn.client.widgets.decisionservice.parameters.parametergroup.ParameterGroup.ParameterItem) HTMLElement(org.jboss.errai.common.client.dom.HTMLElement) Test(org.junit.Test)

Example 30 with HTMLElement

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

the class NewPropertiesDisplayerViewIpml method showProperty.

@Override
public void showProperty(String property) {
    HTMLElement strong = document.createElement("strong");
    strong.setTextContent(property);
    HTMLElement li = document.createElement("li");
    li.appendChild(strong);
    properties.appendChild(li);
}
Also used : HTMLElement(org.jboss.errai.common.client.dom.HTMLElement)

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