Search in sources :

Example 21 with Row

use of org.dominokit.domino.ui.row.Row in project domino-ui-demo by DominoKit.

the class LabelsViewImpl method initMaterialLabels.

private void initMaterialLabels() {
    Card labels = Card.create("LABELS WITH MATERIAL DESIGN COLORS", "You can use material design color with labels");
    Row row = Row.create();
    Column column = Column.create().onLarge(Column.OnLarge.one).onMedium(Column.OnMedium.two).onSmall(Column.OnSmall.six).onXSmall(Column.OnXSmall.twelve);
    HTMLElement red = Label.create("Red").setBackground(Background.RED).asElement();
    HTMLElement pink = Label.create("Pink").setBackground(Background.PINK).asElement();
    HTMLElement purple = Label.create("Purple").setBackground(Background.PURPLE).asElement();
    HTMLElement deepPurple = Label.create("Deep Purple").setBackground(Background.DEEP_PURPLE).asElement();
    HTMLElement indigo = Label.create("Indigo").setBackground(Background.INDIGO).asElement();
    HTMLElement blue = Label.create("Blue").setBackground(Background.BLUE).asElement();
    HTMLElement lightBlue = Label.create("Light Blue").setBackground(Background.LIGHT_BLUE).asElement();
    HTMLElement cyan = Label.create("Cyan").setBackground(Background.CYAN).asElement();
    HTMLElement teal = Label.create("Teal").setBackground(Background.TEAL).asElement();
    HTMLElement green = Label.create("Green").setBackground(Background.GREEN).asElement();
    HTMLElement orange = Label.create("Orange").setBackground(Background.ORANGE).asElement();
    HTMLElement yellow = Label.create("Yellow").setBackground(Background.YELLOW).asElement();
    red.style.margin = CSSProperties.MarginUnionType.of("10px");
    pink.style.margin = CSSProperties.MarginUnionType.of("10px");
    purple.style.margin = CSSProperties.MarginUnionType.of("10px");
    deepPurple.style.margin = CSSProperties.MarginUnionType.of("10px");
    indigo.style.margin = CSSProperties.MarginUnionType.of("10px");
    blue.style.margin = CSSProperties.MarginUnionType.of("10px");
    lightBlue.style.margin = CSSProperties.MarginUnionType.of("10px");
    cyan.style.margin = CSSProperties.MarginUnionType.of("10px");
    teal.style.margin = CSSProperties.MarginUnionType.of("10px");
    green.style.margin = CSSProperties.MarginUnionType.of("10px");
    orange.style.margin = CSSProperties.MarginUnionType.of("10px");
    yellow.style.margin = CSSProperties.MarginUnionType.of("10px");
    row.addColumn(column.addElement(red)).addColumn(column.copy().addElement(pink)).addColumn(column.copy().addElement(purple)).addColumn(column.copy().addElement(deepPurple)).addColumn(column.copy().addElement(indigo)).addColumn(column.copy().addElement(blue)).addColumn(column.copy().addElement(lightBlue)).addColumn(column.copy().addElement(cyan)).addColumn(column.copy().addElement(teal)).addColumn(column.copy().addElement(green)).addColumn(column.copy().addElement(orange)).addColumn(column.copy().addElement(yellow));
    labels.appendContent(row.asElement());
    element.appendChild(labels.asElement());
    element.appendChild(Card.createCodeCard(CodeResource.INSTANCE.initMaterialLabels()).asElement());
}
Also used : HTMLElement(elemental2.dom.HTMLElement) Column(org.dominokit.domino.ui.column.Column) Row(org.dominokit.domino.ui.row.Row) Card(org.dominokit.domino.ui.cards.Card)

Aggregations

Row (org.dominokit.domino.ui.row.Row)21 Column (org.dominokit.domino.ui.column.Column)17 Card (org.dominokit.domino.ui.cards.Card)9 HTMLElement (elemental2.dom.HTMLElement)4 HTMLDivElement (elemental2.dom.HTMLDivElement)3 Text (elemental2.dom.Text)3 UiView (org.dominokit.domino.api.client.annotations.UiView)3 BreadcrumbPresenter (org.dominokit.domino.breadcrumb.client.presenters.BreadcrumbPresenter)3 BreadcrumbView (org.dominokit.domino.breadcrumb.client.views.BreadcrumbView)3 CodeResource (org.dominokit.domino.breadcrumb.client.views.CodeResource)3 ComponentView (org.dominokit.domino.componentcase.shared.extension.ComponentView)3 Breadcrumb (org.dominokit.domino.ui.breadcrumbs.Breadcrumb)3 BlockHeader (org.dominokit.domino.ui.header.BlockHeader)3 Icons (org.dominokit.domino.ui.icons.Icons)3 Background (org.dominokit.domino.ui.style.Background)3 Color (org.dominokit.domino.ui.style.Color)3 Elements (org.jboss.gwt.elemento.core.Elements)3 HTMLHeadingElement (elemental2.dom.HTMLHeadingElement)2 Button (org.dominokit.domino.ui.button.Button)1 ButtonsGroup (org.dominokit.domino.ui.button.group.ButtonsGroup)1