Custom component provides a simple implementation of the {@link Component}interface to allow creating new UI components by composition of existing server-side components.
The component is used by inheriting the CustomComponent class and setting the composition root component. The composition root must be set with {@link #setCompositionRoot(Component)} before the CustomComponent is used,such as by adding it to a layout, so it is preferable to set it in the constructor.
The composition root itself can contain more components. The advantage of wrapping it in a CustomComponent is that its details, such as interfaces, are hidden from the users of the component, thereby contributing to information hiding.
The CustomComponent does not display the caption of the composition root, so if you want to have it shown in the layout where the custom component is contained, you need to set it as caption of the CustomComponent.
The component expands horizontally and has undefined height by default.
@author Vaadin Ltd.
@since 3.0