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();
});
}
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());
}
Aggregations