Package org.eclipse.e4.ui.model.application.ui

# Interface MElementContainer<T extends MUIElement>

Type Parameters:
  `T` - the type of contained children

All Superinterfaces:
  `MApplicationElement`, `MLocalizable`, `MUIElement`

All Known Subinterfaces:
  `MApplication`, `MArea`, `MCompositePart`, `MDialog`, `MGenericStack<T>`, `MGenericTile<T>`, `MGenericTrimContainer<T>`, `MMenu`, `MMenuContribution`, `MPartSashContainer`, `MPartStack`, `MPerspective`, `MPerspectiveStack`, `MPopupMenu`, `MToolBar`, `MToolBarContribution`, `MTrimBar`, `MTrimContribution`, `MTrimmedWindow`, `MWindow`, `MWizardDialog`

All Known Implementing Classes:
  `ApplicationImpl`, `AreaImpl`, `CompositePartImpl`, `ElementContainerImpl`, `GenericStackImpl`, `GenericTileImpl`, `GenericTrimContainerImpl`, `MenuContributionImpl`, `MenuImpl`, `PartSashContainerImpl`, `PartStackImpl`, `PerspectiveImpl`, `PerspectiveStackImpl`, `PopupMenuImpl`, `ToolBarContributionImpl`, `ToolBarImpl`, `TrimBarImpl`, `TrimContributionImpl`, `TrimmedWindowImpl`, `WindowImpl`

public interface MElementContainer<T extends MUIElement> extends MUIElement
A representation of the model object 'Element Container'.

This is the base for the two different types of containment used in the model; 'Stacks' (where only one element would be visible at a time) and 'Tiles' (where all the elements are visible at the same time.

All containers define the type of element that they are to contain. By design this is always a single type. Where different concrete types are to be contained within the same container they all both mix in a container-specific type. For example both MParts and MPlaceholders are valid children for an MPartStack so they both mix in 'StackElement' (which is an empty stub used only to constrain the stack's types.

Since:
  1.0
Restriction:
  This interface is not intended to be implemented by clients.

  The following features are supported:

  - `Children`
  - `Selected Element`

## Method Summary

Modifier and Type
Method
Description
`List<T>`
`getChildren()`
Returns the value of the 'Children' containment reference list.
`T`
`getSelectedElement()`
Returns the value of the 'Selected Element' reference.
`void`
`setSelectedElement(T value)`
Sets the value of the '`Selected Element`' reference.

### Methods inherited from interface org.eclipse.e4.ui.model.application.MApplicationElement

`getContributorURI, getElementId, getPersistedState, getTags, getTransientData, setContributorURI, setElementId`

### Methods inherited from interface org.eclipse.e4.ui.model.application.ui.MLocalizable

`updateLocalization`

### Methods inherited from interface org.eclipse.e4.ui.model.application.ui.MUIElement

`getAccessibilityPhrase, getContainerData, getCurSharedRef, getLocalizedAccessibilityPhrase, getParent, getRenderer, getVisibleWhen, getWidget, isOnTop, isToBeRendered, isVisible, setAccessibilityPhrase, setContainerData, setCurSharedRef, setOnTop, setParent, setRenderer, setToBeRendered, setVisible, setVisibleWhen, setWidget`

## Method Details

### getChildren

List<T> getChildren()
Returns the value of the 'Children' containment reference list. It is bidirectional and its opposite is '`Parent`'.

This is the list of contained elements in this container. All elements must be of type T.

Returns:
  the value of the 'Children' containment reference list.
See Also:
  - `MUIElement.getParent()`

### getSelectedElement

T getSelectedElement()
Returns the value of the 'Selected Element' reference.

This field contains the reference to the currently 'selected' element within a container. Note that the element must not only be in the container's children list but must also be visible in the presentation ("toBeRendered' == true).

Returns:
  the value of the 'Selected Element' reference.
See Also:
  - `setSelectedElement(MUIElement)`

### setSelectedElement

void setSelectedElement(T value)
Sets the value of the '`Selected Element`' reference.

Parameters:
  `value` - the new value of the 'Selected Element' reference.
See Also:
  - `getSelectedElement()`