|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.vaadin.server.AbstractClientConnector
com.vaadin.ui.AbstractComponent
com.vaadin.ui.CustomComponent
public class CustomComponent
Custom component provides a simple implementation of the 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
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.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface com.vaadin.ui.HasComponents |
---|
HasComponents.ComponentAttachDetachNotifier, HasComponents.ComponentAttachEvent, HasComponents.ComponentAttachListener, HasComponents.ComponentDetachEvent, HasComponents.ComponentDetachListener |
Nested classes/interfaces inherited from interface com.vaadin.ui.Component |
---|
Component.ErrorEvent, Component.Event, Component.Focusable, Component.Listener |
Nested classes/interfaces inherited from interface com.vaadin.server.ClientConnector |
---|
ClientConnector.AttachEvent, ClientConnector.AttachListener, ClientConnector.ConnectorErrorEvent, ClientConnector.DetachEvent, ClientConnector.DetachListener |
Nested classes/interfaces inherited from interface com.vaadin.server.Sizeable |
---|
Sizeable.Unit |
Field Summary |
---|
Fields inherited from interface com.vaadin.server.Sizeable |
---|
SIZE_UNDEFINED, UNITS_CM, UNITS_EM, UNITS_EX, UNITS_INCH, UNITS_MM, UNITS_PERCENTAGE, UNITS_PICAS, UNITS_PIXELS, UNITS_POINTS |
Constructor Summary | |
---|---|
CustomComponent()
Constructs a new custom component. |
|
CustomComponent(Component compositionRoot)
Constructs a new custom component. |
Method Summary | |
---|---|
int |
getComponentCount()
Gets the number of contained components. |
protected Component |
getCompositionRoot()
Returns the composition root. |
java.util.Iterator<Component> |
iterator()
Gets an iterator to the collection of contained components. |
protected void |
setCompositionRoot(Component compositionRoot)
Sets the composition root for the component. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.vaadin.ui.Component |
---|
addListener, addStyleName, attach, getCaption, getDescription, getIcon, getId, getLocale, getParent, getPrimaryStyleName, getStyleName, getUI, isEnabled, isReadOnly, isVisible, removeListener, removeStyleName, setCaption, setEnabled, setIcon, setId, setParent, setPrimaryStyleName, setReadOnly, setStyleName, setVisible |
Methods inherited from interface com.vaadin.server.ClientConnector |
---|
addAttachListener, addDetachListener, beforeClientResponse, detach, encodeState, getErrorHandler, getExtensions, getRpcManager, getStateType, handleConnectorRequest, isAttached, isConnectorEnabled, markAsDirty, markAsDirtyRecursive, removeAttachListener, removeDetachListener, removeExtension, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler |
Methods inherited from interface com.vaadin.shared.Connector |
---|
getConnectorId |
Methods inherited from interface com.vaadin.server.Sizeable |
---|
getHeight, getHeightUnits, getWidth, getWidthUnits, setHeight, setHeight, setSizeFull, setSizeUndefined, setWidth, setWidth |
Constructor Detail |
---|
public CustomComponent()
Note that you must set the composition root before the component can be used, preferably in the constructor.
public CustomComponent(Component compositionRoot)
compositionRoot
- the root of the composition component tree. It must not be
null.Method Detail |
---|
protected Component getCompositionRoot()
protected void setCompositionRoot(Component compositionRoot)
You must set the composition root must to a non-null value before the component can be used. You can change it later.
compositionRoot
- the root of the composition component tree.public java.util.Iterator<Component> iterator()
HasComponents
iterator
in interface HasComponents
iterator
in interface java.lang.Iterable<Component>
public int getComponentCount()
#getComponentIterator()
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |