Search in sources :

Example 41 with Event

use of elemental2.dom.Event in project mvp4g2-examples by mvp4g.

the class DetailView method createView.

public void createView() {
    container = div().add(div().style("width: 100%;").add(div().css("headline").textContent("Details")).add(detailFirstName = new TextField("Firstname")).add(detailName = new TextField("Name")).add(detailStreet = new TextField("Street")).add(detailZip = new TextField("Zip")).add(detailCity = new TextField("City")).add(div().css("buttonBar").add(button().css("button").textContent("Save").on(click, event -> {
        updateDetailForm();
        getPresenter().doUpdate(person);
    })).add(button().css("button").textContent("Revert").on(click, event -> {
        getPresenter().doRevert();
    })))).asElement();
}
Also used : Element(elemental2.dom.Element) Elements.button(org.jboss.gwt.elemento.core.Elements.button) Elements.div(org.jboss.gwt.elemento.core.Elements.div) TextField(de.gishmo.gwt.example.mvp4g2.springboot.client.widgets.TextField) HTMLDivElement(elemental2.dom.HTMLDivElement) HTMLButtonElement(elemental2.dom.HTMLButtonElement) Person(de.gishmo.gwt.example.mvp4g2.springboot.client.data.model.dto.Person) EventType.click(org.jboss.gwt.elemento.core.EventType.click) LazyReverseView(com.github.mvp4g.mvp4g2.core.ui.LazyReverseView) TextField(de.gishmo.gwt.example.mvp4g2.springboot.client.widgets.TextField)

Example 42 with Event

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

the class CardsViewImpl method cardsWithHeaders.

private void cardsWithHeaders() {
    element.appendChild(BlockHeader.create("CARDS WITH HEADERS", "cards can have a header that has a Title and an optional description.").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...").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...").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...").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.cardsWithHeaders()).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 43 with Event

use of elemental2.dom.Event in project gwt-react-examples by GWTReact.

the class StatefulExample method doChange.

private void doChange(FormEvent event) {
    HTMLInputElement e = (HTMLInputElement) event.target;
    String val = e.value;
    setState(State.make(val));
}
Also used : HTMLInputElement(elemental2.dom.HTMLInputElement)

Example 44 with Event

use of elemental2.dom.Event in project kie-wb-common by kiegroup.

the class DataTypeShortcuts method tabContentContainsTarget.

boolean tabContentContainsTarget(final Event event) {
    final Element target = getTarget(event);
    final Element tabContent = getTabContent();
    return $.contains(tabContent, target);
}
Also used : Element(elemental2.dom.Element) HTMLInputElement(elemental2.dom.HTMLInputElement)

Example 45 with Event

use of elemental2.dom.Event in project kie-wb-common by kiegroup.

the class DragAndDropHelper method onDragAreaMouseMove.

Object onDragAreaMouseMove(final Event e) {
    if (Objects.isNull(getDragging())) {
        return this;
    }
    final MouseEvent event = (MouseEvent) e;
    final int delta = getDelta(event);
    final int newPosition = getNewPosition();
    final int oldPosition = position(getDragging());
    if (newPosition != oldPosition) {
        swapElements(findElementByPosition(newPosition), getDragging());
    }
    setTop(getDragging(), startYPosition + delta);
    return this;
}
Also used : MouseEvent(elemental2.dom.MouseEvent)

Aggregations

Test (org.junit.Test)50 HTMLElement (elemental2.dom.HTMLElement)27 Event (elemental2.dom.Event)26 KeyboardEvent (elemental2.dom.KeyboardEvent)19 Element (elemental2.dom.Element)18 MouseEvent (elemental2.dom.MouseEvent)16 HTMLDivElement (elemental2.dom.HTMLDivElement)15 HTMLInputElement (elemental2.dom.HTMLInputElement)13 HTMLButtonElement (elemental2.dom.HTMLButtonElement)12 ClickEvent (com.google.gwt.event.dom.client.ClickEvent)10 BlurEvent (com.google.gwt.event.dom.client.BlurEvent)7 CSSStyleDeclaration (elemental2.dom.CSSStyleDeclaration)7 JQuery (org.uberfire.client.views.pfly.selectpicker.JQuery)7 DOMRect (elemental2.dom.DOMRect)5 DOMTokenList (elemental2.dom.DOMTokenList)5 DomGlobal (elemental2.dom.DomGlobal)5 LazyReverseView (com.github.mvp4g.mvp4g2.core.ui.LazyReverseView)4 AbstractCell (com.google.gwt.cell.client.AbstractCell)4 Elements.button (org.jboss.gwt.elemento.core.Elements.button)4 Elements.div (org.jboss.gwt.elemento.core.Elements.div)4