Class PluginPlaceManagerImpl

  • All Implemented Interfaces:
    PlaceManager

    @ApplicationScoped
    public class PluginPlaceManagerImpl
    extends Object
    implements PlaceManager
    This PlaceManager implementation is active for plugins only, to satisfy compile-time dependencies (of other components on the plugin's classpath that require a place manager). It is not used at runtime as plugins use the SharedSingleton PlaceManager provided by the main application. Plugins get access to a fully functional PlaceManager using @Inject @Shared ShareablePlaceManager.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean canCloseAllPlaces()  
      boolean canClosePlace​(org.uberfire.mvp.PlaceRequest place)  
      void closeAllPlaces()  
      boolean closeAllPlacesOrNothing()  
      void closePlace​(String id)  
      void closePlace​(org.uberfire.mvp.PlaceRequest placeToClose)  
      void closePlace​(org.uberfire.mvp.PlaceRequest placeToClose, org.uberfire.mvp.Command doAfterClose)  
      void forceCloseAllPlaces()  
      void forceClosePlace​(String id)  
      void forceClosePlace​(org.uberfire.mvp.PlaceRequest placeToClose)  
      Collection<SplashScreenActivity> getActiveSplashScreens()  
      Collection<org.uberfire.mvp.impl.PathPlaceRequest> getActivitiesForResourceType​(org.uberfire.workbench.type.ResourceTypeDefinition type)
      Finds the currently open PlaceRequests for Activities that handle the given ResourceTypeDefinition.
      Activity getActivity​(org.uberfire.mvp.PlaceRequest place)
      Finds the currently open activity that handles the given PlaceRequest by ID.
      List<org.uberfire.mvp.Command> getOnCloseCallbacks​(org.uberfire.mvp.PlaceRequest place)  
      List<org.uberfire.mvp.Command> getOnOpenCallbacks​(org.uberfire.mvp.PlaceRequest place)  
      PlaceStatus getStatus​(String id)  
      PlaceStatus getStatus​(org.uberfire.mvp.PlaceRequest place)  
      List<org.uberfire.mvp.PlaceRequest> getUncloseablePlaces()  
      void goTo​(String identifier)  
      void goTo​(String id, org.jboss.errai.common.client.dom.HTMLElement addTo)  
      void goTo​(String identifier, org.uberfire.workbench.model.PanelDefinition panel)  
      void goTo​(org.uberfire.backend.vfs.Path path)  
      void goTo​(org.uberfire.backend.vfs.Path path, org.uberfire.mvp.PlaceRequest placeRequest)  
      void goTo​(org.uberfire.backend.vfs.Path path, org.uberfire.mvp.PlaceRequest placeRequest, org.uberfire.workbench.model.PanelDefinition panel)  
      void goTo​(org.uberfire.backend.vfs.Path path, org.uberfire.workbench.model.PanelDefinition panel)  
      void goTo​(org.uberfire.mvp.PlaceRequest place)  
      void goTo​(org.uberfire.mvp.PlaceRequest place, com.google.gwt.user.client.ui.HasWidgets addTo)
      Locates the Activity associated with the given place, and if that activity is not already part of the workbench, starts it and adds its view to the given widget container.
      void goTo​(org.uberfire.mvp.PlaceRequest place, elemental2.dom.HTMLElement addTo)  
      void goTo​(org.uberfire.mvp.PlaceRequest place, org.jboss.errai.common.client.dom.HTMLElement addTo)  
      void goTo​(org.uberfire.mvp.PlaceRequest place, org.uberfire.workbench.model.PanelDefinition panel)  
      void goTo​(org.uberfire.workbench.model.PartDefinition part, org.uberfire.workbench.model.PanelDefinition panel)  
      void registerOnCloseCallback​(org.uberfire.mvp.PlaceRequest place, org.uberfire.mvp.Command callback)  
      void registerOnOpenCallback​(org.uberfire.mvp.PlaceRequest place, org.uberfire.mvp.Command callback)  
      void registerPerspectiveCloseChain​(String perspectiveIdentifier, org.uberfire.mvp.BiParameterizedCommand<org.uberfire.mvp.Command,​org.uberfire.mvp.PlaceRequest> closeChain)
      Registers a callback interceptor that uses a chain approach to execute code before a PlaceRequest is closed, if the perspective passed as a parameter is currently opened.
      void tryClosePlace​(org.uberfire.mvp.PlaceRequest placeToClose, org.uberfire.mvp.Command onAfterClose)  
      void unregisterOnCloseCallbacks​(org.uberfire.mvp.PlaceRequest place)  
      void unregisterOnOpenCallbacks​(org.uberfire.mvp.PlaceRequest place)  
    • Constructor Detail

      • PluginPlaceManagerImpl

        public PluginPlaceManagerImpl()
    • Method Detail

      • goTo

        public void goTo​(String identifier,
                         org.uberfire.workbench.model.PanelDefinition panel)
        Specified by:
        goTo in interface PlaceManager
      • goTo

        public void goTo​(org.uberfire.mvp.PlaceRequest place)
        Specified by:
        goTo in interface PlaceManager
      • goTo

        public void goTo​(org.uberfire.backend.vfs.Path path,
                         org.uberfire.workbench.model.PanelDefinition panel)
        Specified by:
        goTo in interface PlaceManager
      • goTo

        public void goTo​(org.uberfire.backend.vfs.Path path)
        Specified by:
        goTo in interface PlaceManager
      • goTo

        public void goTo​(org.uberfire.backend.vfs.Path path,
                         org.uberfire.mvp.PlaceRequest placeRequest,
                         org.uberfire.workbench.model.PanelDefinition panel)
        Specified by:
        goTo in interface PlaceManager
      • goTo

        public void goTo​(org.uberfire.backend.vfs.Path path,
                         org.uberfire.mvp.PlaceRequest placeRequest)
        Specified by:
        goTo in interface PlaceManager
      • goTo

        public void goTo​(org.uberfire.mvp.PlaceRequest place,
                         org.uberfire.workbench.model.PanelDefinition panel)
        Specified by:
        goTo in interface PlaceManager
      • goTo

        public void goTo​(org.uberfire.mvp.PlaceRequest place,
                         com.google.gwt.user.client.ui.HasWidgets addTo)
        Description copied from interface: PlaceManager
        Locates the Activity associated with the given place, and if that activity is not already part of the workbench, starts it and adds its view to the given widget container. If the activity is already part of the current workbench, it will be selected, and it will not be moved from its current location.

        The activity will be properly shut down in any of the following scenarios:

        1. by a call to one of the PlaceManager methods for closing a place: PlaceManager.closePlace(PlaceRequest), PlaceManager.closePlace(String), or PlaceManager.closeAllPlaces()
        2. by switching to another perspective, which has the side effect of closing all places
        3. by removing the activity's view from the DOM, either using the GWT Widget API, or by direct DOM manipulation.
        4. by opening another place on the same container.
        Specified by:
        goTo in interface PlaceManager
        addTo - The container to add the widget's view to. Its corresponding DOM element must have a CSS position setting of relative or absolute and an explicit size set. This can be accomplished through direct use of CSS, or through the Layouts.setToFillParent(com.google.gwt.user.client.ui.Widget) call.
      • goTo

        public void goTo​(String id,
                         org.jboss.errai.common.client.dom.HTMLElement addTo)
        Specified by:
        goTo in interface PlaceManager
      • goTo

        public void goTo​(org.uberfire.mvp.PlaceRequest place,
                         org.jboss.errai.common.client.dom.HTMLElement addTo)
        Specified by:
        goTo in interface PlaceManager
      • goTo

        public void goTo​(org.uberfire.mvp.PlaceRequest place,
                         elemental2.dom.HTMLElement addTo)
        Specified by:
        goTo in interface PlaceManager
      • goTo

        public void goTo​(org.uberfire.workbench.model.PartDefinition part,
                         org.uberfire.workbench.model.PanelDefinition panel)
        Specified by:
        goTo in interface PlaceManager
      • getActivity

        public Activity getActivity​(org.uberfire.mvp.PlaceRequest place)
        Description copied from interface: PlaceManager
        Finds the currently open activity that handles the given PlaceRequest by ID. No attempt is made to match by path, but see ActivityManagerImpl#resolveExistingParts(PlaceRequest) for a variant that does. (TODO: should this method care about paths? if not, should the other method be added to the interface?)
        Specified by:
        getActivity in interface PlaceManager
        Parameters:
        place - the PlaceRequest whose activity to search for
        Returns:
        the activity that currently exists in service of the given PlaceRequest's ID. Null if no current activity handles the given PlaceRequest.
      • closePlace

        public void closePlace​(org.uberfire.mvp.PlaceRequest placeToClose)
        Specified by:
        closePlace in interface PlaceManager
      • closePlace

        public void closePlace​(org.uberfire.mvp.PlaceRequest placeToClose,
                               org.uberfire.mvp.Command doAfterClose)
        Specified by:
        closePlace in interface PlaceManager
      • tryClosePlace

        public void tryClosePlace​(org.uberfire.mvp.PlaceRequest placeToClose,
                                  org.uberfire.mvp.Command onAfterClose)
        Specified by:
        tryClosePlace in interface PlaceManager
      • forceClosePlace

        public void forceClosePlace​(org.uberfire.mvp.PlaceRequest placeToClose)
        Specified by:
        forceClosePlace in interface PlaceManager
      • canClosePlace

        public boolean canClosePlace​(org.uberfire.mvp.PlaceRequest place)
        Specified by:
        canClosePlace in interface PlaceManager
      • getUncloseablePlaces

        public List<org.uberfire.mvp.PlaceRequest> getUncloseablePlaces()
        Specified by:
        getUncloseablePlaces in interface PlaceManager
        Returns:
        All opened PlaceRequests that cannot be closed (@onMayClose method returns false).
      • registerOnOpenCallback

        public void registerOnOpenCallback​(org.uberfire.mvp.PlaceRequest place,
                                           org.uberfire.mvp.Command callback)
        Specified by:
        registerOnOpenCallback in interface PlaceManager
      • registerOnCloseCallback

        public void registerOnCloseCallback​(org.uberfire.mvp.PlaceRequest place,
                                            org.uberfire.mvp.Command callback)
        Specified by:
        registerOnCloseCallback in interface PlaceManager
      • registerPerspectiveCloseChain

        public void registerPerspectiveCloseChain​(String perspectiveIdentifier,
                                                  org.uberfire.mvp.BiParameterizedCommand<org.uberfire.mvp.Command,​org.uberfire.mvp.PlaceRequest> closeChain)
        Description copied from interface: PlaceManager
        Registers a callback interceptor that uses a chain approach to execute code before a PlaceRequest is closed, if the perspective passed as a parameter is currently opened. It will not be executed in the case of a forced close.
        Specified by:
        registerPerspectiveCloseChain in interface PlaceManager
        Parameters:
        perspectiveIdentifier - Perspective identifier for which the close chain must be called when it is being closed.
        closeChain - Callback to be called when a PlaceRequest is being closed. The callback command must invoke the chain to proceed with the closing operation.
      • getOnOpenCallbacks

        public List<org.uberfire.mvp.Command> getOnOpenCallbacks​(org.uberfire.mvp.PlaceRequest place)
        Specified by:
        getOnOpenCallbacks in interface PlaceManager
      • getOnCloseCallbacks

        public List<org.uberfire.mvp.Command> getOnCloseCallbacks​(org.uberfire.mvp.PlaceRequest place)
        Specified by:
        getOnCloseCallbacks in interface PlaceManager
      • getActivitiesForResourceType

        public Collection<org.uberfire.mvp.impl.PathPlaceRequest> getActivitiesForResourceType​(org.uberfire.workbench.type.ResourceTypeDefinition type)
        Description copied from interface: PlaceManager
        Finds the currently open PlaceRequests for Activities that handle the given ResourceTypeDefinition.
        Specified by:
        getActivitiesForResourceType in interface PlaceManager
        Parameters:
        type - the ResourceTypeDefinition whose activity to search for
        Returns:
        an unmodifiable collection of PlaceRequests for the currently open WorkbenchEditorActivities that can handle the ResourceTypeDefinition. Returns an empty collection if no match was found.