Search in sources :

Example 36 with HTMLElement

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

the class DecisionNavigatorTreeViewTest method testTreeItemUpdateCSSClassWhenItemHasChildrenAndIsReadOnly.

@Test
public void testTreeItemUpdateCSSClassWhenItemHasChildrenAndIsReadOnly() {
    final DecisionNavigatorItem item = mock(DecisionNavigatorItem.class);
    final DecisionNavigatorItem child = mock(DecisionNavigatorItem.class);
    final TreeSet<DecisionNavigatorItem> children = new TreeSet<DecisionNavigatorItem>() {

        {
            add(child);
        }
    };
    final org.jboss.errai.common.client.dom.DOMTokenList classList = mock(org.jboss.errai.common.client.dom.DOMTokenList.class);
    final HTMLElement element = mock(HTMLElement.class);
    final String cssClass = "css-class";
    doReturn(item).when(treeItem).getItem();
    doReturn(element).when(treeItem).getElement();
    doReturn(cssClass).when(treeItem).getCSSClass(item);
    when(element.getClassList()).thenReturn(classList);
    when(item.getChildren()).thenReturn(children);
    when(item.isEditable()).thenReturn(true);
    when(readOnlyProvider.isReadOnlyDiagram()).thenReturn(true);
    treeItem.updateCSSClass();
    verify(classList).add(cssClass);
    verify(classList).add("parent-node");
    verify(classList, never()).add("editable");
}
Also used : DecisionNavigatorItem(org.kie.workbench.common.dmn.client.docks.navigator.DecisionNavigatorItem) HTMLElement(org.jboss.errai.common.client.dom.HTMLElement) TreeSet(java.util.TreeSet) Test(org.junit.Test)

Example 37 with HTMLElement

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

the class DefinitionPaletteCategoryWidgetTest 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 38 with HTMLElement

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

the class LibraryScreenTest method showProjectsTest.

@Test
public void showProjectsTest() {
    doReturn(true).when(view).isProjectsTabActive();
    doReturn(true).when(libraryService).hasProjects(any());
    final HTMLElement populatedLibraryScreenElement = mock(HTMLElement.class);
    when(populatedLibraryScreen.getView().getElement()).thenReturn(populatedLibraryScreenElement);
    doReturn(3).when(populatedLibraryScreen).getProjectsCount();
    libraryScreen.showProjects();
    verify(view).updateContent(populatedLibraryScreenElement);
    verify(view).setProjectsCount(3);
}
Also used : HTMLElement(org.jboss.errai.common.client.dom.HTMLElement) Test(org.junit.Test)

Example 39 with HTMLElement

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

the class FormGeneratorDriver method createContainer.

@Override
public HTMLElement createContainer() {
    HTMLElement container = document.createElement(CONTAINER_TAG);
    container.setClassName(ColumnSize.MD_12.getCssName());
    return container;
}
Also used : HTMLElement(org.jboss.errai.common.client.dom.HTMLElement)

Example 40 with HTMLElement

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

the class FormGeneratorDriver method createColumn.

@Override
public HTMLElement createColumn(LayoutColumn layoutColumn) {
    HTMLElement column = document.createElement(CONTAINER_TAG);
    String colSize = ColumnSizeBuilder.buildColumnSize(new Integer(layoutColumn.getSpan()));
    column.setClassName(colSize);
    return column;
}
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