Search in sources :

Example 6 with Text

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());
}
Also used : Icons(org.dominokit.domino.ui.icons.Icons) Accordion(org.dominokit.domino.ui.collapsible.Accordion) UiView(org.dominokit.domino.api.client.annotations.UiView) ComponentView(org.dominokit.domino.componentcase.shared.extension.ComponentView) AccordionPanel(org.dominokit.domino.ui.collapsible.AccordionPanel) CssStyles(org.dominokit.domino.ui.style.CssStyles) Column(org.dominokit.domino.ui.column.Column) BlockHeader(org.dominokit.domino.ui.header.BlockHeader) EventListener(elemental2.dom.EventListener) Color(org.dominokit.domino.ui.style.Color) Row(org.dominokit.domino.ui.row.Row) HTMLDivElement(elemental2.dom.HTMLDivElement) Text(elemental2.dom.Text) CollapseView(org.dominokit.domino.collapse.client.views.CollapseView) Collapsible(org.dominokit.domino.ui.collapsible.Collapsible) CodeResource(org.dominokit.domino.collapse.client.views.CodeResource) Card(org.dominokit.domino.ui.cards.Card) CollapsePresenter(org.dominokit.domino.collapse.client.presenters.CollapsePresenter) Button(org.dominokit.domino.ui.button.Button) Elements(org.jboss.gwt.elemento.core.Elements) Background(org.dominokit.domino.ui.style.Background) Button(org.dominokit.domino.ui.button.Button) Text(elemental2.dom.Text) Collapsible(org.dominokit.domino.ui.collapsible.Collapsible) EventListener(elemental2.dom.EventListener)

Example 7 with Text

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());
}
Also used : Icons(org.dominokit.domino.ui.icons.Icons) UiView(org.dominokit.domino.api.client.annotations.UiView) CardsPresenter(org.dominokit.domino.cards.client.presenters.CardsPresenter) DomGlobal(elemental2.dom.DomGlobal) ComponentView(org.dominokit.domino.componentcase.shared.extension.ComponentView) CodeResource(org.dominokit.domino.cards.client.views.CodeResource) Column(org.dominokit.domino.ui.column.Column) BlockHeader(org.dominokit.domino.ui.header.BlockHeader) CardsView(org.dominokit.domino.cards.client.views.CardsView) Row(org.dominokit.domino.ui.row.Row) HTMLDivElement(elemental2.dom.HTMLDivElement) Text(elemental2.dom.Text) Card(org.dominokit.domino.ui.cards.Card) Elements(org.jboss.gwt.elemento.core.Elements) Background(org.dominokit.domino.ui.style.Background) Column(org.dominokit.domino.ui.column.Column) Text(elemental2.dom.Text)

Example 8 with Text

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());
}
Also used : Icons(org.dominokit.domino.ui.icons.Icons) UiView(org.dominokit.domino.api.client.annotations.UiView) CardsPresenter(org.dominokit.domino.cards.client.presenters.CardsPresenter) DomGlobal(elemental2.dom.DomGlobal) ComponentView(org.dominokit.domino.componentcase.shared.extension.ComponentView) CodeResource(org.dominokit.domino.cards.client.views.CodeResource) Column(org.dominokit.domino.ui.column.Column) BlockHeader(org.dominokit.domino.ui.header.BlockHeader) CardsView(org.dominokit.domino.cards.client.views.CardsView) Row(org.dominokit.domino.ui.row.Row) HTMLDivElement(elemental2.dom.HTMLDivElement) Text(elemental2.dom.Text) Card(org.dominokit.domino.ui.cards.Card) Elements(org.jboss.gwt.elemento.core.Elements) Background(org.dominokit.domino.ui.style.Background) Column(org.dominokit.domino.ui.column.Column) Text(elemental2.dom.Text)

Example 9 with Text

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);
}
Also used : HTMLElement(elemental2.dom.HTMLElement) EventHandler(org.jboss.errai.ui.shared.api.annotations.EventHandler)

Example 10 with Text

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);
}
Also used : HTMLOptionElement(elemental2.dom.HTMLOptionElement) Test(org.junit.Test)

Aggregations

Text (elemental2.dom.Text)15 Column (org.dominokit.domino.ui.column.Column)11 Row (org.dominokit.domino.ui.row.Row)9 HTMLDivElement (elemental2.dom.HTMLDivElement)8 Card (org.dominokit.domino.ui.cards.Card)7 UiView (org.dominokit.domino.api.client.annotations.UiView)6 ComponentView (org.dominokit.domino.componentcase.shared.extension.ComponentView)6 BlockHeader (org.dominokit.domino.ui.header.BlockHeader)6 Background (org.dominokit.domino.ui.style.Background)6 Elements (org.jboss.gwt.elemento.core.Elements)5 HTMLElement (elemental2.dom.HTMLElement)4 Icons (org.dominokit.domino.ui.icons.Icons)4 Test (org.junit.Test)4 DomGlobal (elemental2.dom.DomGlobal)3 EventListener (elemental2.dom.EventListener)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 Element (elemental2.dom.Element)2