use of org.jboss.errai.common.client.dom.HTMLElement in project kie-wb-common by kiegroup.
the class DecisionNavigatorTreeViewTest method testTreeItemUpdateCSSClassWhenItemDoesNotHaveChildren.
@Test
public void testTreeItemUpdateCSSClassWhenItemDoesNotHaveChildren() {
final DecisionNavigatorItem item = mock(DecisionNavigatorItem.class);
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.isEditable()).thenReturn(false);
treeItem.updateCSSClass();
verify(classList).add(cssClass);
verify(classList, never()).add("parent-node");
verify(classList, never()).add("editable");
}
use of org.jboss.errai.common.client.dom.HTMLElement in project kie-wb-common by kiegroup.
the class DecisionNavigatorTreeViewTest method testTreeItemUpdateCSSClassWhenItemHasChildren.
@Test
public void testTreeItemUpdateCSSClassWhenItemHasChildren() {
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);
treeItem.updateCSSClass();
verify(classList).add(cssClass);
verify(classList).add("parent-node");
verify(classList).add("editable");
}
use of org.jboss.errai.common.client.dom.HTMLElement in project kie-wb-common by kiegroup.
the class DecisionNavigatorTreeViewTest method testSave.
@Test
public void testSave() {
final HTMLElement element = mock(HTMLElement.class);
final DecisionNavigatorItem item = mock(DecisionNavigatorItem.class);
final org.jboss.errai.common.client.dom.DOMTokenList tokenList = mock(org.jboss.errai.common.client.dom.DOMTokenList.class);
doNothing().when(treeItem).updateLabel();
doReturn(element).when(treeItem).getElement();
doReturn(item).when(treeItem).getItem();
when(element.getClassList()).thenReturn(tokenList);
treeItem.save();
verify(item).setLabel(inputText.value);
verify(tokenList).remove("editing");
verify(treeItem).updateLabel();
verify(item).onUpdate();
verify(locker).fire(any());
}
use of org.jboss.errai.common.client.dom.HTMLElement in project kie-wb-common by kiegroup.
the class SourceConfigurationParamsView method defaultOption.
private HTMLElement defaultOption() {
final HTMLElement option = Window.getDocument().createElement("option");
option.setAttribute("value", "");
option.setAttribute("disabled", "");
option.setAttribute("selected", "");
option.setTextContent(translationService.getTranslation(SourceConfigurationPageView_SelectOption_placeholder));
return option;
}
use of org.jboss.errai.common.client.dom.HTMLElement in project kie-wb-common by kiegroup.
the class FormGeneratorDriver method createRow.
@Override
public HTMLElement createRow(LayoutRow layoutRow) {
HTMLElement row = document.createElement(CONTAINER_TAG);
row.setClassName(ROW_CLASS);
return row;
}
Aggregations