Class AbstractScreenFacet<S extends Screen>

java.lang.Object
io.jmix.ui.component.impl.AbstractFacet
io.jmix.ui.component.impl.AbstractScreenFacet<S>
All Implemented Interfaces:
Facet, ScreenFacet<S>, org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware
Direct Known Subclasses:
AbstractEntityAwareScreenFacet, ScreenFacetImpl

public abstract class AbstractScreenFacet<S extends Screen> extends AbstractFacet implements ScreenFacet<S>
  • Field Details

  • Constructor Details

    • AbstractScreenFacet

      public AbstractScreenFacet()
  • Method Details

    • setApplicationContext

      public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
      Specified by:
      setApplicationContext in interface org.springframework.context.ApplicationContextAware
    • setScreenId

      public void setScreenId(@Nullable String screenId)
      Description copied from interface: ScreenFacet
      Sets the id of screen to open.
      Specified by:
      setScreenId in interface ScreenFacet<S extends Screen>
      Parameters:
      screenId - screen id
    • getScreenId

      @Nullable public String getScreenId()
      Specified by:
      getScreenId in interface ScreenFacet<S extends Screen>
      Returns:
      screen id
    • setScreenClass

      public void setScreenClass(@Nullable Class<S> screenClass)
      Description copied from interface: ScreenFacet
      Sets class of screen to open.
      Specified by:
      setScreenClass in interface ScreenFacet<S extends Screen>
      Parameters:
      screenClass - screen class
    • getScreenClass

      @Nullable public Class<S> getScreenClass()
      Specified by:
      getScreenClass in interface ScreenFacet<S extends Screen>
      Returns:
      class of screen to open
    • getOpenMode

      public OpenMode getOpenMode()
      Specified by:
      getOpenMode in interface ScreenFacet<S extends Screen>
      Returns:
      screen OpenMode
    • setOpenMode

      public void setOpenMode(OpenMode openMode)
      Description copied from interface: ScreenFacet
      Sets screen OpenMode.
      Specified by:
      setOpenMode in interface ScreenFacet<S extends Screen>
      Parameters:
      openMode - an open mode to set
    • setOptionsProvider

      public void setOptionsProvider(@Nullable Supplier<ScreenOptions> optionsProvider)
      Description copied from interface: ScreenFacet
      Sets the given Supplier as screen options provider.
      Specified by:
      setOptionsProvider in interface ScreenFacet<S extends Screen>
      Parameters:
      optionsProvider - screen options provider
    • getOptionsProvider

      @Nullable public Supplier<ScreenOptions> getOptionsProvider()
      Specified by:
      getOptionsProvider in interface ScreenFacet<S extends Screen>
      Returns:
      ScreenOptions provider
    • getScreenConfigurer

      @Nullable public Consumer<S> getScreenConfigurer()
      Specified by:
      getScreenConfigurer in interface ScreenFacet<S extends Screen>
      Returns:
      the screen configurer or null of not set
    • setScreenConfigurer

      public void setScreenConfigurer(Consumer<S> screenConfigurer)
      Description copied from interface: ScreenFacet
      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);
       }
       
      Specified by:
      setScreenConfigurer in interface ScreenFacet<S extends Screen>
      Parameters:
      screenConfigurer - the configurer to set.
    • setProperties

      public void setProperties(Collection<UiControllerProperty> properties)
      Description copied from interface: ScreenFacet
      Sets properties that will be injected into opened screen via public setters.
      Specified by:
      setProperties in interface ScreenFacet<S extends Screen>
      Parameters:
      properties - screen properties
    • getProperties

      @Nullable public Collection<UiControllerProperty> getProperties()
      Specified by:
      getProperties in interface ScreenFacet<S extends Screen>
      Returns:
      properties that will be injected into opened screen via public setters.
    • getActionTarget

      @Nullable public String getActionTarget()
      Specified by:
      getActionTarget in interface ScreenFacet<S extends Screen>
      Returns:
      id of action that triggers screen
    • setActionTarget

      public void setActionTarget(@Nullable String actionId)
      Description copied from interface: ScreenFacet
      Sets that screen should be shown when action with id actionId is performed.
      Specified by:
      setActionTarget in interface ScreenFacet<S extends Screen>
      Parameters:
      actionId - action id
    • getButtonTarget

      @Nullable public String getButtonTarget()
      Specified by:
      getButtonTarget in interface ScreenFacet<S extends Screen>
      Returns:
      id of button that triggers screen
    • setButtonTarget

      public void setButtonTarget(@Nullable String buttonId)
      Description copied from interface: ScreenFacet
      Sets that screen should be shown when button with id actionId is clicked.
      Specified by:
      setButtonTarget in interface ScreenFacet<S extends Screen>
      Parameters:
      buttonId - button id
    • setOwner

      public void setOwner(@Nullable Frame owner)
      Description copied from interface: Facet
      Sets owner frame (Window or Fragment) to the facet.
      Specified by:
      setOwner in interface Facet
      Overrides:
      setOwner in class AbstractFacet
      Parameters:
      owner - owner frame
    • addAfterShowEventListener

      public Subscription addAfterShowEventListener(Consumer<Screen.AfterShowEvent> listener)
      Description copied from interface: ScreenFacet
      Adds the given Consumer as screen after show event listener.
      Specified by:
      addAfterShowEventListener in interface ScreenFacet<S extends Screen>
      Parameters:
      listener - listener
      Returns:
      after show event subscription
    • internalRemoveAfterShowEventListener

      protected void internalRemoveAfterShowEventListener(Consumer<Screen.AfterShowEvent> listener)
    • addAfterCloseEventListener

      public Subscription addAfterCloseEventListener(Consumer<Screen.AfterCloseEvent> listener)
      Description copied from interface: ScreenFacet
      Adds the given Consumer as screen after close event listener.
      Specified by:
      addAfterCloseEventListener in interface ScreenFacet<S extends Screen>
      Parameters:
      listener - listener
      Returns:
      after close event subscription
    • internalRemoveAfterCloseEventListener

      protected void internalRemoveAfterCloseEventListener(Consumer<Screen.AfterCloseEvent> listener)
    • initScreenListeners

      protected void initScreenListeners(Screen screen)
    • subscribe

      protected void subscribe()
    • subscribeOnAction

      protected void subscribeOnAction(Frame owner)
    • subscribeOnButton

      protected void subscribeOnButton(Frame owner)
    • injectScreenProperties

      protected void injectScreenProperties(S screen, Collection<UiControllerProperty> properties)
    • applyScreenConfigurer

      protected void applyScreenConfigurer(S screen)
    • getScreenOptions

      protected ScreenOptions getScreenOptions()