Interface ScreenFacet<S extends Screen>

All Superinterfaces:
org.springframework.context.ApplicationContextAware, org.springframework.beans.factory.Aware, Facet
All Known Subinterfaces:
EditorScreenFacet<E,S>, LookupScreenFacet<E,S>
All Known Implementing Classes:
AbstractEntityAwareScreenFacet, AbstractScreenFacet, EditorScreenFacetImpl, LookupScreenFacetImpl, ScreenFacetImpl

@StudioFacet(xmlElement="screen", caption="Screen", description="Prepares and shows screens", defaultProperty="screenId", category="Facets", icon="io/jmix/ui/icon/facet/screen.svg", documentationURL="https://docs.jmix.io/jmix/%VERSION%/ui/facets/screen-facet.html") public interface ScreenFacet<S extends Screen> extends Facet, org.springframework.context.ApplicationContextAware
Prepares and shows screens.
  • Method Details

    • setScreenId

      @StudioProperty(type=SCREEN_ID, typeParameter="S") void setScreenId(@Nullable String screenId)
      Sets the id of screen to open.
      Parameters:
      screenId - screen id
    • getScreenId

      @Nullable String getScreenId()
      Returns:
      screen id
    • setScreenClass

      @StudioProperty(type=SCREEN_CLASS_NAME, typeParameter="S") void setScreenClass(@Nullable Class<S> screenClass)
      Sets class of screen to open.
      Parameters:
      screenClass - screen class
    • getScreenClass

      @Nullable Class<S> getScreenClass()
      Returns:
      class of screen to open
    • getOpenMode

      OpenMode getOpenMode()
      Returns:
      screen OpenMode
    • setOpenMode

      @StudioProperty(name="openMode", type=SCREEN_OPEN_MODE, defaultValue="NEW_TAB") void setOpenMode(OpenMode openMode)
      Sets screen OpenMode.
      Parameters:
      openMode - an open mode to set
    • setOptionsProvider

      void setOptionsProvider(@Nullable Supplier<ScreenOptions> optionsProvider)
      Sets the given Supplier as screen options provider.
      Parameters:
      optionsProvider - screen options provider
    • getOptionsProvider

      @Nullable Supplier<ScreenOptions> getOptionsProvider()
      Returns:
      ScreenOptions provider
    • getScreenConfigurer

      @Nullable Consumer<S> getScreenConfigurer()
      Returns:
      the screen configurer or null of not set
    • setScreenConfigurer

      void setScreenConfigurer(Consumer<S> 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 = "userBrowseFacet", subject = "screenConfigurer")
       private void userBrowseFacetScreenConfigurer(UserBrowse userBrowse) {
           userBrowse.setSomeParameter(someValue);
       }
       
      Parameters:
      screenConfigurer - the configurer to set.
    • setProperties

      @StudioElementsGroup(caption="Properties", xmlElement="properties", icon="io/jmix/ui/icon/element/properties.svg") void setProperties(Collection<UiControllerProperty> properties)
      Sets properties that will be injected into opened screen via public setters.
      Parameters:
      properties - screen properties
    • getProperties

      @Nullable Collection<UiControllerProperty> getProperties()
      Returns:
      properties that will be injected into opened screen via public setters.
    • getActionTarget

      @Nullable String getActionTarget()
      Returns:
      id of action that triggers screen
    • setActionTarget

      @StudioProperty(name="onAction", type=COMPONENT_REF, options="io.jmix.ui.action.Action") void setActionTarget(@Nullable String actionId)
      Sets that screen should be shown when action with id actionId is performed.
      Parameters:
      actionId - action id
    • getButtonTarget

      @Nullable String getButtonTarget()
      Returns:
      id of button that triggers screen
    • setButtonTarget

      @StudioProperty(name="onButton", type=COMPONENT_REF, options="io.jmix.ui.component.Button") void setButtonTarget(@Nullable String buttonId)
      Sets that screen should be shown when button with id actionId is clicked.
      Parameters:
      buttonId - button id
    • create

      S create()
      Returns:
      new screen instance
    • show

      S show()
      Shows and returns screen.
    • addAfterShowEventListener

      Subscription addAfterShowEventListener(Consumer<Screen.AfterShowEvent> listener)
      Adds the given Consumer as screen after show event listener.
      Parameters:
      listener - listener
      Returns:
      after show event subscription
    • addAfterCloseEventListener

      Subscription addAfterCloseEventListener(Consumer<Screen.AfterCloseEvent> listener)
      Adds the given Consumer as screen after close event listener.
      Parameters:
      listener - listener
      Returns:
      after close event subscription