@ApplicationScoped public class PerspectiveManagerImpl extends Object implements PerspectiveManager
Constructor and Description |
---|
PerspectiveManagerImpl() |
Modifier and Type | Method and Description |
---|---|
PerspectiveActivity |
getCurrentPerspective()
Returns the current perspective's
PerspectiveActivity . |
PlaceRequest |
getCurrentPerspectivePlaceRequest() |
String |
getDefaultPerspectiveIdentifier()
Fetches the current default perspective identifier.
|
PerspectiveDefinition |
getLivePerspectiveDefinition()
Returns a description of the current perspective which reflects the current visible state of the user interface.
|
void |
loadPerspectiveStates(ParameterizedCommand<Set<PerspectiveDefinition>> doWhenFinished)
Retrieves the definitions of all the persisted perspectives.
|
void |
removePerspectiveState(String perspectiveId,
Command doWhenFinished)
This method removes any persisted definition for the given perspective.
|
void |
removePerspectiveStates(Command doWhenFinished)
This method removes all persisted Perspective definitions.
|
void |
savePerspectiveState(Command doWhenFinished)
Saves the current live perspective definition to the server.
|
void |
switchToPerspective(PlaceRequest placeRequest,
PerspectiveActivity activity,
ParameterizedCommand<PerspectiveDefinition> doWhenFinished)
This method should only be invoked by PlaceManager.
|
public void switchToPerspective(PlaceRequest placeRequest, PerspectiveActivity activity, ParameterizedCommand<PerspectiveDefinition> doWhenFinished)
PerspectiveManager
PlaceManager.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 the PerspectiveDefinition
associated 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.switchToPerspective
in interface PerspectiveManager
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.public PerspectiveActivity getCurrentPerspective()
PerspectiveManager
PerspectiveActivity
. When the app first starts, this will be null. Once
the workbench has bootstrapped, the return value will not be null again.getCurrentPerspective
in interface PerspectiveManager
public PerspectiveDefinition getLivePerspectiveDefinition()
PerspectiveManager
getLivePerspectiveDefinition
in interface PerspectiveManager
public void savePerspectiveState(Command doWhenFinished)
PerspectiveManager
PerspectiveActivity.getDefaultPerspectiveLayout()
when switching to a new
perspective. This method has no effect if the current perspective is transient.savePerspectiveState
in interface PerspectiveManager
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, use Commands.DO_NOTHING
.WorkbenchPerspective.isTransient()
,
PerspectiveActivity.isTransient()
public void loadPerspectiveStates(ParameterizedCommand<Set<PerspectiveDefinition>> doWhenFinished)
PerspectiveManager
loadPerspectiveStates
in interface PerspectiveManager
doWhenFinished
- The command to execute once the perspective definitions are retrieved.public void removePerspectiveState(String perspectiveId, Command doWhenFinished)
PerspectiveManager
removePerspectiveState
in interface PerspectiveManager
doWhenFinished
- The command to execute once the perspective state have been removed. Must not be null.public void removePerspectiveStates(Command doWhenFinished)
PerspectiveManager
removePerspectiveStates
in interface PerspectiveManager
doWhenFinished
- The command to execute once the perspective states have been removed. Must not be null.public String getDefaultPerspectiveIdentifier()
PerspectiveManager
getDefaultPerspectiveIdentifier
in interface PerspectiveManager
public PlaceRequest getCurrentPerspectivePlaceRequest()
getCurrentPerspectivePlaceRequest
in interface PerspectiveManager
Copyright © 2012–2019 JBoss by Red Hat. All rights reserved.