com.sencha.gxt.legacy.client.mvc
Class AppEvent

java.lang.Object
  extended by com.google.web.bindery.event.shared.Event<H>
      extended by com.google.gwt.event.shared.GwtEvent<DispatcherListener>
          extended by com.sencha.gxt.legacy.client.mvc.AppEvent

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.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.google.gwt.event.shared.GwtEvent
GwtEvent.Type<H>
 
Constructor Summary
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.
 
Method Summary
 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()
           
 
Methods inherited from class com.google.gwt.event.shared.GwtEvent
getSource
 
Methods inherited from class com.google.web.bindery.event.shared.Event
toDebugString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AppEvent

public AppEvent(GwtEvent.Type<?> type)
Creates a new application event.

Parameters:
type - the event type

AppEvent

public AppEvent(GwtEvent.Type<?> type,
                Object data)
Creates a new application event.

Parameters:
type - the event type
data - the data

AppEvent

public AppEvent(GwtEvent.Type<?> type,
                Object data,
                String token)
Creates a new application event.

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

getAssociatedType

public GwtEvent.Type<DispatcherListener> getAssociatedType()
Overrides:
getAssociatedType in class GwtEvent<DispatcherListener>

getData

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

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

getData

public <X> X getData(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 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(Object data)
Sets the application defined data.

Parameters:
data - the data

setData

public void setData(String key,
                    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(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 String toString()
Overrides:
toString in class com.google.web.bindery.event.shared.Event<DispatcherListener>


Copyright © 2011. All Rights Reserved.