Interface ViewOpeningAction

All Superinterfaces:
Action, HasShortcutCombination
All Known Implementing Classes:
AddAction, CreateAction, EditAction, EntityInspectorAddAction, EntityInspectorCreateAction, EntityInspectorEditAction, EntityInspectorLookupAction, EntityLookupAction, EntityOpenAction, EntityOpenCompositionAction, ReadAction

public interface ViewOpeningAction extends Action
Interface to be implemented by actions that open a view.
  • Method Details

    • getOpenMode

      @Nullable OpenMode getOpenMode()
      Returns the view open mode if it was set by setOpenMode(OpenMode) or in the view XML, otherwise returns null.
    • setOpenMode

      void setOpenMode(@Nullable OpenMode openMode)
      Sets the view open mode.
      Parameters:
      openMode - the open mode to set
    • getViewId

      @Nullable String getViewId()
      Returns the view id if it was set by setViewId(String) or in the view XML, otherwise returns null.
    • setViewId

      void setViewId(@Nullable String viewId)
      Sets the view id.
      Parameters:
      viewId - the view id to set
    • getViewClass

      @Nullable Class<? extends View> getViewClass()
      Returns the view class if it was set by setViewClass(Class) or in the view XML, otherwise returns null.
    • setViewClass

      void setViewClass(@Nullable Class<? extends View> viewClass)
      Sets the view class.
      Parameters:
      viewClass - the view class to set
    • getRouteParametersProvider

      @Nullable ViewOpeningAction.RouteParametersProvider getRouteParametersProvider()
      Returns:
      route parameters or null if not set
    • setRouteParametersProvider

      void setRouteParametersProvider(@Nullable ViewOpeningAction.RouteParametersProvider routeParameters)
      Sets route parameters provider that returns route parameters that should be used in the route template.

      Note that route parameters provider is set if the detail is opened in OpenMode.NAVIGATION.

      Parameters:
      routeParameters - route parameters provider to set
      See Also:
      • Route
    • getQueryParametersProvider

      @Nullable ViewOpeningAction.QueryParametersProvider getQueryParametersProvider()
      Returns:
      query parameters provider or null if not set
    • setQueryParametersProvider

      void setQueryParametersProvider(@Nullable ViewOpeningAction.QueryParametersProvider queryParameters)
      Sets query parameters provider that returns query parameters that should be used in the URL.

      Note that query parameters provider is set if the detail is opened in OpenMode.NAVIGATION.

      Parameters:
      queryParameters - query parameters provider to set
    • setAfterCloseHandler

      <V extends View<?>> void setAfterCloseHandler(@Nullable Consumer<DialogWindow.AfterCloseEvent<V>> afterCloseHandler)
      Sets the handler to be invoked when the detail view closes.

      Note that handler is invoked if the detail is opened in OpenMode.DIALOG mode.

      The preferred way to set the handler is using a controller method annotated with Install, e.g.:

       @Install(to = "petsTable.view", subject = "afterCloseHandler")
       protected void petsTableViewAfterCloseHandler(AfterCloseEvent event) {
           if (event.closedWith(StandardOutcome.SAVE)) {
               System.out.println("Saved");
           }
       }
       
      Type Parameters:
      V - view type
      Parameters:
      afterCloseHandler - handler to set