Interface WorkbenchActivity

    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      String contextId()  
      org.uberfire.workbench.model.Position getDefaultPosition()
      Specifies custom positioning for this activity's view when the request to launch it comes without specific positioning information of its own.
      void getMenus​(Consumer<org.uberfire.workbench.model.menu.Menus> menusConsumer)  
      org.uberfire.mvp.PlaceRequest getOwningPlace()
      Returns the PlaceRequest for the perspective that this activity should always be displayed in.
      String getTitle()  
      com.google.gwt.user.client.ui.IsWidget getTitleDecoration()  
      default com.google.gwt.dom.client.Element getTitleDecorationElement()  
      org.uberfire.workbench.model.toolbar.ToolBar getToolBar()  
      com.google.gwt.user.client.ui.IsWidget getWidget()  
      default com.google.gwt.dom.client.Element getWidgetElement()  
      void onFocus()
      Invoked by the UberFire framework when this activity is the current activity in the current panel.
      void onLostFocus()
      Invoked by the UberFire framework when this activity is no longer the current activity in the current panel.
      boolean onMayClose()
      Invoked by the framework before this activity is closed, unless the framework has been told to "force close" the activity.
      default int preferredHeight()
      Returns the amount of space that should be allocated to this activity if a new Workbench Panel is created when first displaying it.
      default int preferredWidth()
      Returns the amount of space that should be allocated to this activity if a new Workbench Panel is created when first displaying it.
      • Methods inherited from interface org.uberfire.security.Resource

        getDependencies, getIdentifier, getResourceType, isType
    • Method Detail

      • onMayClose

        boolean onMayClose()
        Invoked 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 false from this method. This is most often used for implementing a "save before closing" workflow.

        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)
      • getDefaultPosition

        org.uberfire.workbench.model.Position getDefaultPosition()
        Specifies 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.

        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

        org.uberfire.mvp.PlaceRequest getOwningPlace()
        Returns the PlaceRequest for the perspective that this activity should always be displayed in. When the PlaceManager is asked to go to this activity, it will switching to the owning perspective first, and then show this activity in it.
        Returns:
        the owning perspective's place request, or null if this activity can appear in any perspective.
      • getTitleDecoration

        @JsIgnore
        com.google.gwt.user.client.ui.IsWidget getTitleDecoration()
      • getTitleDecorationElement

        default com.google.gwt.dom.client.Element getTitleDecorationElement()
      • getWidget

        @JsIgnore
        com.google.gwt.user.client.ui.IsWidget getWidget()
      • getWidgetElement

        default com.google.gwt.dom.client.Element getWidgetElement()
      • getMenus

        void getMenus​(Consumer<org.uberfire.workbench.model.menu.Menus> menusConsumer)
      • getToolBar

        org.uberfire.workbench.model.toolbar.ToolBar getToolBar()
      • contextId

        String contextId()
      • preferredHeight

        default int preferredHeight()
        Returns the amount of space that should be allocated to this activity if a new Workbench Panel is created when first displaying it. Has no effect when the activity is added to a pre-existing panel, including the case where the activity is added to a panel as part of a default perspective layout.
        Returns:
        the height, in pixels, that should be allocated for a new panel created to house this activity. -1 (default) means no particular height is preferred, and the framework can choose a default height.
      • preferredWidth

        default int preferredWidth()
        Returns the amount of space that should be allocated to this activity if a new Workbench Panel is created when first displaying it. Has no effect when the activity is added to a pre-existing panel, including the case where the activity is added to a panel as part of a default perspective layout.
        Returns:
        the width, in pixels, that should be allocated for a new panel created to house this activity. -1 (default) means no particular width is preferred, and the framework can choose a default width.