Search in sources :

Example 16 with Card

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

Example 17 with Card

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

Example 18 with Card

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

Example 19 with Card

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

Example 20 with Card

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());
}
Also used : ButtonsGroup(org.dominokit.domino.ui.button.group.ButtonsGroup) Card(org.dominokit.domino.ui.cards.Card)

Aggregations

Card (org.dominokit.domino.ui.cards.Card)24 HTMLElement (elemental2.dom.HTMLElement)14 Row (org.dominokit.domino.ui.row.Row)10 Column (org.dominokit.domino.ui.column.Column)8 HTMLDivElement (elemental2.dom.HTMLDivElement)5 Text (elemental2.dom.Text)4 UiView (org.dominokit.domino.api.client.annotations.UiView)4 ComponentView (org.dominokit.domino.componentcase.shared.extension.ComponentView)4 BlockHeader (org.dominokit.domino.ui.header.BlockHeader)4 Background (org.dominokit.domino.ui.style.Background)4 Elements (org.jboss.gwt.elemento.core.Elements)4 DomGlobal (elemental2.dom.DomGlobal)3 CardsPresenter (org.dominokit.domino.cards.client.presenters.CardsPresenter)3 CardsView (org.dominokit.domino.cards.client.views.CardsView)3 CodeResource (org.dominokit.domino.cards.client.views.CodeResource)3 Button (org.dominokit.domino.ui.button.Button)3 Icons (org.dominokit.domino.ui.icons.Icons)3 HTMLHeadingElement (elemental2.dom.HTMLHeadingElement)2 ButtonsGroup (org.dominokit.domino.ui.button.group.ButtonsGroup)2 Timer (com.google.gwt.user.client.Timer)1