III.2. Composite views

III.2.1. Overview

View descriptors diagram

Figure III.2. View descriptors diagram


III.2.2. Reference

III.2.2.1. Reference for BasicCompositeViewDescriptor hierarchy

BasicCompositeViewDescriptor

This is the abstract base class for all composite views. A composite view is a view that arranges a collection of nested views in a predefined layout. Nested views can also be composite views which makes it possible to build complex UIs out of simple combinations. Composite views are also the foundation of master-detail views by allowing a nested view to take its model out of the selection of the previous one. This behaviour can be activated using the cascadingModels property that "cascades" the view models based on the selected elements. Whenever this behaviour is not activated, all nested views share the same model than their parent composite unless specified otherwise.

Table III.18. BasicCompositeViewDescriptor properties

PropertyDescription

cascadingModels

boolean

Enables the model "cascading" behaviour. This allows for instance to link 2 nested tables where the 2nd table model is the selected row of the first table (or null if selection is empty). Using cascadingModel=true is only necessary when tracking view selection on the master nested view. You don't need it if, for instance, the master nested view is a single model view like a omponent view. In the latter case, you can bind a table detail view just by adding it to the same composite without having to set cascadingModel=true.

Default value is false, i.e. al nested views share the same model than the outer composite unless explicitely specified differently.


BasicBorderViewDescriptor

A border view is a composite view that arranges its children to the north, west, east, south and center. Depending its position in the container, the resizing rules apply differently :

  • north and south are resized horizontally and kept to their preferred size vertically

  • west and east are resized vertically and kept to their preferred size horizontally

  • center is resized both horizontally and vertically

Default cascading order for master-detail is :

north -> west -> center -> east -> south

Table III.19. BasicBorderViewDescriptor properties

PropertyDescription

centerViewDescriptor

IView​Descriptor

Sets the child view to layout in the center zone. The child view will be resized both horizontally and vertically.

eastViewDescriptor

IView​Descriptor

Sets the child view to layout in the east zone. The child view will be resized vertically.

northViewDescriptor

IView​Descriptor

Sets the child view to layout in the north zone. The child view will be resized horizontally.

southViewDescriptor

IView​Descriptor

Sets the child view to layout in the south zone. The child view will be resized horizontally.

westViewDescriptor

IView​Descriptor

Sets the child view to layout in the west zone. The child view will be resized vertically.


BasicConstrainedGridViewDescriptor

This composite view arranges its children in a grid where cell behaviour and dimensions are configured using cell constraints. A cell constraint is a simple data structure holding the following properties :

  • row: the row to which the cell belongs

  • column: the column to which the cell belongs

  • width: the number of columns the cell spans horizontally (default value is 1)

  • height: the number of rows the cell spans vertically (default value is 1)

  • heightResizable: wether the cell should be resized to take all the available space vertically

  • widthResizable: wether the cell should be resized to take all the available space horizontally

Default cascading order follows the order of nested view registrations in the container.

Table III.20. BasicConstrainedGridViewDescriptor properties

PropertyDescription

cells

Map​<​IView​Descriptor​,Cell​Constraints​>​

Registers the nested children views along with their cell constaints. They are set as a Map that is :

  • keyed by the children views

  • valued by the cell constraints to apply to each nested view


BasicEvenGridViewDescriptor

This composite view arranges its children in a grid where cells are distributed evenly. All cells are resized horizontally and vertically to fill its available space.

The number of cells in a row / column is determined by the combination of the drivingDimension and drivingDimensionCellCount properties. the cells are spread along the driving dimension (row or column) until the maximum number of cells in the dimension has been reached. Then a new row (or column) is added. The process repeats until all the cells have been added.

This container does not allow for individual cell configuration like row/column spanning. Whenever cell disposition has to be customized more finely, a BasicConstrainedGridViewDescriptor should be used instead.

Default cascading order follows the order of nested view registrations in the container.

Table III.21. BasicEvenGridViewDescriptor properties

PropertyDescription

cells

List​<​IView​Descriptor​>​

Registers the nested views to display as grid cells.

drivingDimension

EAxis

Configures the driving dimension of the grid. This is either a value of the EAxis enum or its equivalent string representation :

  • ROW for distributing cells along rows then columns

  • COLUMN for distributing cells along columns then rows

Default value is EAxis.ROW, i.e. distribute cells along rows then columns.

drivingDimensionCellCount

int

This property configures the maximum number of cells in the driving dimension (row or column). Nested views are distributed along the driving axis until this maximum number has been reached. A new row or column is then created to host the remaining cells.


BasicSplitViewDescriptor

This composite view arranges its children in a container splitted either horizontally or vertically. An horizontal split disposes its 2 children left and right whereas a vertical split disposes its 2 children top and bottom. The dividing bar can typically be moved by the user to distribute the available space.

Default cascading order for master-detail is :

left -> right or top -> bottom depending on the split orientation.

Table III.22. BasicSplitViewDescriptor properties

PropertyDescription

leftTopViewDescriptor

IView​Descriptor

Sets the left (horizontal split) of top (vertical split) nested view.

orientation

EOrientation

Configures the split orientation of the container. This is either a value of the EOrientation enum or its equivalent string representation :

  • VERTICAL for splitting the container vertically and arranging the views top and bottom

  • HORIZONTAL for splitting the container horizontally and arranging the views left and right

Default value is EOrientation.VERTICAL, i.e. the ontainer is splitted vertically.

rightBottomViewDescriptor

IView​Descriptor

Sets the right (horizontal split) of bottom (vertical split) nested view.


BasicTabViewDescriptor

This composite view arranges its children in tabs. Each tab potentially displays a label (that is translated based on the name of the view in the tab), an icon (based on the icon of the view in the tab) and a toolTip (based on the description of the view in the tab).

Default cascading order follows the order of nested view registrations in the container.

Table III.23. BasicTabViewDescriptor properties

PropertyDescription

lazy

boolean

When set to true, this parmeter configures the tabs to be lazy bound (binding occurs only for the selected tab). This feature is only supported for tab views with cascadingModel set to true. default value is true.

renderingOptions

ERendering​Options

Indicates how the tabs should be rendered. This is either a value of the ERenderingOptions enum or its equivalent string representation :

  • LABEL_ICON for label and icon

  • LABEL for label only

  • ICON for icon only.

Default value is ERenderingOptions.LABEL_ICON, i.e. label and icon.

tabs

List​<​IView​Descriptor​>​

Registers the list of views to be displayed as tabs. The tabs order follows the children views order of this list.