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());
}
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());
}
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));
}
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;
}
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;
}
Aggregations