Screen Controllers

A screen controller is a Java or Groovy class that contains the screen initialization and event handling logic. Normally, a controller is linked to an XML descriptor which defines a screen layout and data containers, but it can also create all visual and non-visual components programmatically.

All screen controllers implement the FrameOwner marker interface. The name of this interface means that it has a reference to a frame, which is a visual component representing a screen when it is shown in the main application window. There are two types of frames:

  • Window - a standalone window that can be displayed inside the main application window in a tab or as a modal dialog.

  • Fragment - a lightweight component that can be added to windows or other fragments.

Controllers are also divided into two distinct categories according to the frames they use:

  • Screen - a base class of window controllers.

  • ScreenFragment - a base class of fragment controllers.

Diagram

The Screen class provides basic functionality for all standalone screens. There are also more specific base classes to use for screens working with entities:

  • StandardEditor - a base class for entity editor screens.

  • StandardLookup - a base class for entity browse and lookup screens.

  • MasterDetailScreen - a combined screen displaying a list of entities on the left and details of the selected entity on the right.

Diagram