Search in sources :

Example 16 with HTMLElement

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());
}
Also used : HTMLElement(elemental2.dom.HTMLElement) Test(org.junit.Test)

Example 17 with HTMLElement

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();
    }
}
Also used : HTMLElement(elemental2.dom.HTMLElement) SettingsPresenter(org.kie.workbench.common.screens.library.client.settings.SettingsPresenter) Test(org.junit.Test)

Example 18 with HTMLElement

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());
}
Also used : ListenerModel(org.kie.workbench.common.services.shared.kmodule.ListenerModel) HTMLElement(elemental2.dom.HTMLElement) KnowledgeSessionListItemPresenter(org.kie.workbench.common.screens.library.client.settings.knowledgebases.item.knowledgesessions.KnowledgeSessionListItemPresenter) Test(org.junit.Test)

Example 19 with HTMLElement

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);
}
Also used : HTMLElement(elemental2.dom.HTMLElement) GuidedDecisionTableAccordion(org.drools.workbench.screens.guided.dtable.client.editor.page.accordion.GuidedDecisionTableAccordion)

Example 20 with 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());
}
Also used : HTMLElement(elemental2.dom.HTMLElement) Card(org.dominokit.domino.ui.cards.Card)

Aggregations

HTMLElement (elemental2.dom.HTMLElement)27 Card (org.dominokit.domino.ui.cards.Card)14 Column (org.dominokit.domino.ui.column.Column)4 Row (org.dominokit.domino.ui.row.Row)4 Test (org.junit.Test)4 HTMLHeadingElement (elemental2.dom.HTMLHeadingElement)2 Element (elemental2.dom.Element)1 HTMLLIElement (elemental2.dom.HTMLLIElement)1 HTMLSelectElement (elemental2.dom.HTMLSelectElement)1 HTMLUListElement (elemental2.dom.HTMLUListElement)1 Node (elemental2.dom.Node)1 JustifiedGroup (org.dominokit.domino.ui.button.group.JustifiedGroup)1 MessageDialog (org.dominokit.domino.ui.dialogs.MessageDialog)1 GuidedDecisionTableAccordion (org.drools.workbench.screens.guided.dtable.client.editor.page.accordion.GuidedDecisionTableAccordion)1 WorkspaceProject (org.guvnor.common.services.project.model.WorkspaceProject)1 Before (org.junit.Before)1 SettingsPresenter (org.kie.workbench.common.screens.library.client.settings.SettingsPresenter)1 KnowledgeSessionListItemPresenter (org.kie.workbench.common.screens.library.client.settings.knowledgebases.item.knowledgesessions.KnowledgeSessionListItemPresenter)1 Option (org.kie.workbench.common.screens.library.client.settings.util.KieSelectElement.Option)1 ListenerModel (org.kie.workbench.common.services.shared.kmodule.ListenerModel)1