Class Screen

java.lang.Object
io.jmix.ui.screen.Screen
All Implemented Interfaces:
FrameOwner
Direct Known Subclasses:
ActivateProcessDefinitionScreen, AppSettingsEntityScreen, AttributeEnumerationScreen, BackgroundWorkDialog, BpmnModelerScreen, BulkEditorWindow, ChangePasswordDialog, ColspanDialog, CreateNotificationScreen, CssLayoutCreationDialog, DashboardViewScreen, DateIntervalDialog, DecisionTableModelerScreen, DefaultStartProcessForm, DefaultTaskProcessForm, DmnDecisionTableBrowse, DynamicProcessForm, EmailAddressEdit, EmailContentEdit, EmailTemplateSendScreen, EntityInfoWindow, EntityValueScreen, ExpandDialog, FileUploadDialog, GridCreationDialog, HitPolicySelectScreen, HtmlSourceCodeScreen, InputDialog, InputEntryEdit, InputParametersDialog, JmxConsoleScreen, LayoutAnalyzerScreen, MBeanOperationResultScreen, MultipleResourcePolicyModelCreateScreen, NotFoundScreen, PivotTableScreen, ProcessInstanceMigrationScreen, ReportImportDialog, ReportWizardCreator, ResendMessage, ResetPasswordDialog, ResponsiveCreationDialog, RoleAssignmentScreen, ScriptEditor, ScriptEditorDialog, SearchResultsScreen, SelectValueDialog, SendingMessageBrowser, ShowChartScreen, ShowPivotTableScreen, ShowReportTableScreen, StandardEditor, StandardLookup, StyleDialog, SuspendProcessDefinitionScreen, TaskReassignScreen, TestMainScreen, ThemeSettingsScreen, UserInAppNotificationBrowseScreen, UserSubstitutionsScreen, WeightDialog

public abstract class Screen extends Object implements FrameOwner
Base class for all screen controllers.
See Also:
  • Constructor Details

    • Screen

      public Screen()
  • Method Details

    • getApplicationContext

      protected org.springframework.context.ApplicationContext getApplicationContext()
    • setApplicationContext

      @Autowired protected void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
    • getEventHub

      protected EventHub getEventHub()
    • getExtensions

      @Nullable protected Map<Class<?>,Object> getExtensions()
    • setExtensions

      protected void setExtensions(@Nullable Map<Class<?>,Object> extensions)
    • getId

      @Nullable public String getId()
    • setId

      protected void setId(@Nullable String id)
      Sets id of the screen. Called by the framework during screen init to assign screen id.
      Parameters:
      id - screen id
    • getScreenData

      protected ScreenData getScreenData()
    • setScreenData

      protected void setScreenData(ScreenData data)
    • fireEvent

      protected <E> void fireEvent(Class<E> eventType, E event)
    • getWindow

      public Window getWindow()
      Returns:
      screen UI component
    • setWindow

      protected void setWindow(Window window)
    • getUiEventListeners

      @Nullable protected List<org.springframework.context.ApplicationListener> getUiEventListeners()
    • setUiEventListeners

      protected void setUiEventListeners(@Nullable List<org.springframework.context.ApplicationListener> listeners)
    • addInitListener

      protected Subscription addInitListener(Consumer<Screen.InitEvent> listener)
      Adds Screen.InitEvent listener.

      You can also add an event listener declaratively using a controller method annotated with Subscribe:

          @Subscribe
          protected void onInit(InitEvent event) {
             // handle event here
          }
       
      Parameters:
      listener - listener
      Returns:
      subscription
    • addAfterInitListener

      protected Subscription addAfterInitListener(Consumer<Screen.AfterInitEvent> listener)
      Adds Screen.AfterInitEvent listener.

      You can also add an event listener declaratively using a controller method annotated with Subscribe:

          @Subscribe
          protected void onAfterInit(AfterInitEvent event) {
             // handle event here
          }
       
      Parameters:
      listener - listener
      Returns:
      subscription
    • addBeforeCloseListener

      protected Subscription addBeforeCloseListener(Consumer<Screen.BeforeCloseEvent> listener)
      Adds Screen.BeforeCloseEvent listener.

      You can also add an event listener declaratively using a controller method annotated with Subscribe:

          @Subscribe
          protected void onBeforeClose(BeforeCloseEvent event) {
             // handle event here
          }
       
      Parameters:
      listener - listener
      Returns:
      subscription
    • addBeforeShowListener

      protected Subscription addBeforeShowListener(Consumer<Screen.BeforeShowEvent> listener)
      Adds Screen.BeforeShowEvent listener.

      You can also add an event listener declaratively using a controller method annotated with Subscribe:

          @Subscribe
          protected void onBeforeShow(BeforeShowEvent event) {
             // handle event here
          }
       
      Parameters:
      listener - listener
      Returns:
      subscription
    • addAfterShowListener

      public Subscription addAfterShowListener(Consumer<Screen.AfterShowEvent> listener)
      Adds Screen.AfterShowEvent listener.

      You can also add an event listener declaratively using a controller method annotated with Subscribe:

          @Subscribe
          protected void onAfterShow(AfterShowEvent event) {
             // handle event here
          }
       
      Parameters:
      listener - listener
      Returns:
      subscription
    • addAfterCloseListener

      public Subscription addAfterCloseListener(Consumer<Screen.AfterCloseEvent> listener)
      Adds Screen.AfterCloseEvent listener.

      You can also add an event listener declaratively using a controller method annotated with Subscribe:

          @Subscribe
          protected void onAfterClose(AfterCloseEvent event) {
             // handle event here
          }
       
      Parameters:
      listener - listener
      Returns:
      subscription
    • addAfterDetachListener

      protected Subscription addAfterDetachListener(Consumer<Screen.AfterDetachEvent> listener)
      Adds Screen.AfterDetachEvent listener.

      You can also add an event listener declaratively using a controller method annotated with Subscribe:

          @Subscribe
          protected void onAfterDetach(AfterDetachEvent event) {
             // handle event here
          }
       
      Parameters:
      listener - listener
      Returns:
      subscription
    • addUrlParamsChangeListener

      protected Subscription addUrlParamsChangeListener(Consumer<UrlParamsChangedEvent> listener)
      Adds UrlParamsChangedEvent listener.

      You can also add an event listener declaratively using a controller method annotated with Subscribe:

          @Subscribe
          protected void onUrlParamsChanged(UrlParamsChangedEvent event) {
             // handle event here
          }
       
      Parameters:
      listener - listener
      Returns:
      subscription
    • show

      public Screen show()
      Shows this screen.
      See Also:
    • close

      public OperationResult close(CloseAction action)
      Requests closing of the screen caused by the given action.
      Parameters:
      action - close action which is propagated to Screen.BeforeCloseEvent and Screen.AfterCloseEvent
      Returns:
      result of operation
    • closeWithDefaultAction

      public OperationResult closeWithDefaultAction()
      Closes the screen with FrameOwner.WINDOW_CLOSE_ACTION action.
      Returns:
      result of close request
    • close

      public OperationResult close(StandardOutcome outcome)
      Requests closing of the screen with the given outcome.
      Parameters:
      outcome - StandardOutcome
      Returns:
      result of operation
    • isMultipleOpen

      protected boolean isMultipleOpen()
      Returns:
      true if screen can be opened multiple times from a navigation menu
    • isSameScreen

      protected boolean isSameScreen(Screen openedScreen)
      Compares this screen with an already opened screen.
      Parameters:
      openedScreen - already opened screen
      Returns:
      true if screens are the same