Search in sources :

Example 76 with Event

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

the class ListSelectorViewImpl method isEscape.

boolean isEscape(final Event event) {
    final KeyboardEvent keyboardEvent = asElemental2Event(event);
    final boolean isEscape = keyboardEvent.key.equals("Esc");
    /* IE/Edge specific value */
    final boolean isEsc = keyboardEvent.key.equals("Escape");
    return isEscape || isEsc;
}
Also used : KeyboardEvent(elemental2.dom.KeyboardEvent)

Example 77 with Event

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

the class NotificationWidgetViewImpl method initEdit.

private void initEdit() {
    AbstractCell<NotificationRow> buttonCell = new AbstractCell<NotificationRow>(ClickEvent.getType().getName()) {

        @Override
        public void render(Context context, NotificationRow value, SafeHtmlBuilder sb) {
            Button button = new Button();
            button.setSize(ButtonSize.SMALL);
            button.add(new Icon(IconType.EDIT));
            sb.append(SafeHtmlUtils.fromTrustedString(button.toString()));
        }

        @Override
        public void onBrowserEvent(Context context, Element parent, NotificationRow value, NativeEvent event, ValueUpdater<NotificationRow> valueUpdater) {
            if (!readOnly) {
                addOrEdit(value);
            }
        }
    };
    Column<NotificationRow, NotificationRow> editColumn = new Column<NotificationRow, NotificationRow>(buttonCell) {

        @Override
        public NotificationRow getValue(NotificationRow object) {
            return object;
        }
    };
    editColumn.setSortable(false);
    table.addColumn(editColumn, StunnerFormsClientFieldsConstants.CONSTANTS.Edit());
    table.setColumnWidth(editColumn, 50, Style.Unit.PX);
}
Also used : Button(org.gwtbootstrap3.client.ui.Button) ValueUpdater(com.google.gwt.cell.client.ValueUpdater) Column(com.google.gwt.user.cellview.client.Column) HTMLButtonElement(elemental2.dom.HTMLButtonElement) Element(com.google.gwt.dom.client.Element) NotificationRow(org.kie.workbench.common.stunner.bpmn.client.forms.fields.model.NotificationRow) AbstractCell(com.google.gwt.cell.client.AbstractCell) Icon(org.gwtbootstrap3.client.ui.Icon) SafeHtmlBuilder(com.google.gwt.safehtml.shared.SafeHtmlBuilder) NativeEvent(com.google.gwt.dom.client.NativeEvent)

Example 78 with Event

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

the class ReassignmentWidgetViewImpl method initEdit.

private void initEdit() {
    AbstractCell<ReassignmentRow> buttonCell = new AbstractCell<ReassignmentRow>(ClickEvent.getType().getName()) {

        @Override
        public void render(Context context, ReassignmentRow value, SafeHtmlBuilder sb) {
            Button button = new Button();
            button.setSize(ButtonSize.SMALL);
            button.add(new Icon(IconType.EDIT));
            sb.append(SafeHtmlUtils.fromTrustedString(button.toString()));
        }

        @Override
        public void onBrowserEvent(Context context, Element parent, ReassignmentRow value, NativeEvent event, ValueUpdater<ReassignmentRow> valueUpdater) {
            if (!readOnly) {
                addOrEdit(value);
            }
        }
    };
    Column<ReassignmentRow, ReassignmentRow> editColumn = new Column<ReassignmentRow, ReassignmentRow>(buttonCell) {

        @Override
        public ReassignmentRow getValue(ReassignmentRow object) {
            return object;
        }
    };
    editColumn.setSortable(false);
    table.addColumn(editColumn, StunnerFormsClientFieldsConstants.CONSTANTS.Edit());
    table.setColumnWidth(editColumn, 50, Style.Unit.PX);
}
Also used : Button(org.gwtbootstrap3.client.ui.Button) ValueUpdater(com.google.gwt.cell.client.ValueUpdater) Column(com.google.gwt.user.cellview.client.Column) HTMLButtonElement(elemental2.dom.HTMLButtonElement) Element(com.google.gwt.dom.client.Element) AbstractCell(com.google.gwt.cell.client.AbstractCell) Icon(org.gwtbootstrap3.client.ui.Icon) SafeHtmlBuilder(com.google.gwt.safehtml.shared.SafeHtmlBuilder) ReassignmentRow(org.kie.workbench.common.stunner.bpmn.client.forms.fields.model.ReassignmentRow) NativeEvent(com.google.gwt.dom.client.NativeEvent)

Example 79 with Event

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

the class ReassignmentWidgetViewImpl method initDelete.

private void initDelete() {
    AbstractCell<ReassignmentRow> buttonCell = new AbstractCell<ReassignmentRow>(ClickEvent.getType().getName()) {

        @Override
        public void render(Context context, ReassignmentRow value, SafeHtmlBuilder sb) {
            Button button = new Button();
            button.setSize(ButtonSize.SMALL);
            button.add(new Icon(IconType.REMOVE));
            sb.append(SafeHtmlUtils.fromTrustedString(button.toString()));
        }

        @Override
        public void onBrowserEvent(Context context, Element parent, ReassignmentRow value, NativeEvent event, ValueUpdater<ReassignmentRow> valueUpdater) {
            if (!readOnly) {
                delete(value);
            }
        }
    };
    Column<ReassignmentRow, ReassignmentRow> deleteColumn = new Column<ReassignmentRow, ReassignmentRow>(buttonCell) {

        @Override
        public ReassignmentRow getValue(ReassignmentRow object) {
            return object;
        }
    };
    deleteColumn.setSortable(false);
    table.addColumn(deleteColumn, presenter.getDeleteLabel());
    table.setColumnWidth(deleteColumn, 60, Style.Unit.PX);
}
Also used : Button(org.gwtbootstrap3.client.ui.Button) ValueUpdater(com.google.gwt.cell.client.ValueUpdater) Column(com.google.gwt.user.cellview.client.Column) HTMLButtonElement(elemental2.dom.HTMLButtonElement) Element(com.google.gwt.dom.client.Element) AbstractCell(com.google.gwt.cell.client.AbstractCell) Icon(org.gwtbootstrap3.client.ui.Icon) SafeHtmlBuilder(com.google.gwt.safehtml.shared.SafeHtmlBuilder) ReassignmentRow(org.kie.workbench.common.stunner.bpmn.client.forms.fields.model.ReassignmentRow) NativeEvent(com.google.gwt.dom.client.NativeEvent)

Example 80 with Event

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

the class SearchView method createView.

public void createView() {
    container = div().add(div().style("width: 100%;").add(div().css("headline").textContent("Search Parameter (search for: 'S' or 'D')")).add(searchName = new TextField("Name")).add(searchCity = new TextField("City")).add(div().css("buttonBar").add(button().css("button").textContent("Search").on(click, event -> getPresenter().doClickSearchButton(searchName.getText(), searchCity.getText()))).add(button().css("button").textContent("Reset").on(click, event -> {
        searchName.setText("");
        searchCity.setText("");
    })).asElement())).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) HTMLDivElement(elemental2.dom.HTMLDivElement) HTMLButtonElement(elemental2.dom.HTMLButtonElement) TextField(de.gishmo.gwt.example.mvp4g2.simpleapplication.client.widgets.TextField) EventType.click(org.jboss.gwt.elemento.core.EventType.click) LazyReverseView(com.github.mvp4g.mvp4g2.core.ui.LazyReverseView) TextField(de.gishmo.gwt.example.mvp4g2.simpleapplication.client.widgets.TextField)

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