Package org.uberfire.client.mvp
Class PerspectiveManagerImpl
- java.lang.Object
-
- org.uberfire.client.mvp.PerspectiveManagerImpl
-
- All Implemented Interfaces:
PerspectiveManager
@ApplicationScoped public class PerspectiveManagerImpl extends Object implements PerspectiveManager
-
-
Constructor Summary
Constructors Constructor Description PerspectiveManagerImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PerspectiveActivitygetCurrentPerspective()Returns the current perspective'sPerspectiveActivity.org.uberfire.mvp.PlaceRequestgetCurrentPerspectivePlaceRequest()StringgetDefaultPerspectiveIdentifier()Fetches the current default perspective identifier.org.uberfire.workbench.model.PerspectiveDefinitiongetLivePerspectiveDefinition()Returns a description of the current perspective which reflects the current visible state of the user interface.voidloadPerspectiveStates(org.uberfire.mvp.ParameterizedCommand<Set<org.uberfire.workbench.model.PerspectiveDefinition>> doWhenFinished)Retrieves the definitions of all the persisted perspectives.voidremovePerspectiveState(String perspectiveId, org.uberfire.mvp.Command doWhenFinished)This method removes any persisted definition for the given perspective.voidremovePerspectiveStates(org.uberfire.mvp.Command doWhenFinished)This method removes all persisted Perspective definitions.voidsavePerspectiveState(org.uberfire.mvp.Command doWhenFinished)Saves the current live perspective definition to the server.voidswitchToPerspective(org.uberfire.mvp.PlaceRequest placeRequest, PerspectiveActivity activity, org.uberfire.mvp.ParameterizedCommand<org.uberfire.workbench.model.PerspectiveDefinition> doWhenFinished)This method should only be invoked by PlaceManager.
-
-
-
Method Detail
-
switchToPerspective
public void switchToPerspective(org.uberfire.mvp.PlaceRequest placeRequest, PerspectiveActivity activity, org.uberfire.mvp.ParameterizedCommand<org.uberfire.workbench.model.PerspectiveDefinition> doWhenFinished)Description copied from interface:PerspectiveManagerThis method should only be invoked by PlaceManager. To launch a perspective within an UberFire app, pass a PlaceRequest for that perspective toPlaceManager.goTo(org.uberfire.mvp.PlaceRequest). Closes all current panels in the PanelManager (they must have already had their parts removed), then builds up the new panel arrangement based on thePerspectiveDefinitionassociated with the given perspective activity. If the given perspective is transient, its default perspective definition will always be used. Otherwise, the PerspectiveManager will first attempt to retrieve the current user's saved PerspectiveDefinition from the server, falling back on the default if none is found.- Specified by:
switchToPerspectivein interfacePerspectiveManager- Parameters:
placeRequest- the placeRequest that originated the perspective to switch to. Must not be null.activity- the perspective to switch to. Must not be null.doWhenFinished- The command to execute once the new perspective's panels have been created. Must not be null. When the callback is invoked, the panels will be set up in their correct positions, but no parts will have been added.
-
getCurrentPerspective
public PerspectiveActivity getCurrentPerspective()
Description copied from interface:PerspectiveManagerReturns the current perspective'sPerspectiveActivity. When the app first starts, this will be null. Once the workbench has bootstrapped, the return value will not be null again.- Specified by:
getCurrentPerspectivein interfacePerspectiveManager
-
getLivePerspectiveDefinition
public org.uberfire.workbench.model.PerspectiveDefinition getLivePerspectiveDefinition()
Description copied from interface:PerspectiveManagerReturns a description of the current perspective which reflects the current visible state of the user interface.- Specified by:
getLivePerspectiveDefinitionin interfacePerspectiveManager
-
savePerspectiveState
public void savePerspectiveState(org.uberfire.mvp.Command doWhenFinished)
Description copied from interface:PerspectiveManagerSaves the current live perspective definition to the server. Saved perspective definitions override the default definition produced by thePerspectiveActivity.getDefaultPerspectiveLayout()when switching to a new perspective. This method has no effect if the current perspective is transient.- Specified by:
savePerspectiveStatein interfacePerspectiveManager- Parameters:
doWhenFinished- action to execute after the save is complete (or immediately in the case of a transient perspective). Must not be null. To do nothing, useCommands.DO_NOTHING.- See Also:
WorkbenchPerspective.isTransient(),PerspectiveActivity.isTransient()
-
loadPerspectiveStates
public void loadPerspectiveStates(org.uberfire.mvp.ParameterizedCommand<Set<org.uberfire.workbench.model.PerspectiveDefinition>> doWhenFinished)
Description copied from interface:PerspectiveManagerRetrieves the definitions of all the persisted perspectives.- Specified by:
loadPerspectiveStatesin interfacePerspectiveManager- Parameters:
doWhenFinished- The command to execute once the perspective definitions are retrieved.
-
removePerspectiveState
public void removePerspectiveState(String perspectiveId, org.uberfire.mvp.Command doWhenFinished)
Description copied from interface:PerspectiveManagerThis method removes any persisted definition for the given perspective. Subsequent requests for a previously persisted perspective should load the Perspective definition from the applicable object.- Specified by:
removePerspectiveStatein interfacePerspectiveManagerdoWhenFinished- The command to execute once the perspective state have been removed. Must not be null.
-
removePerspectiveStates
public void removePerspectiveStates(org.uberfire.mvp.Command doWhenFinished)
Description copied from interface:PerspectiveManagerThis method removes all persisted Perspective definitions. Subsequent requests for previously persisted perspectives should load the Perspective definition from the applicable object.- Specified by:
removePerspectiveStatesin interfacePerspectiveManager- Parameters:
doWhenFinished- The command to execute once the perspective states have been removed. Must not be null.
-
getDefaultPerspectiveIdentifier
public String getDefaultPerspectiveIdentifier()
Description copied from interface:PerspectiveManagerFetches the current default perspective identifier.- Specified by:
getDefaultPerspectiveIdentifierin interfacePerspectiveManager- Returns:
- The default perspective identifier of the workbench, if one exists.
-
getCurrentPerspectivePlaceRequest
public org.uberfire.mvp.PlaceRequest getCurrentPerspectivePlaceRequest()
- Specified by:
getCurrentPerspectivePlaceRequestin interfacePerspectiveManager
-
-