Interface Activity
-
- All Superinterfaces:
org.uberfire.security.Resource,org.uberfire.security.authz.RuntimeFeatureResource,org.uberfire.security.authz.RuntimeResource
- All Known Subinterfaces:
ContextActivity,ContextSensitiveActivity,PerspectiveActivity,PopupActivity,SplashScreenActivity,WorkbenchActivity,WorkbenchClientEditorActivity,WorkbenchEditorActivity,WorkbenchScreenActivity
- All Known Implementing Classes:
AbstractActivity,AbstractPopupActivity,AbstractSplashScreenActivity,AbstractWorkbenchActivity,AbstractWorkbenchClientEditorActivity,AbstractWorkbenchContextActivity,AbstractWorkbenchEditorActivity,AbstractWorkbenchPerspectiveActivity,AbstractWorkbenchScreenActivity,ActivityNotFoundPresenter,StandaloneEditorPerspective
@JsType public interface Activity extends org.uberfire.security.authz.RuntimeFeatureResourceCommon top-level interface for all Workbench Activity classes. No concrete class implements this interface directly; see the subinterfaces for specific activity types that do get implemented.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
PlaceManagerto manipulate activities at arm's length.If you do need to get your hands on a particular
Activityinstance, do so using anActivityManager.Activity Lifecycle
Activities have the following lifecycle, which is normally driven by anActivityManager:- The activity starts off in the uninitialized state.
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 toonShutdown().An activity will never receive a call to
onOpen()when it is uninitialized or open, but it may be reopened after a call toonClose().- See Also:
PlaceManager,ActivityManager
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default StringgetName()Returns the name of this activity, defaulting toResource.getIdentifier().org.uberfire.mvp.PlaceRequestgetPlace()Returns the PlaceRequest that this Activity is currently tied to.default booleanisDefault()Returns whether or not this activity should be executed by default (on startup).default booleanisDynamic()Returns whether or not this activity is marked as dynamic (provided by external scripts).voidonClose()Called by the framework to notify this activity that its Widget has been removed from the live GUI.voidonOpen()Called by the framework to notify this activity that its Widget has been added to the live GUI.voidonShutdown()Called by the framework to notify this activity that it is no longer associated with the PlaceRequest that was passed toonStartup(PlaceRequest).voidonStartup(org.uberfire.mvp.PlaceRequest place)Called by the framework to notify this activity that it is now associated with the given PlaceRequest.
-
-
-
Method Detail
-
onStartup
@JsMethod(name="onStartupPlace") void onStartup(org.uberfire.mvp.PlaceRequest place)
Called by the framework to notify this activity that it is now associated with the given PlaceRequest. When this lifecycle method is invoked, the activity's widget has not yet been added to the GUI.- Parameters:
place- The place that resolved to this activity
-
onOpen
void onOpen()
Called by the framework to notify this activity that its Widget has been added to the live GUI.
-
onClose
void onClose()
Called by the framework to notify this activity that its Widget has been removed from the live GUI.
-
onShutdown
void onShutdown()
Called by the framework to notify this activity that it is no longer associated with the PlaceRequest that was passed toonStartup(PlaceRequest).
-
getPlace
org.uberfire.mvp.PlaceRequest getPlace()
Returns the PlaceRequest that this Activity is currently tied to.- Returns:
- the PlaceRequest that this activity was started for, or null if this activity is not in the started state.
-
isDefault
default boolean isDefault()
Returns whether or not this activity should be executed by default (on startup).- Returns:
- true, if this activity should be executed by default, otherwise false.
-
isDynamic
default boolean isDynamic()
Returns whether or not this activity is marked as dynamic (provided by external scripts).- Returns:
- true if this activity is dynamic, otherwise false.
-
getName
default String getName()
Returns the name of this activity, defaulting toResource.getIdentifier().- Returns:
- the activity's name
-
-