Interface ScreenOpeningAction

All Superinterfaces:
Action
All Known Implementing Classes:
CreateAction, EditAction, EntityLookupAction, EntityOpenAction, EntityOpenCompositionAction

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

    • getOpenMode

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

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

      @Nullable String getScreenId()
      Returns the screen id if it was set by setScreenId(String) or in the screen XML, otherwise returns null.
    • setScreenId

      void setScreenId(@Nullable String screenId)
      Sets the screen id.
      Parameters:
      screenId - the screen id to set
    • getScreenClass

      @Nullable Class<? extends Screen> getScreenClass()
      Returns the screen class if it was set by setScreenClass(Class) or in the screen XML, otherwise returns null.
    • setScreenClass

      void setScreenClass(@Nullable Class<? extends Screen> screenClass)
      Sets the screen class.
      Parameters:
      screenClass - the screen class to set
    • getRouteParameters

      @Nullable com.vaadin.flow.router.RouteParameters getRouteParameters()
      Returns:
      route parameters or null if not set
    • setRouteParameters

      void setRouteParameters(@Nullable com.vaadin.flow.router.RouteParameters routeParameters)
      Sets route parameters that should be used in the route template.

      Note that route parameters are set if the editor is opened in OpenMode.NAVIGATION.

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

      @Nullable com.vaadin.flow.router.QueryParameters getQueryParameters()
      Returns:
      query parameters or null if not set
    • setQueryParameters

      void setQueryParameters(@Nullable com.vaadin.flow.router.QueryParameters queryParameters)
      Sets query parameters that should be used in the URL.

      Note that query parameters are set if the editor is opened in OpenMode.NAVIGATION.

      Parameters:
      queryParameters - query parameters to set
    • setAfterCloseHandler

      <S extends Screen<?>> void setAfterCloseHandler(@Nullable Consumer<DialogWindow.AfterCloseEvent<S>> afterCloseHandler)
      Sets the handler to be invoked when the editor screen closes.

      Note that handler is invoked if the editor 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.COMMIT)) {
               System.out.println("Committed");
           }
       }
       
      Type Parameters:
      S - screen type
      Parameters:
      afterCloseHandler - handler to set