public class AppEvent extends GwtEvent<DispatcherListener>
AppEvents are used to pass messages between
Controllers and Views. All events have a specific
type which are used to identify the event. Typically, applications will
define all application events in a constants class.GwtEvent.Type<H>| Constructor and Description |
|---|
AppEvent(GwtEvent.Type<?> type)
Creates a new application event.
|
AppEvent(GwtEvent.Type<?> type,
Object data)
Creates a new application event.
|
AppEvent(GwtEvent.Type<?> type,
Object data,
String token)
Creates a new application event.
|
| Modifier and Type | Method and Description |
|---|---|
GwtEvent.Type<DispatcherListener> |
getAssociatedType() |
<X> X |
getData()
Returns the application specified data.
|
<X> X |
getData(String key)
Returns the application defined property for the given name, or
null if it has not been set. |
String |
getToken()
Returns the history token.
|
boolean |
isHistoryEvent()
Returns true if the event is a history event.
|
void |
setData(Object data)
Sets the application defined data.
|
void |
setData(String key,
Object data)
Sets the application defined property with the given name.
|
void |
setHistoryEvent(boolean historyEvent)
True to create a history item for this event when passed through the
dispatcher (defaults to false).
|
void |
setToken(String token)
The optional history token (defaults to null).
|
String |
toString() |
toDebugStringpublic AppEvent(GwtEvent.Type<?> type)
type - the event typepublic AppEvent(GwtEvent.Type<?> type, Object data)
type - the event typedata - the datapublic AppEvent(GwtEvent.Type<?> type, Object data, String token)
type - the event typedata - the event datatoken - the history tokenpublic GwtEvent.Type<DispatcherListener> getAssociatedType()
getAssociatedType in class GwtEvent<DispatcherListener>public <X> X getData()
X - the data typepublic <X> X getData(String key)
null if it has not been set.key - the name of the propertynull if it has not been setpublic String getToken()
public boolean isHistoryEvent()
public void setData(Object data)
data - the datapublic void setData(String key, Object data)
key - the name of the propertydata - the new value for the propertypublic void setHistoryEvent(boolean historyEvent)
historyEvent - true for a history eventpublic void setToken(String token)
token - the history tokenpublic String toString()
toString in class Event<DispatcherListener>Copyright © 2014. All Rights Reserved.