use of elemental2.dom.HTMLElement in project kie-wb-common by kiegroup.
the class AssetsScreenTest method testSetContentNotCalledWhenAlreadyDisplayed.
@Test
public void testSetContentNotCalledWhenAlreadyDisplayed() throws Exception {
try {
testShowEmptyScreenAssets();
} catch (AssertionError ae) {
throw new AssertionError("Precondition failed. Could not set empty asset screen.", ae);
}
HTMLElement emptyElement = emptyAssetsScreen.getView().getElement();
emptyElement.parentNode = mock(HTMLElement.class);
reset(view);
assetsScreen.init();
verify(view, never()).setContent(any());
}
use of elemental2.dom.HTMLElement in project kie-wb-common by kiegroup.
the class ProjectScreenTest method testShowSettings.
@Test
public void testShowSettings() {
SettingsPresenter.View settingsView = mock(SettingsPresenter.View.class);
when(settingsView.getElement()).thenReturn(new HTMLElement());
when(this.settingsPresenter.getView()).thenReturn(settingsView);
{
doReturn(false).when(this.presenter).userCanUpdateProject();
this.presenter.showSettings();
verify(this.settingsPresenter, never()).onOpen();
}
{
doReturn(true).when(this.presenter).userCanUpdateProject();
this.presenter.showSettings();
verify(this.settingsPresenter, times(1)).onOpen();
}
}
use of elemental2.dom.HTMLElement in project kie-wb-common by kiegroup.
the class ListenerListItemPresenterTest method testSetup.
@Test
public void testSetup() {
final ListenerModel listenerModel = new ListenerModel();
listenerModel.setType("Type");
listenerModel.setKind(ListenerModel.Kind.RULE_RUNTIME_EVENT_LISTENER);
final HTMLElement selectContainer = mock(HTMLElement.class);
doReturn(selectContainer).when(view).getKindSelectContainer();
final ListenerListItemPresenter result = listenerListItemPresenter.setup(listenerModel, mock(KnowledgeSessionListItemPresenter.class));
Assert.assertEquals(result, listenerListItemPresenter);
verify(view).init(eq(listenerListItemPresenter));
verify(view).setType(eq("Type"));
verify(kindSelect).setup(eq(selectContainer), eq(ListenerModel.Kind.values()), eq(ListenerModel.Kind.RULE_RUNTIME_EVENT_LISTENER), any());
}
use of elemental2.dom.HTMLElement in project drools-wb by kiegroup.
the class ColumnsPageView method setAccordion.
@Override
public void setAccordion(final GuidedDecisionTableAccordion accordion) {
final GuidedDecisionTableAccordion.View view = accordion.getView();
final HTMLElement htmlElement = elemental2DomUtil.asHTMLElement(view.getElement());
elemental2DomUtil.removeAllElementChildren(accordionContainer);
accordionContainer.appendChild(htmlElement);
}
use of elemental2.dom.HTMLElement in project domino-ui-demo by DominoKit.
the class ButtonsViewImpl method initSplitButton.
private void initSplitButton() {
Card card = Card.create("SPLITE BUTTON DROPDOWNS", "Similarly, create split button dropdowns with the same markup changes, only with a separate button.");
DropdownButton defaultDropdown = DropdownButton.createDefault("Toggle Dropdown").addAction(DropdownAction.create("Action")).addAction(DropdownAction.create("Another action")).addAction(DropdownAction.create("Something else here")).separator().addAction(DropdownAction.create("Separated link"));
HTMLElement defaultSplit = SplitButton.createDefault("DEFAULT").addDropdown(defaultDropdown).asElement();
card.appendContent(defaultSplit);
DropdownButton primaryDropdown = DropdownButton.createPrimary("Toggle Dropdown").addAction(DropdownAction.create("Action")).addAction(DropdownAction.create("Another action")).addAction(DropdownAction.create("Something else here")).separator().addAction(DropdownAction.create("Separated link"));
HTMLElement primarySplit = SplitButton.createPrimary("PRIMARY").addDropdown(primaryDropdown).asElement();
card.appendContent(primarySplit);
DropdownButton warningDropdown = DropdownButton.createWarning("Toggle Dropdown").addAction(DropdownAction.create("Action")).addAction(DropdownAction.create("Another action")).addAction(DropdownAction.create("Something else here")).separator().addAction(DropdownAction.create("Separated link"));
HTMLElement warningSplit = SplitButton.createWarning("WARNING").addDropdown(warningDropdown).asElement();
card.appendContent(warningSplit);
DropdownButton infoDropdown = DropdownButton.createInfo("Toggle Dropdown").addAction(DropdownAction.create("Action")).addAction(DropdownAction.create("Another action")).addAction(DropdownAction.create("Something else here")).separator().addAction(DropdownAction.create("Separated link"));
HTMLElement infoSplit = SplitButton.createInfo("INFO").addDropdown(infoDropdown).asElement();
card.appendContent(infoSplit);
defaultSplit.style.margin = CSSProperties.MarginUnionType.of("10px");
primarySplit.style.margin = CSSProperties.MarginUnionType.of("10px");
warningSplit.style.margin = CSSProperties.MarginUnionType.of("10px");
infoSplit.style.margin = CSSProperties.MarginUnionType.of("10px");
this.element.appendChild(card.asElement());
element.appendChild(Card.createCodeCard(CodeResource.INSTANCE.initSplitButton()).asElement());
}
Aggregations