com.extjs.gxt.ui.client.mvc
Class AppEvent

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

public class AppEvent
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.


Constructor Summary
AppEvent(EventType type)
          Creates a new application event.
AppEvent(EventType type, java.lang.Object data)
          Creates a new application event.
AppEvent(EventType type, java.lang.Object data, java.lang.String token)
          Creates a new application event.
 
Method Summary
<X> X
getData()
          Returns the application specified data.
<X> X
getData(java.lang.String key)
          Returns the application defined property for the given name, or null if it has not been set.
 java.lang.String getToken()
          Returns the history token.
 boolean isHistoryEvent()
          Returns true if the event is a history event.
 void setData(java.lang.Object data)
          Sets the application defined data.
 void setData(java.lang.String key, java.lang.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(java.lang.String token)
          The optional history token (defaults to null).
 java.lang.String toString()
           
 
Methods inherited from class com.extjs.gxt.ui.client.event.BaseEvent
getSource, getType, isCancelled, setCancelled, setSource, setType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AppEvent

public AppEvent(EventType type)
Creates a new application event.

Parameters:
type - the event type

AppEvent

public AppEvent(EventType type,
                java.lang.Object data)
Creates a new application event.

Parameters:
type - the event type
data - the data

AppEvent

public AppEvent(EventType type,
                java.lang.Object data,
                java.lang.String token)
Creates a new application event.

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

getData

public <X> X getData()
Returns the application specified data.

Type Parameters:
X - the data type
Returns:
the data

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

getToken

public java.lang.String getToken()
Returns the history token.

Returns:
the history token

isHistoryEvent

public boolean isHistoryEvent()
Returns true if the event is a history event.

Returns:
true for a history event

setData

public void setData(java.lang.Object data)
Sets the application defined data.

Parameters:
data - the data

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

setHistoryEvent

public void setHistoryEvent(boolean historyEvent)
True to create a history item for this event when passed through the dispatcher (defaults to false).

Parameters:
historyEvent - true for a history event

setToken

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

Parameters:
token - the history token

toString

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