Class ConnectorFocusAndBlurHandler

  • All Implemented Interfaces:
    com.google.gwt.event.dom.client.BlurHandler, com.google.gwt.event.dom.client.FocusHandler, com.google.gwt.event.shared.EventHandler, StateChangeEvent.StateChangeHandler, Serializable

    public class ConnectorFocusAndBlurHandler
    extends Object
    implements StateChangeEvent.StateChangeHandler, com.google.gwt.event.dom.client.FocusHandler, com.google.gwt.event.dom.client.BlurHandler
    A handler for focus and blur events which uses FieldRpc.FocusAndBlurServerRpc to transmit received events to the server. Events are only handled if there is a corresponding listener on the server side.
    Since:
    7.6
    Author:
    Vaadin Ltd
    See Also:
    Serialized Form
    • Method Detail

      • addHandlers

        public static ConnectorFocusAndBlurHandler addHandlers​(AbstractComponentConnector connector)
        Add focus/blur handlers to the widget of the connector.
        Parameters:
        connector - connector whose widget is a target to add focus/blur handlers
        Returns:
        ConnectorFocusAndBlurHandler instance to remove all registered handlers
      • addHandlers

        public static ConnectorFocusAndBlurHandler addHandlers​(AbstractComponentConnector connector,
                                                               com.google.gwt.user.client.ui.Widget widget)
        Add focus/blur handlers to the widget and a state change handler for the connector.
        Parameters:
        connector - connector to register state change handler
        widget - widget to register focus/blur handler
        Returns:
        ConnectorFocusAndBlurHandler instance to remove all registered handlers
      • onFocus

        public void onFocus​(com.google.gwt.event.dom.client.FocusEvent event)
        Specified by:
        onFocus in interface com.google.gwt.event.dom.client.FocusHandler
      • onBlur

        public void onBlur​(com.google.gwt.event.dom.client.BlurEvent event)
        Specified by:
        onBlur in interface com.google.gwt.event.dom.client.BlurHandler
      • removeHandlers

        public void removeHandlers()
        Remove all handlers from the widget and the connector.