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