Package com.google.gwt.activity.shared
Class ActivityManager
java.lang.Object
com.google.gwt.activity.shared.ActivityManager
- All Implemented Interfaces:
EventHandler
,PlaceChangeEvent.Handler
,PlaceChangeRequestEvent.Handler
public class ActivityManager
extends Object
implements PlaceChangeEvent.Handler, PlaceChangeRequestEvent.Handler
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
ConstructorDescriptionActivityManager
(ActivityMapper mapper, EventBus eventBus) Create an ActivityManager. -
Method Summary
Modifier and TypeMethodDescriptionReturns 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
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.
-
Constructor Details
-
Method Details
-
getActiveEventBus
Returns an event bus which is in use by the currently running activity.Any handlers attached to the returned event bus will be de-registered when the current activity is stopped.
- Returns:
- the event bus used by the current activity
-
setDisplay
Sets the display for the receiver, and has the side effect of starting or stopping its monitoring the event bus for place change events.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.
- Parameters:
display
- an instance of AcceptsOneWidget
-