Search in sources :

Example 1 with Collapsible

use of org.dominokit.domino.ui.collapsible.Collapsible in project domino-ui-demo by DominoKit.

the class CollapseViewImpl method example.

private void example() {
    Collapsible collapsible = Collapsible.create(Elements.div().add(Elements.div().css("well").textContent(SAMPLE_CONTENT).asElement()).asElement());
    EventListener collapsibleListener = evt -> {
        if (collapsible.isCollapsed())
            collapsible.expand();
        else
            collapsible.collapse();
    };
    Button anchorButton = Button.create("LINK WITH HREF");
    anchorButton.justify();
    anchorButton.getClickableElement().addEventListener("click", collapsibleListener);
    Button button = Button.create("BUTTON");
    button.getClickableElement().addEventListener("click", collapsibleListener);
    element.appendChild(Row.create().addColumn(column.copy().addElement(Card.create("EXAMPLE", "click the buttons below to show and hide another element via class changes.").appendContent(anchorButton.htmlBuilder().css(CssStyles.M_B_15).component().setBackground(Background.PINK).asElement()).appendContent(new Text("\n")).appendContent(button.htmlBuilder().css(CssStyles.M_B_15).component().setBackground(Background.CYAN).asElement()).appendContent(collapsible.asElement()).asElement())).asElement());
    element.appendChild(Card.createCodeCard(CodeResource.INSTANCE.example()).asElement());
}
Also used : Icons(org.dominokit.domino.ui.icons.Icons) Accordion(org.dominokit.domino.ui.collapsible.Accordion) UiView(org.dominokit.domino.api.client.annotations.UiView) ComponentView(org.dominokit.domino.componentcase.shared.extension.ComponentView) AccordionPanel(org.dominokit.domino.ui.collapsible.AccordionPanel) CssStyles(org.dominokit.domino.ui.style.CssStyles) Column(org.dominokit.domino.ui.column.Column) BlockHeader(org.dominokit.domino.ui.header.BlockHeader) EventListener(elemental2.dom.EventListener) Color(org.dominokit.domino.ui.style.Color) Row(org.dominokit.domino.ui.row.Row) HTMLDivElement(elemental2.dom.HTMLDivElement) Text(elemental2.dom.Text) CollapseView(org.dominokit.domino.collapse.client.views.CollapseView) Collapsible(org.dominokit.domino.ui.collapsible.Collapsible) CodeResource(org.dominokit.domino.collapse.client.views.CodeResource) Card(org.dominokit.domino.ui.cards.Card) CollapsePresenter(org.dominokit.domino.collapse.client.presenters.CollapsePresenter) Button(org.dominokit.domino.ui.button.Button) Elements(org.jboss.gwt.elemento.core.Elements) Background(org.dominokit.domino.ui.style.Background) Button(org.dominokit.domino.ui.button.Button) Text(elemental2.dom.Text) Collapsible(org.dominokit.domino.ui.collapsible.Collapsible) EventListener(elemental2.dom.EventListener)

Aggregations

EventListener (elemental2.dom.EventListener)1 HTMLDivElement (elemental2.dom.HTMLDivElement)1 Text (elemental2.dom.Text)1 UiView (org.dominokit.domino.api.client.annotations.UiView)1 CollapsePresenter (org.dominokit.domino.collapse.client.presenters.CollapsePresenter)1 CodeResource (org.dominokit.domino.collapse.client.views.CodeResource)1 CollapseView (org.dominokit.domino.collapse.client.views.CollapseView)1 ComponentView (org.dominokit.domino.componentcase.shared.extension.ComponentView)1 Button (org.dominokit.domino.ui.button.Button)1 Card (org.dominokit.domino.ui.cards.Card)1 Accordion (org.dominokit.domino.ui.collapsible.Accordion)1 AccordionPanel (org.dominokit.domino.ui.collapsible.AccordionPanel)1 Collapsible (org.dominokit.domino.ui.collapsible.Collapsible)1 Column (org.dominokit.domino.ui.column.Column)1 BlockHeader (org.dominokit.domino.ui.header.BlockHeader)1 Icons (org.dominokit.domino.ui.icons.Icons)1 Row (org.dominokit.domino.ui.row.Row)1 Background (org.dominokit.domino.ui.style.Background)1 Color (org.dominokit.domino.ui.style.Color)1 CssStyles (org.dominokit.domino.ui.style.CssStyles)1