use of org.dominokit.domino.ui.cards.Card in project domino-ui-demo by DominoKit.
the class ButtonsViewImpl method initTextIconButtons.
private void initTextIconButtons() {
Card card = Card.create("ICON & TEXT BUTTONS", "Make icon & text buttons");
HTMLElement extension = IconButton.create(Icons.ALL.extension()).setContent("EXTENSION").asElement();
HTMLElement home = IconButton.createPrimary(Icons.ALL.home()).setContent("HOME").asElement();
HTMLElement lock = IconButton.createSuccess(Icons.ALL.lock()).setContent("LOCK").asElement();
HTMLElement scanWifi = IconButton.createInfo(Icons.ALL.perm_scan_wifi()).setContent("SCAN WIFI").asElement();
HTMLElement takeOff = IconButton.createWarning(Icons.ALL.flight_takeoff()).setContent("TAKE OFF").asElement();
HTMLElement print = IconButton.createDanger(Icons.ALL.print()).setContent("PRINT").asElement();
extension.style.margin = CSSProperties.MarginUnionType.of("5px");
extension.style.minWidth = CSSProperties.MinWidthUnionType.of("120px");
home.style.margin = CSSProperties.MarginUnionType.of("5px");
home.style.minWidth = CSSProperties.MinWidthUnionType.of("120px");
lock.style.margin = CSSProperties.MarginUnionType.of("5px");
lock.style.minWidth = CSSProperties.MinWidthUnionType.of("120px");
scanWifi.style.margin = CSSProperties.MarginUnionType.of("5px");
scanWifi.style.minWidth = CSSProperties.MinWidthUnionType.of("120px");
takeOff.style.margin = CSSProperties.MarginUnionType.of("5px");
takeOff.style.minWidth = CSSProperties.MinWidthUnionType.of("120px");
print.style.margin = CSSProperties.MarginUnionType.of("5px");
print.style.minWidth = CSSProperties.MinWidthUnionType.of("120px");
card.appendContent(extension);
card.appendContent(home);
card.appendContent(lock);
card.appendContent(scanWifi);
card.appendContent(takeOff);
card.appendContent(print);
element.appendChild(card.asElement());
element.appendChild(Card.createCodeCard(CodeResource.INSTANCE.initTextIconButtons()).asElement());
}
use of org.dominokit.domino.ui.cards.Card in project domino-ui-demo by DominoKit.
the class ButtonsViewImpl method initBlockButtons.
private void initBlockButtons() {
Card card = Card.create("BLOCK BUTTONS", "Create block level buttons");
HTMLElement defaultBlock = Button.createDefault("DEFAULT").setBlock(true).asElement();
HTMLElement primaryBlock = Button.createPrimary("PRIMARY").setBlock(true).asElement();
HTMLElement infoBlock = Button.createInfo("INFO").setBlock(true).asElement();
HTMLElement warningBlock = Button.createWarning("WARNING").setBlock(true).asElement();
HTMLElement dangerBlock = Button.createDanger("DANGER").setBlock(true).asElement();
defaultBlock.style.margin = CSSProperties.MarginUnionType.of("5px");
defaultBlock.style.minWidth = CSSProperties.MinWidthUnionType.of("120px");
primaryBlock.style.margin = CSSProperties.MarginUnionType.of("5px");
primaryBlock.style.minWidth = CSSProperties.MinWidthUnionType.of("120px");
infoBlock.style.margin = CSSProperties.MarginUnionType.of("5px");
infoBlock.style.minWidth = CSSProperties.MinWidthUnionType.of("120px");
warningBlock.style.margin = CSSProperties.MarginUnionType.of("5px");
warningBlock.style.minWidth = CSSProperties.MinWidthUnionType.of("120px");
dangerBlock.style.margin = CSSProperties.MarginUnionType.of("5px");
dangerBlock.style.minWidth = CSSProperties.MinWidthUnionType.of("120px");
card.appendContent(defaultBlock);
card.appendContent(primaryBlock);
card.appendContent(infoBlock);
card.appendContent(warningBlock);
card.appendContent(dangerBlock);
element.appendChild(card.asElement());
element.appendChild(Card.createCodeCard(CodeResource.INSTANCE.initBlockButtons()).asElement());
}
use of org.dominokit.domino.ui.cards.Card in project domino-ui-demo by DominoKit.
the class ButtonsViewImpl method initDisabledButtons.
private void initDisabledButtons() {
Card card = Card.create("DISABLED BUTTONS", "Make buttons look unclickable by fading them back with opacity");
HTMLElement defaultDisabled = Button.createDefault("DEFAULT").disable().asElement();
HTMLElement primaryDisabled = Button.createPrimary("PRIMARY").disable().asElement();
HTMLElement infoDisabled = Button.createInfo("INFO").disable().asElement();
HTMLElement warningDisabled = Button.createWarning("WARNING").disable().asElement();
HTMLElement dangerDisabled = Button.createDanger("DANGER").disable().asElement();
defaultDisabled.style.margin = CSSProperties.MarginUnionType.of("5px");
defaultDisabled.style.minWidth = CSSProperties.MinWidthUnionType.of("120px");
primaryDisabled.style.margin = CSSProperties.MarginUnionType.of("5px");
primaryDisabled.style.minWidth = CSSProperties.MinWidthUnionType.of("120px");
infoDisabled.style.margin = CSSProperties.MarginUnionType.of("5px");
infoDisabled.style.minWidth = CSSProperties.MinWidthUnionType.of("120px");
warningDisabled.style.margin = CSSProperties.MarginUnionType.of("5px");
warningDisabled.style.minWidth = CSSProperties.MinWidthUnionType.of("120px");
dangerDisabled.style.margin = CSSProperties.MarginUnionType.of("5px");
dangerDisabled.style.minWidth = CSSProperties.MinWidthUnionType.of("120px");
card.appendContent(defaultDisabled);
card.appendContent(primaryDisabled);
card.appendContent(infoDisabled);
card.appendContent(warningDisabled);
card.appendContent(dangerDisabled);
element.appendChild(card.asElement());
element.appendChild(Card.createCodeCard(CodeResource.INSTANCE.initDisabledButtons()).asElement());
}
use of org.dominokit.domino.ui.cards.Card 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());
}
use of org.dominokit.domino.ui.cards.Card in project domino-ui-demo by DominoKit.
the class ButtonsViewImpl method initVerticalGroup.
private void initVerticalGroup() {
Card verticalGroupCard = Card.create("VERTICAL VARIATION", "Make a set of buttons appear vertically stacked rather than horizontally.");
ButtonsGroup group = ButtonsGroup.create().addButton(Button.createDefault("Button")).addButton(Button.createPrimary("Button")).addDropDown(DropdownButton.createInfo("Dropdown").addAction(DropdownAction.create("Dropdown link")).addAction(DropdownAction.create("Dropdown link"))).addButton(Button.createDanger("Button")).verticalAlign();
group.asElement().style.margin = CSSProperties.MarginUnionType.of("5px");
verticalGroupCard.getBody().appendChild(group.asElement());
element.appendChild(verticalGroupCard.asElement());
element.appendChild(Card.createCodeCard(CodeResource.INSTANCE.initVerticalGroup()).asElement());
}
Aggregations