Search in sources :

Example 11 with BlurHandler

use of com.google.gwt.event.dom.client.BlurHandler in project drools-wb by kiegroup.

the class ActionInsertFactFieldsPageViewImpl method initialiseValueList.

private void initialiseValueList() {
    // Copy value back to model
    txtValueList.addValueChangeHandler(new ValueChangeHandler<String>() {

        @Override
        public void onValueChange(final ValueChangeEvent<String> event) {
            final String valueList = txtValueList.getText();
            chosenFieldsSelection.setValueList(valueList);
        // ValueList is optional, no need to advise of state change
        }
    });
    // Update Default Value widget if necessary
    txtValueList.addBlurHandler(new BlurHandler() {

        @Override
        public void onBlur(final BlurEvent event) {
            presenter.assertDefaultValue(chosenFieldsSelection);
            makeDefaultValueWidget();
        }
    });
}
Also used : BlurHandler(com.google.gwt.event.dom.client.BlurHandler) BlurEvent(com.google.gwt.event.dom.client.BlurEvent)

Example 12 with BlurHandler

use of com.google.gwt.event.dom.client.BlurHandler in project drools-wb by kiegroup.

the class FactPatternConstraintsPageViewImpl method initialiseValueList.

private void initialiseValueList() {
    // Copy value back to model
    txtValueList.addValueChangeHandler(new ValueChangeHandler<String>() {

        @Override
        public void onValueChange(final ValueChangeEvent<String> event) {
            final String valueList = txtValueList.getText();
            chosenConditionsSelection.setValueList(valueList);
        // ValueList is optional, no need to advise of state change
        }
    });
    // Update Default Value widget if necessary
    txtValueList.addBlurHandler(new BlurHandler() {

        @Override
        public void onBlur(final BlurEvent event) {
            presenter.assertDefaultValue(availablePatternsSelection, chosenConditionsSelection);
            makeDefaultValueWidget();
        }
    });
}
Also used : BlurHandler(com.google.gwt.event.dom.client.BlurHandler) BlurEvent(com.google.gwt.event.dom.client.BlurEvent)

Example 13 with BlurHandler

use of com.google.gwt.event.dom.client.BlurHandler in project drools-wb by kiegroup.

the class ListBoxSingletonDOMElementFactoryTest method checkDOMElementCreationBlurHandler.

@Test
@SuppressWarnings("unchecked")
public void checkDOMElementCreationBlurHandler() {
    final InOrder order = inOrder(factory);
    final GridBodyCellRenderContext context = mock(GridBodyCellRenderContext.class);
    final Callback<ListBoxDOMElement<String, ListBox>> onCreation = mock(Callback.class);
    final Callback<ListBoxDOMElement<String, ListBox>> onDisplay = mock(Callback.class);
    when(context.getTransform()).thenReturn(mock(Transform.class));
    factory.attachDomElement(context, onCreation, onDisplay);
    final ArgumentCaptor<BlurHandler> blurHandlerCaptor = ArgumentCaptor.forClass(BlurHandler.class);
    verify(listBox).addBlurHandler(blurHandlerCaptor.capture());
    final BlurEvent e = mock(BlurEvent.class);
    final BlurHandler blurHandler = blurHandlerCaptor.getValue();
    blurHandler.onBlur(e);
    order.verify(factory).flush();
    order.verify(factory).destroyResources();
    verify(gridLayer).batch();
    verify(gridLienzoPanel).setFocus(eq(true));
}
Also used : BlurHandler(com.google.gwt.event.dom.client.BlurHandler) InOrder(org.mockito.InOrder) GridBodyCellRenderContext(org.uberfire.ext.wires.core.grids.client.widget.context.GridBodyCellRenderContext) BlurEvent(com.google.gwt.event.dom.client.BlurEvent) Transform(com.ait.lienzo.client.core.types.Transform) Test(org.junit.Test)

Aggregations

BlurEvent (com.google.gwt.event.dom.client.BlurEvent)13 BlurHandler (com.google.gwt.event.dom.client.BlurHandler)13 KeyUpEvent (com.google.gwt.event.dom.client.KeyUpEvent)5 KeyUpHandler (com.google.gwt.event.dom.client.KeyUpHandler)5 ClickEvent (com.google.gwt.event.dom.client.ClickEvent)3 ClickHandler (com.google.gwt.event.dom.client.ClickHandler)3 Element (com.google.gwt.dom.client.Element)2 SpanElement (com.google.gwt.dom.client.SpanElement)2 Transform (com.ait.lienzo.client.core.types.Transform)1 JavaScriptObject (com.google.gwt.core.client.JavaScriptObject)1 FocusEvent (com.google.gwt.event.dom.client.FocusEvent)1 FocusHandler (com.google.gwt.event.dom.client.FocusHandler)1 KeyPressEvent (com.google.gwt.event.dom.client.KeyPressEvent)1 KeyPressHandler (com.google.gwt.event.dom.client.KeyPressHandler)1 Command (com.google.gwt.user.client.Command)1 Element (com.google.gwt.user.client.Element)1 TextBox (com.google.gwt.user.client.ui.TextBox)1 JsonCallbackEvents (cz.metacentrum.perun.webgui.json.JsonCallbackEvents)1 AddMember (cz.metacentrum.perun.webgui.json.groupsManager.AddMember)1 CreateMember (cz.metacentrum.perun.webgui.json.membersManager.CreateMember)1