com.extjs.gxt.ui.client.mvc
Class AppEvent<Data>

java.lang.Object
  extended by com.extjs.gxt.ui.client.event.BaseEvent
      extended by com.extjs.gxt.ui.client.mvc.AppEvent<Data>

public class AppEvent<Data>
extends BaseEvent

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.


Field Summary
 Data data
          Application specific data such as the model.
 boolean historyEvent
          True to create a history item for this event when passed through the dispatcher.
 java.lang.String token
          The optional history token (defaults to null).
 
Fields inherited from class com.extjs.gxt.ui.client.event.BaseEvent
doit, source, type
 
Constructor Summary
AppEvent(int type)
          Creates a new app event.
AppEvent(int type, Data data)
          Creates a new app event.
AppEvent(int type, Data data, java.lang.String token)
          Creates a new app event.
 
Method Summary
<X> X
getData(java.lang.String key)
          Returns the application defined property for the given name, or null if it has not been set.
 void setData(java.lang.String key, java.lang.Object data)
          Sets the application defined property with the given name.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

data

public Data data
Application specific data such as the model.


token

public java.lang.String token
The optional history token (defaults to null). If null, a token will be generated for the event.


historyEvent

public boolean historyEvent
True to create a history item for this event when passed through the dispatcher.

Constructor Detail

AppEvent

public AppEvent(int type)
Creates a new app event.

Parameters:
type - the event type

AppEvent

public AppEvent(int type,
                Data data)
Creates a new app event.

Parameters:
type - the event type
data - the data

AppEvent

public AppEvent(int type,
                Data data,
                java.lang.String token)
Creates a new app event.

Parameters:
type - the event type
data - the event data
token - the history token
Method Detail

getData

public <X> X getData(java.lang.String key)
Returns the application defined property for the given name, or null if it has not been set.

Parameters:
key - the name of the property
Returns:
the value or null if it has not been set

setData

public void setData(java.lang.String key,
                    java.lang.Object data)
Sets the application defined property with the given name.

Parameters:
key - the name of the property
data - the new value for the property

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object