Search in sources :

Example 26 with HTMLElement

use of elemental2.dom.HTMLElement in project domino-ui-demo by DominoKit.

the class ThemesViewImpl method setLayout.

@Override
public void setLayout(final IsLayout layout) {
    HTMLLIElement hideElement = makeIcon(Icons.HARDWARE_ICONS.keyboard_tab());
    hideElement.addEventListener("click", e -> {
        if (nonNull(Elements.label()))
            layout.hideRightPanel();
    });
    card.getHeaderBar().appendChild(hideElement);
    card.asElement().style.marginBottom = CSSProperties.MarginBottomUnionType.of(0);
    card.getBody().style.padding = CSSProperties.PaddingUnionType.of(0);
    card.getBody().appendChild(themesPanel.asElement());
    HTMLElement actionItem = Js.cast(layout.addActionItem("style").get());
    actionItem.addEventListener("click", e -> {
        layout.setRightPanelContent(themesContent());
        layout.showRightPanel();
    });
}
Also used : HTMLElement(elemental2.dom.HTMLElement) HTMLLIElement(elemental2.dom.HTMLLIElement)

Example 27 with HTMLElement

use of elemental2.dom.HTMLElement 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

HTMLElement (elemental2.dom.HTMLElement)27 Card (org.dominokit.domino.ui.cards.Card)14 Column (org.dominokit.domino.ui.column.Column)4 Row (org.dominokit.domino.ui.row.Row)4 Test (org.junit.Test)4 HTMLHeadingElement (elemental2.dom.HTMLHeadingElement)2 Element (elemental2.dom.Element)1 HTMLLIElement (elemental2.dom.HTMLLIElement)1 HTMLSelectElement (elemental2.dom.HTMLSelectElement)1 HTMLUListElement (elemental2.dom.HTMLUListElement)1 Node (elemental2.dom.Node)1 JustifiedGroup (org.dominokit.domino.ui.button.group.JustifiedGroup)1 MessageDialog (org.dominokit.domino.ui.dialogs.MessageDialog)1 GuidedDecisionTableAccordion (org.drools.workbench.screens.guided.dtable.client.editor.page.accordion.GuidedDecisionTableAccordion)1 WorkspaceProject (org.guvnor.common.services.project.model.WorkspaceProject)1 Before (org.junit.Before)1 SettingsPresenter (org.kie.workbench.common.screens.library.client.settings.SettingsPresenter)1 KnowledgeSessionListItemPresenter (org.kie.workbench.common.screens.library.client.settings.knowledgebases.item.knowledgesessions.KnowledgeSessionListItemPresenter)1 Option (org.kie.workbench.common.screens.library.client.settings.util.KieSelectElement.Option)1 ListenerModel (org.kie.workbench.common.services.shared.kmodule.ListenerModel)1