@JsType public interface WorkbenchActivity extends ContextSensitiveActivity
In the model-view-presenter (MVP) sense, an Activity is essentially an application-provided Presenter: it has a view (its widget) and it defines a set of operations that can affect that view.
Applications can implement an Activity interface directly, they can subclass one of the abstract Activity implementations that come with the framework, or they may rely on UberFire's annotation processors to generate Activity implementations from annotated Java objects.
For example, to define a new Screen in an application, you can implement WorkbenchScreenActivity
, extend
AbstractWorkbenchScreenActivity
, or annotate a class with WorkbenchScreen
and follow the rules
associated with that annotation.
Similarly for WorkbenchEditorActivity
, AbstractWorkbenchEditorActivity
and WorkbenchEditor
;
PerspectiveActivity
, AbstractWorkbenchPerspectiveActivity
, and WorkbenchPerspective
; and so
on.
Modifier and Type | Method and Description |
---|---|
String |
contextId() |
Position |
getDefaultPosition()
Specifies custom positioning for this activity's view when the request to launch it comes without specific
positioning information of its own.
|
Menus |
getMenus() |
PlaceRequest |
getOwningPlace()
Returns the PlaceRequest for the perspective that this activity should always be displayed in.
|
String |
getTitle() |
com.google.gwt.user.client.ui.IsWidget |
getTitleDecoration() |
default com.google.gwt.dom.client.Element |
getTitleDecorationElement() |
ToolBar |
getToolBar() |
com.google.gwt.user.client.ui.IsWidget |
getWidget() |
default com.google.gwt.dom.client.Element |
getWidgetElement() |
void |
onFocus()
Invoked by the UberFire framework when this activity is the current activity in the current panel.
|
void |
onLostFocus()
Invoked by the UberFire framework when this activity is no longer the current activity in the current panel.
|
boolean |
onMayClose()
Invoked by the framework before this activity is closed, unless the framework has been told to "force close" the
activity.
|
default int |
preferredHeight()
Returns the amount of space that should be allocated to this activity if a new Workbench Panel is created when
first displaying it.
|
default int |
preferredWidth()
Returns the amount of space that should be allocated to this activity if a new Workbench Panel is created when
first displaying it.
|
getName, getPlace, isDefault, isDynamic, onClose, onOpen, onShutdown, onStartup
getDependencies, getIdentifier, getResourceType, isType
boolean onMayClose()
The activity can cancel the close operation by returning false
from this method. This is most often used
for implementing a "save before closing" workflow.
PlaceManager.closeAllPlaces()
,
PlaceManager.closePlace(PlaceRequest)
,
PlaceManager.closePlace(String)
Position getDefaultPosition()
If this method returns null, UberFire will attempt to add this activity's view directly to the root panel.
Developers of cross-application reusable components should use caution with this feature. If the component declares a default position that is not supported by the root panel the application uses, the application's root panel could throw a ClassCastException when the framework attempts to create the child panel at the given position.
PlaceRequest getOwningPlace()
void onFocus()
void onLostFocus()
onFocus()
call.String getTitle()
@JsIgnore com.google.gwt.user.client.ui.IsWidget getTitleDecoration()
default com.google.gwt.dom.client.Element getTitleDecorationElement()
@JsIgnore com.google.gwt.user.client.ui.IsWidget getWidget()
default com.google.gwt.dom.client.Element getWidgetElement()
Menus getMenus()
ToolBar getToolBar()
String contextId()
default int preferredHeight()
default int preferredWidth()
Copyright © 2012–2019 JBoss by Red Hat. All rights reserved.