Interface Action.ScreenOpeningAction

All Known Implementing Classes:
AbstractLookupAction, AddAction, CreateAction, EditAction, EntityLookupAction, EntityOpenAction, EntityOpenCompositionAction, RelatedAction, TagLookupAction, ViewAction
Enclosing interface:
Action

public static interface Action.ScreenOpeningAction
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
    • setScreenOptionsSupplier

      void setScreenOptionsSupplier(Supplier<ScreenOptions> screenOptionsSupplier)
      Sets the screen options supplier. The supplier provides ScreenOptions to the opened screen.

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

       @Install(to = "petsTable.view", subject = "screenOptionsSupplier")
       protected ScreenOptions petsTableViewScreenOptionsSupplier() {
           return new MapScreenOptions(ParamsMap.of("someParameter", 10));
       }
       
    • setScreenConfigurer

      void setScreenConfigurer(Consumer<Screen> screenConfigurer)
      Sets the screen configurer. Use the configurer if you need to provide parameters to the opened screen through setters.

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

       @Install(to = "petsTable.view", subject = "screenConfigurer")
       protected void petsTableViewScreenConfigurer(Screen editorScreen) {
           ((PetEdit) editorScreen).setSomeParameter(someValue);
       }
       
    • setAfterCloseHandler

      void setAfterCloseHandler(Consumer<Screen.AfterCloseEvent> afterCloseHandler)
      Sets the handler to be invoked when the editor screen closes.

      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");
           }
       }