Search in sources :

Example 1 with JustifiedGroup

use of org.dominokit.domino.ui.button.group.JustifiedGroup in project domino-ui-demo by DominoKit.

the class ButtonsViewImpl method initJustifyGroup.

private void initJustifyGroup() {
    Card justifiedGroupCard = Card.create("JUSTIFIED BUTTON GROUPS", "Make a group of buttons stretch at equal sizes to span the entire width of its parent. Also works with button dropdowns within the button group.");
    DropdownButton dropDown = DropdownButton.createDefault("Drop down").addAction(DropdownAction.create("Action")).separator().addAction(DropdownAction.create("Action2"));
    JustifiedGroup justifiedGroup = JustifiedGroup.create();
    justifiedGroup.addButton(Button.createPrimary("LEFT"));
    justifiedGroup.addButton(Button.createInfo("MIDDLE"));
    justifiedGroup.addButton(Button.createDanger("RIGHT"));
    justifiedGroup.addDropDown(dropDown);
    HTMLElement element1 = justifiedGroup.asElement();
    element1.style.margin = CSSProperties.MarginUnionType.of("5px");
    element1.style.minWidth = CSSProperties.MinWidthUnionType.of("120px");
    justifiedGroupCard.getBody().appendChild(justifiedGroup.asElement());
    element.appendChild(justifiedGroupCard.asElement());
    element.appendChild(Card.createCodeCard(CodeResource.INSTANCE.initJustifyGroup()).asElement());
}
Also used : JustifiedGroup(org.dominokit.domino.ui.button.group.JustifiedGroup) HTMLElement(elemental2.dom.HTMLElement) Card(org.dominokit.domino.ui.cards.Card)

Aggregations

HTMLElement (elemental2.dom.HTMLElement)1 JustifiedGroup (org.dominokit.domino.ui.button.group.JustifiedGroup)1 Card (org.dominokit.domino.ui.cards.Card)1