|
GWT 2.7.0 | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.google.gwt.activity.shared.ActivityManager
public class ActivityManager
Manages Activity
objects that should be kicked off in response to
PlaceChangeEvent
events. Each activity can start itself
asynchronously, and provides a widget to be shown when it's ready to run.
Constructor Summary | |
---|---|
ActivityManager(ActivityMapper mapper,
EventBus eventBus)
Create an ActivityManager. |
Method Summary | |
---|---|
EventBus |
getActiveEventBus()
Returns an event bus which is in use by the currently running activity. |
void |
onPlaceChange(PlaceChangeEvent event)
Deactivate the current activity, find the next one from our ActivityMapper, and start it. |
void |
onPlaceChangeRequest(PlaceChangeRequestEvent event)
Reject the place change if the current activity is not willing to stop. |
void |
setDisplay(AcceptsOneWidget display)
Sets the display for the receiver, and has the side effect of starting or stopping its monitoring the event bus for place change events. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ActivityManager(ActivityMapper mapper, EventBus eventBus)
setDisplay(com.google.gwt.user.client.ui.AcceptsOneWidget)
.
mapper
- finds the Activity
for a given
Place
eventBus
- source of PlaceChangeEvent
and
PlaceChangeRequestEvent
events.Method Detail |
---|
public EventBus getActiveEventBus()
Any handlers attached to the returned event bus will be de-registered when the current activity is stopped.
public void onPlaceChange(PlaceChangeEvent event)
The current activity's widget will be hidden immediately, which can cause flicker if the next activity provides its widget asynchronously. That can be minimized by decent caching. Perenially slow activities might mitigate this by providing a widget immediately, with some kind of "loading" treatment.
onPlaceChange
in interface PlaceChangeEvent.Handler
event
- the PlaceChangeEvent
public void onPlaceChangeRequest(PlaceChangeRequestEvent event)
onPlaceChangeRequest
in interface PlaceChangeRequestEvent.Handler
event
- the PlaceChangeRequestEvent
PlaceChangeRequestEvent.Handler.onPlaceChangeRequest(PlaceChangeRequestEvent)
public void setDisplay(AcceptsOneWidget display)
If you are disposing of an ActivityManager, it is important to call setDisplay(null) to get it to deregister from the event bus, so that it can be garbage collected.
display
- an instance of AcceptsOneWidget
|
GWT 2.7.0 | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |