Package org.uberfire.client.mvp
Class AbstractWorkbenchActivity
- java.lang.Object
-
- org.uberfire.client.mvp.AbstractActivity
-
- org.uberfire.client.mvp.AbstractWorkbenchActivity
-
- All Implemented Interfaces:
Activity,ContextSensitiveActivity,WorkbenchActivity,org.uberfire.security.authz.RuntimeFeatureResource,org.uberfire.security.authz.RuntimeResource,org.uberfire.security.Resource
- Direct Known Subclasses:
AbstractWorkbenchClientEditorActivity,AbstractWorkbenchEditorActivity,AbstractWorkbenchScreenActivity
public abstract class AbstractWorkbenchActivity extends AbstractActivity implements WorkbenchActivity
Implementation of behaviour common to all workbench editors and screens.AbstractWorkbenchActivity is not typically subclassed directly, even by generated code. See the more purpose-based subclasses.
-
-
Field Summary
-
Fields inherited from class org.uberfire.client.mvp.AbstractActivity
open, place, placeManager
-
-
Constructor Summary
Constructors Constructor Description AbstractWorkbenchActivity(PlaceManager placeManager)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description StringcontextId()org.uberfire.workbench.model.PositiongetDefaultPosition()Specifies custom positioning for this activity's view when the request to launch it comes without specific positioning information of its own.voidgetMenus(Consumer<org.uberfire.workbench.model.menu.Menus> menusConsumer)org.uberfire.mvp.PlaceRequestgetOwningPlace()This default implementation returns null, meaning this activity can be displayed in any perspective.abstract StringgetTitle()com.google.gwt.user.client.ui.IsWidgetgetTitleDecoration()org.uberfire.workbench.model.toolbar.ToolBargetToolBar()abstract com.google.gwt.user.client.ui.IsWidgetgetWidget()voidonFocus()Invoked by the UberFire framework when this activity is the current activity in the current panel.voidonLostFocus()Invoked by the UberFire framework when this activity is no longer the current activity in the current panel.booleanonMayClose()Invoked by the framework before this activity is closed, unless the framework has been told to "force close" the activity.-
Methods inherited from class org.uberfire.client.mvp.AbstractActivity
getPlace, onClose, onOpen, onShutdown, onStartup, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.uberfire.client.mvp.Activity
getName, getPlace, isDefault, isDynamic, onClose, onOpen, onShutdown, onStartup
-
Methods inherited from interface org.uberfire.security.Resource
getDependencies, getIdentifier, getResourceType, isType
-
Methods inherited from interface org.uberfire.client.mvp.WorkbenchActivity
getTitleDecorationElement, getWidgetElement, preferredHeight, preferredWidth
-
-
-
-
Constructor Detail
-
AbstractWorkbenchActivity
public AbstractWorkbenchActivity(PlaceManager placeManager)
-
-
Method Detail
-
getDefaultPosition
public org.uberfire.workbench.model.Position getDefaultPosition()
Description copied from interface:WorkbenchActivitySpecifies custom positioning for this activity's view when the request to launch it comes without specific positioning information of its own. For a newly launching activity, when this method returns a non-null value, UberFire will attempt to create a new panel for this activity and add that new panel as a child of the current perspective's root panel. The activity's view will then be added to the new panel.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.
- Specified by:
getDefaultPositionin interfaceWorkbenchActivity- Returns:
- the Position to add a new child panel to the root that accommodates this activity's view, or null if this activity's view should be added directly to the root panel.
-
getOwningPlace
public org.uberfire.mvp.PlaceRequest getOwningPlace()
This default implementation returns null, meaning this activity can be displayed in any perspective.- Specified by:
getOwningPlacein interfaceWorkbenchActivity- Returns:
- the owning perspective's place request, or null if this activity can appear in any perspective.
-
onMayClose
public boolean onMayClose()
Description copied from interface:WorkbenchActivityInvoked by the framework before this activity is closed, unless the framework has been told to "force close" the activity.The activity can cancel the close operation by returning
falsefrom this method. This is most often used for implementing a "save before closing" workflow.- Specified by:
onMayClosein interfaceWorkbenchActivity- Returns:
- true if the activity is ready to be closed; false if it should remain open.
- See Also:
PlaceManager.closeAllPlaces(),PlaceManager.closePlace(PlaceRequest),PlaceManager.closePlace(String)
-
getTitle
public abstract String getTitle()
- Specified by:
getTitlein interfaceWorkbenchActivity
-
getTitleDecoration
public com.google.gwt.user.client.ui.IsWidget getTitleDecoration()
- Specified by:
getTitleDecorationin interfaceWorkbenchActivity
-
getWidget
public abstract com.google.gwt.user.client.ui.IsWidget getWidget()
- Specified by:
getWidgetin interfaceWorkbenchActivity
-
onLostFocus
public void onLostFocus()
Description copied from interface:WorkbenchActivityInvoked by the UberFire framework when this activity is no longer the current activity in the current panel. Typically undoes changes made in the correspondingWorkbenchActivity.onFocus()call.- Specified by:
onLostFocusin interfaceWorkbenchActivity- See Also:
WorkbenchActivity.onLostFocus(),PanelManager.onPartFocus(org.uberfire.workbench.model.PartDefinition)
-
onFocus
public void onFocus()
Description copied from interface:WorkbenchActivityInvoked by the UberFire framework when this activity is the current activity in the current panel. Activities may choose to make their UI more prominent, or begin refreshing their data more aggressively when they are focused.- Specified by:
onFocusin interfaceWorkbenchActivity- See Also:
WorkbenchActivity.onLostFocus(),PanelManager.onPartFocus(org.uberfire.workbench.model.PartDefinition)
-
getMenus
public void getMenus(Consumer<org.uberfire.workbench.model.menu.Menus> menusConsumer)
- Specified by:
getMenusin interfaceWorkbenchActivity
-
getToolBar
public org.uberfire.workbench.model.toolbar.ToolBar getToolBar()
- Specified by:
getToolBarin interfaceWorkbenchActivity
-
contextId
public String contextId()
- Specified by:
contextIdin interfaceWorkbenchActivity
-
-