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,CreateEvent,DOMExceptionEvent,ForwardEvent,FulfillEvent,HistoryPopStateEvent,InputEvent,KeyEvent,MaximizeEvent,MinimizeEvent,MouseEvent,MoveEvent,OpenEvent,ProxyEvent,ScriptErrorEvent,ScrollEvent,SelectEvent,SelectionEvent,SizeEvent,SlideEvent,SortEvent,StateChangeEvent,StubEvent,SwipeEvent,UploadEvent,URIEvent,VisibilityChangeEvent,ZIndexEvent
public class Event extends java.lang.Object implements java.io.SerializableAn 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.ObjectgetData()Returns the data accompanies with this event, or null if not available.static EventgetEvent(AuRequest request)Creates an instance ofEventbased on the specified request.java.lang.StringgetName()Returns the event name.PagegetPage()Returns the page owning this event, or null if broadcast.ComponentgetTarget()Returns the target component that receives this event, or null if broadcast.booleanisPropagatable()Returns whether this event is propagatable.voidstopPropagation()Stops the propagation for this event.java.lang.StringtoString()
-
-
-
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 eventtarget- 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 eventtarget- 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 ofEventbased 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 byComponent.addEventListener(int, java.lang.String, org.zkoss.zk.ui.event.EventListener<? extends org.zkoss.zk.ui.event.Event>)andPage.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:
toStringin classjava.lang.Object
-
-