Class ClickEventHandler

  • All Implemented Interfaces:
    ej.microui.event.EventHandler

    public class ClickEventHandler
    extends PointerEventHandler
    The click event handler responsibility is to detect pointer events (press, drag, release) and help interact with a button-like interactive element.
    Since:
    4.3.0
    • Constructor Detail

      • ClickEventHandler

        public ClickEventHandler​(ej.mwt.Widget widget,
                                 Clickable clickable)
        Creates a swipe event handler on an element.
        Parameters:
        widget - the attached widget.
        clickable - the clickable.
    • Method Detail

      • setOnClickListener

        public void setOnClickListener​(@Nullable
                                       OnClickListener onClickListener)
        Sets the "on click" listener.
        Parameters:
        onClickListener - the "on click" listener to set or null.
      • onPressed

        protected boolean onPressed​(int pointerX,
                                    int pointerY)
        Description copied from class: PointerEventHandler
        Returns false by default.

        Override this method to react on PRESSED events.
        Returns true to get event focus. Other widgets will no longer receive pointer events until next RELEASED.

        Overrides:
        onPressed in class PointerEventHandler
        Parameters:
        pointerX - the Pointer event X, relative to the attached widget.
        pointerY - the Pointer event Y, relative to the attached widget.
        Returns:
        true if the event has been processed, false if it should be dispatched to other handlers.
      • onReleased

        protected boolean onReleased​(int pointerX,
                                     int pointerY)
        Description copied from class: PointerEventHandler
        Returns false by default.

        Override this method to react on RELEASED events.
        Returns true to prevent other widgets to also handle this event.

        Overrides:
        onReleased in class PointerEventHandler
        Parameters:
        pointerX - the Pointer event X, relative to the attached widget.
        pointerY - the Pointer event Y, relative to the attached widget.
        Returns:
        true if the event has been processed, false if it should be dispatched to other handlers.
      • handleClick

        @Deprecated
        public void handleClick()
        Deprecated.
        Internal API.
        Handles a click event.