|
||||||||||
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.AbstractSingleComponentContainer
public abstract class AbstractSingleComponentContainer
Abstract base class for component containers that have only one child
component.
For component containers that support multiple children, inherit
AbstractComponentContainer
instead of this class.
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 | |
---|---|
AbstractSingleComponentContainer()
|
Method Summary | |
---|---|
void |
addComponentAttachListener(HasComponents.ComponentAttachListener listener)
Listens the component attach events. |
void |
addComponentDetachListener(HasComponents.ComponentDetachListener listener)
Listens the component detach events. |
protected void |
fireComponentAttachEvent(Component component)
Fires the component attached event. |
protected void |
fireComponentDetachEvent(Component component)
Fires the component detached event. |
int |
getComponentCount()
Gets the number of children this SingleComponentContainer has. |
Component |
getContent()
Gets the content of this container. |
java.util.Iterator<Component> |
iterator()
Gets an iterator to the collection of contained components. |
void |
removeComponentAttachListener(HasComponents.ComponentAttachListener listener)
Stops the listening component attach events. |
void |
removeComponentDetachListener(HasComponents.ComponentDetachListener listener)
Stops the listening component detach events. |
static void |
removeFromParent(Component content)
Utility method for removing a component from its parent (if possible). |
void |
setContent(Component content)
Sets the content of this container. |
void |
setHeight(float height,
Sizeable.Unit unit)
Sets the height of the object. |
void |
setWidth(float width,
Sizeable.Unit unit)
Sets the width of the object. |
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, setPrimaryStyleName, setReadOnly, setStyleName, setVisible |
Methods inherited from interface com.vaadin.server.ClientConnector |
---|
addAttachListener, addDetachListener, beforeClientResponse, detach, encodeState, getErrorHandler, getExtensions, getRpcManager, getStateType, handleConnectorRequest, isConnectorEnabled, markAsDirty, markAsDirtyRecursive, removeAttachListener, removeDetachListener, removeExtension, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler, setParent |
Methods inherited from interface com.vaadin.shared.Connector |
---|
getConnectorId |
Methods inherited from interface com.vaadin.server.Sizeable |
---|
getHeight, getHeightUnits, getWidth, getWidthUnits, setHeight, setSizeFull, setSizeUndefined, setWidth |
Constructor Detail |
---|
public AbstractSingleComponentContainer()
Method Detail |
---|
public int getComponentCount()
SingleComponentContainer
SingleComponentContainer
has.
This must be symmetric with what HasComponents.iterator()
returns and thus
typically return 1 if the content is set, 0 otherwise.
getComponentCount
in interface SingleComponentContainer
public java.util.Iterator<Component> iterator()
HasComponents
iterator
in interface HasComponents
iterator
in interface java.lang.Iterable<Component>
public void addComponentAttachListener(HasComponents.ComponentAttachListener listener)
HasComponents.ComponentAttachDetachNotifier
addComponentAttachListener
in interface HasComponents.ComponentAttachDetachNotifier
listener
- the listener to add.public void removeComponentAttachListener(HasComponents.ComponentAttachListener listener)
HasComponents.ComponentAttachDetachNotifier
removeComponentAttachListener
in interface HasComponents.ComponentAttachDetachNotifier
listener
- the listener to removed.public void addComponentDetachListener(HasComponents.ComponentDetachListener listener)
HasComponents.ComponentAttachDetachNotifier
addComponentDetachListener
in interface HasComponents.ComponentAttachDetachNotifier
public void removeComponentDetachListener(HasComponents.ComponentDetachListener listener)
HasComponents.ComponentAttachDetachNotifier
removeComponentDetachListener
in interface HasComponents.ComponentAttachDetachNotifier
protected void fireComponentAttachEvent(Component component)
setContent(Component)
method after the component has been set as
the content.
component
- the component that has been added to this container.protected void fireComponentDetachEvent(Component component)
setContent(Component)
method after the content component has
been replaced by other content.
component
- the component that has been removed from this container.public Component getContent()
SingleComponentContainer
getContent
in interface SingleComponentContainer
SingleComponentContainer.setContent(Component)
public void setContent(Component content)
VerticalLayout
with margins
enabled as the default content but that is no longer the case.
setContent
in interface SingleComponentContainer
content
- a component (typically a layout) to use as contentpublic static void removeFromParent(Component content) throws java.lang.IllegalArgumentException
content
- component to remove
java.lang.IllegalArgumentException
public void setWidth(float width, Sizeable.Unit unit)
Sizeable
setWidth
in interface Sizeable
setWidth
in class AbstractComponent
width
- the width of the object.unit
- the unit used for the width.public void setHeight(float height, Sizeable.Unit unit)
Sizeable
setHeight
in interface Sizeable
setHeight
in class AbstractComponent
height
- the height of the object.unit
- the unit used for the width.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |