Package org.zkoss.zk.ui.event

## Class Event

- java.lang.Object
- - org.zkoss.zk.ui.event.Event

- All Implemented Interfaces:
    `java.io.Serializable`
  Direct Known Subclasses:
    `AfterSizeEvent`, `BookmarkEvent`, `CheckEvent`, `ClientInfoEvent`, `ColSizeEvent`, `CreateEvent`, `DataLoadingEvent`, `DetectEvent`, `DivisionSizeEvent`, `DOMExceptionEvent`, `ForwardEvent`, `FulfillEvent`, `GlobalCommandEvent`, `HistoryPopStateEvent`, `InputEvent`, `KeyEvent`, `MaximizeEvent`, `Messagebox.ClickEvent`, `MinimizeEvent`, `MouseEvent`, `MoveEvent`, `NavigationEvent`, `OfflineRecoverEvent`, `OpenEvent`, `PageSizeEvent`, `PagingEvent`, `PortalDropEvent`, `PortalMoveEvent`, `PropertyChangeEvent`, `ProxyEvent`, `RangeValueChangeEvent`, `RenderEvent`, `RotationEvent`, `ScriptErrorEvent`, `ScrollEvent`, `SelectEvent`, `SelectionEvent`, `SizeEvent`, `SlideEvent`, `SortEvent`, `StateChangeEvent`, `StubEvent`, `SwipeEvent`, `UploadEvent`, `URIEvent`, `VisibilityChangeEvent`, `ZIndexEvent`, `ZoomEvent`

      public class Event
      extends java.lang.Object
      implements java.io.Serializable

  An event sent to the event handler of a component.
  Author:
    tomyeh
  See Also:
    `Component`, Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `Event​(java.lang.String name)` | Constructs a simple event without target.
    `Event​(java.lang.String name, Component target)` | Constructs a simple event.
    `Event​(java.lang.String name, Component target, java.lang.Object data)` | Constructs a simple event.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `java.lang.Object` | `getData()` | Returns the data accompanies with this event, or null if not available.
    `static Event` | `getEvent​(AuRequest request)` | Creates an instance of `Event` based on the specified request.
    `java.lang.String` | `getName()` | Returns the event name.
    `Page` | `getPage()` | Returns the page owning this event, or null if broadcast.
    `Component` | `getTarget()` | Returns the target component that receives this event, or null if broadcast.
    `boolean` | `isPropagatable()` | Returns whether this event is propagatable.
    `void` | `stopPropagation()` | Stops the propagation for this event.
    `java.lang.String` | `toString()` |

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### Event

          public Event​(java.lang.String name)

      Constructs a simple event without target.
      Parameters:
        `name` - the name of the event
      Since:
        5.0.0

    - #### Event

          public Event​(java.lang.String name,
                       Component target)

      Constructs a simple event.
      Parameters:
        `name` - the name of the event
        `target` - the component to receive this event, or null to indicate broadcasting the event to all root components.

    - #### Event

          public Event​(java.lang.String name,
                       Component target,
                       java.lang.Object data)

      Constructs a simple event.
      Parameters:
        `name` - the name of the event
        `target` - the component to receive this event, or null to indicate broadcasting the event to all root components.
        `data` - an arbitrary data

  - ### Method Detail

    - #### getEvent

          public static Event getEvent​(AuRequest request)

      Creates an instance of `Event` based on the specified request.

    - #### getName

          public final java.lang.String getName()

      Returns the event name.

    - #### getTarget

          public final Component getTarget()

      Returns the target component that receives this event, or null if broadcast.

    - #### getPage

          public final Page getPage()

      Returns the page owning this event, or null if broadcast.

    - #### getData

          public java.lang.Object getData()

      Returns the data accompanies with this event, or null if not available.

    - #### isPropagatable

          public boolean isPropagatable()

      Returns whether this event is propagatable.

      Default: true.

      It becomes false if `stopPropagation()` is called. If true, the event will be sent to the following event listener (`EventListener`) being registered by `Component.addEventListener(int, java.lang.String, org.zkoss.zk.ui.event.EventListener<? extends org.zkoss.zk.ui.event.Event>)` and `Page.addEventListener(java.lang.String, org.zkoss.zk.ui.event.EventListener<? extends org.zkoss.zk.ui.event.Event>)`.

    - #### stopPropagation

          public void stopPropagation()

      Stops the propagation for this event.

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`