@JsType public interface Activity extends RuntimeFeatureResource
Also, implementations of this interface and its subinterfaces are typically not written by hand; instead, they are
generated from classes annotated with WorkbenchScreen
, WorkbenchEditor
, WorkbenchPopup
, and
others by an UberFire annotation processor.
Developers of UberFire applications will not typically come into direct contact with things that implement Activity
or its subinterfaces; instead, they will work with a PlaceManager
to manipulate activities at arm's length.
If you do need to get your hands on a particular Activity
instance, do so using an ActivityManager
.
ActivityManager
:
onStartup(PlaceRequest)
is called with the the PlaceRequest that caused it to be created.
The activity is "associated" with this PlaceRequest until the onShutdown method is invoked. This puts the activity
in the started state.
onOpen()
is called to notify the Activity that its view has been added to the UI, and its associated
place is considered "open." This puts the activity in the open state.
onClose()
is called to notify the Activity that its view has been removed from the UI, and its associated
place is considered "closed." This puts the activity back in the started state.
onShutdown()
is called to notify the Activity that it is no longer associated with the PlaceRequest.
This puts the activity back in the uninitialized state.
An activity will never receive a call to onStartup(PlaceRequest)
when it is started or open, but it may be
restarted (perhaps with a different PlaceRequest) after a call to onShutdown()
.
An activity will never receive a call to onOpen()
when it is uninitialized or open, but it may be reopened after a call
to onClose()
.
PlaceManager
,
ActivityManager
Modifier and Type | Method and Description |
---|---|
default String |
getName()
Returns the name of this activity, defaulting to
Resource.getIdentifier() . |
PlaceRequest |
getPlace()
Returns the PlaceRequest that this Activity is currently tied to.
|
default boolean |
isDefault()
Returns whether or not this activity should be executed by default (on startup).
|
default boolean |
isDynamic()
Returns whether or not this activity is marked as dynamic (provided by external scripts).
|
void |
onClose()
Called by the framework to notify this activity that its Widget has been removed from the live GUI.
|
void |
onOpen()
Called by the framework to notify this activity that its Widget has been added to the live GUI.
|
void |
onShutdown()
Called by the framework to notify this activity that it is no longer associated with the PlaceRequest that was
passed to
onStartup(PlaceRequest) . |
void |
onStartup(PlaceRequest place)
Called by the framework to notify this activity that it is now associated with the given PlaceRequest.
|
getDependencies, getIdentifier, getResourceType, isType
@JsMethod(name="onStartupPlace") void onStartup(PlaceRequest place)
place
- The place that resolved to this activityvoid onOpen()
void onClose()
void onShutdown()
onStartup(PlaceRequest)
.PlaceRequest getPlace()
default boolean isDefault()
default boolean isDynamic()
default String getName()
Resource.getIdentifier()
.Copyright © 2012–2019 JBoss by Red Hat. All rights reserved.