Class PerspectiveManagerImpl

    • Constructor Detail

      • PerspectiveManagerImpl

        public PerspectiveManagerImpl()
    • 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: PerspectiveManager
        This method should only be invoked by PlaceManager. To launch a perspective within an UberFire app, pass a PlaceRequest for that perspective to 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.

        Specified by:
        switchToPerspective in interface PerspectiveManager
        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.

      • getLivePerspectiveDefinition

        public org.uberfire.workbench.model.PerspectiveDefinition getLivePerspectiveDefinition()
        Description copied from interface: PerspectiveManager
        Returns a description of the current perspective which reflects the current visible state of the user interface.
        Specified by:
        getLivePerspectiveDefinition in interface PerspectiveManager
      • savePerspectiveState

        public void savePerspectiveState​(org.uberfire.mvp.Command doWhenFinished)
        Description copied from interface: PerspectiveManager
        Saves the current live perspective definition to the server. Saved perspective definitions override the default definition produced by the PerspectiveActivity.getDefaultPerspectiveLayout() when switching to a new perspective. This method has no effect if the current perspective is transient.
        Specified by:
        savePerspectiveState in interface PerspectiveManager
        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, use Commands.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: PerspectiveManager
        Retrieves the definitions of all the persisted perspectives.
        Specified by:
        loadPerspectiveStates in interface PerspectiveManager
        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: PerspectiveManager
        This 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:
        removePerspectiveState in interface PerspectiveManager
        doWhenFinished - 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: PerspectiveManager
        This method removes all persisted Perspective definitions. Subsequent requests for previously persisted perspectives should load the Perspective definition from the applicable object.
        Specified by:
        removePerspectiveStates in interface PerspectiveManager
        Parameters:
        doWhenFinished - The command to execute once the perspective states have been removed. Must not be null.