use of elemental2.dom.Text in project domino-ui-demo by DominoKit.
the class CollapseViewImpl method example.
private void example() {
Collapsible collapsible = Collapsible.create(Elements.div().add(Elements.div().css("well").textContent(SAMPLE_CONTENT).asElement()).asElement());
EventListener collapsibleListener = evt -> {
if (collapsible.isCollapsed())
collapsible.expand();
else
collapsible.collapse();
};
Button anchorButton = Button.create("LINK WITH HREF");
anchorButton.justify();
anchorButton.getClickableElement().addEventListener("click", collapsibleListener);
Button button = Button.create("BUTTON");
button.getClickableElement().addEventListener("click", collapsibleListener);
element.appendChild(Row.create().addColumn(column.copy().addElement(Card.create("EXAMPLE", "click the buttons below to show and hide another element via class changes.").appendContent(anchorButton.htmlBuilder().css(CssStyles.M_B_15).component().setBackground(Background.PINK).asElement()).appendContent(new Text("\n")).appendContent(button.htmlBuilder().css(CssStyles.M_B_15).component().setBackground(Background.CYAN).asElement()).appendContent(collapsible.asElement()).asElement())).asElement());
element.appendChild(Card.createCodeCard(CodeResource.INSTANCE.example()).asElement());
}
use of elemental2.dom.Text in project domino-ui-demo by DominoKit.
the class CardsViewImpl method coloredCards.
private void coloredCards() {
element.appendChild(BlockHeader.create("COLORED CARDS", "You can control the background color of card, card header and card body.").asElement());
Column column = Column.create().onLarge(OnLarge.four).onMedium(OnMedium.four).onSmall(OnSmall.twelve).onXSmall(OnXSmall.twelve);
element.appendChild(Row.create().addColumn(column.addElement(Card.create("Light Blue Card", "Description text here...").setBackground(Background.LIGHT_BLUE).appendContent(new Text(SAMPLE_CONTENT)).addHeaderAction(Icons.ALL.more_vert(), event -> DomGlobal.console.info("More action selected")).asElement())).addColumn(column.copy().addElement(Card.create("Light Green Card", "Description text here...").setBackground(Background.LIGHT_GREEN).appendContent(new Text(SAMPLE_CONTENT)).addHeaderAction(Icons.AV_ICONS.mic(), event -> DomGlobal.console.info("Play sound")).asElement())).addColumn(column.copy().addElement(Card.create("Amber card", "Description text here...").setBackground(Background.AMBER).appendContent(new Text(SAMPLE_CONTENT)).addHeaderAction(Icons.AV_ICONS.mic(), event -> DomGlobal.console.info("Play sound")).addHeaderAction(Icons.NAVIGATION_ICONS.more_vert(), event -> DomGlobal.console.info("More action selected")).asElement())).asElement());
element.appendChild(Row.create().addColumn(column.copy().addElement(Card.create("Pink Card", "Description text here...").setHeaderBackground(Background.PINK).appendContent(new Text(SAMPLE_CONTENT)).addHeaderAction(Icons.ALL.more_vert(), event -> DomGlobal.console.info("More action selected")).asElement())).addColumn(column.copy().addElement(Card.create("Blue Grey Card", "Description text here...").setHeaderBackground(Background.BLUE_GREY).appendContent(new Text(SAMPLE_CONTENT)).addHeaderAction(Icons.AV_ICONS.mic(), event -> DomGlobal.console.info("Play sound")).asElement())).addColumn(column.copy().addElement(Card.create("Deep Orange card", "Description text here...").setHeaderBackground(Background.DEEP_ORANGE).appendContent(new Text(SAMPLE_CONTENT)).addHeaderAction(Icons.AV_ICONS.mic(), event -> DomGlobal.console.info("Play sound")).addHeaderAction(Icons.NAVIGATION_ICONS.more_vert(), event -> DomGlobal.console.info("More action selected")).asElement())).asElement());
element.appendChild(Row.create().addColumn(column.copy().addElement(Card.create("Light Blue Card", "Description text here...").setHeaderBackground(Background.BLUE).setBodyBackground(Background.LIGHT_BLUE).appendContent(new Text(SAMPLE_CONTENT)).addHeaderAction(Icons.ALL.more_vert(), event -> DomGlobal.console.info("More action selected")).asElement())).addColumn(column.copy().addElement(Card.create("Light Green Card", "Description text here...").setHeaderBackground(Background.GREEN).setBodyBackground(Background.LIGHT_GREEN).appendContent(new Text(SAMPLE_CONTENT)).addHeaderAction(Icons.AV_ICONS.mic(), event -> DomGlobal.console.info("Play sound")).asElement())).addColumn(column.copy().addElement(Card.create("Amber card", "Description text here...").setHeaderBackground(Background.ORANGE).setBodyBackground(Background.AMBER).appendContent(new Text(SAMPLE_CONTENT)).addHeaderAction(Icons.AV_ICONS.mic(), event -> DomGlobal.console.info("Play sound")).addHeaderAction(Icons.NAVIGATION_ICONS.more_vert(), event -> DomGlobal.console.info("More action selected")).asElement())).asElement());
element.appendChild(Card.createCodeCard(CodeResource.INSTANCE.coloredCards()).asElement());
}
use of elemental2.dom.Text in project domino-ui-demo by DominoKit.
the class CardsViewImpl method collapsibleCards.
private void collapsibleCards() {
element.appendChild(BlockHeader.create("COLLAPSIBLE CARDS", "cards can be collapsible.").asElement());
Column column = Column.create().onLarge(OnLarge.four).onMedium(OnMedium.four).onSmall(OnSmall.twelve).onXSmall(OnXSmall.twelve);
element.appendChild(Row.create().addColumn(column.addElement(Card.create("Card Title", "Description text here...").setCollapsible().setHeaderBackground(Background.THEME).appendContent(new Text(SAMPLE_CONTENT)).addHeaderAction(Icons.ALL.more_vert(), event -> DomGlobal.console.info("More action selected")).asElement())).addColumn(column.copy().addElement(Card.create("Card Title", "Description text here...").setCollapsible().setHeaderBackground(Background.BROWN).appendContent(new Text(SAMPLE_CONTENT)).addHeaderAction(Icons.AV_ICONS.mic(), event -> DomGlobal.console.info("Play sound")).asElement())).addColumn(column.copy().addElement(Card.create("Card Title", "Description text here...").setCollapsible().collapse().setHeaderBackground(Background.CYAN).appendContent(new Text(SAMPLE_CONTENT)).addHeaderAction(Icons.AV_ICONS.mic(), event -> DomGlobal.console.info("Play sound")).addHeaderAction(Icons.NAVIGATION_ICONS.more_vert(), event -> DomGlobal.console.info("More action selected")).asElement())).asElement());
element.appendChild(Card.createCodeCard(CodeResource.INSTANCE.collapsibleCards()).asElement());
}
use of elemental2.dom.Text in project kie-wb-common by kiegroup.
the class DataTypeSelectView method onTypeTextClick.
@EventHandler("type-text")
public void onTypeTextClick(final ClickEvent event) {
final String type = presenter.getDataType().getType();
final HTMLElement element = getElement();
if (!isBuiltInType(type)) {
structureTypesTooltip.show(element, type);
}
skipClickListeners(event);
}
use of elemental2.dom.Text in project kie-wb-common by kiegroup.
the class TimeSelectorViewTest method testCreateNoneOption.
@Test
public void testCreateNoneOption() {
final HTMLOptionElement noneOption = new HTMLOptionElement();
final String text = "text";
when(translationService.getValue(NONE_TRANSLATION_KEY)).thenReturn(text);
doReturn(noneOption).when(view).getNewOption();
view.createNoneOption();
assertEquals(NONE_VALUE, noneOption.value);
assertEquals(text, noneOption.text);
}
Aggregations