|
||||||||||
| 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 class com.vaadin.ui.AbstractComponent |
|---|
AbstractComponent.ComponentErrorEvent, AbstractComponent.ComponentErrorHandler |
| 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.ErrorListener, Component.Event, Component.Focusable, Component.Listener |
| 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. |
boolean |
isComponentVisible(Component childComponent)
Checks if the child component is visible. |
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 |
setVisible(boolean visible)
Sets the visibility of the component. |
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 |
| Methods inherited from interface com.vaadin.server.ClientConnector |
|---|
beforeClientResponse, detach, encodeState, getExtensions, getStateType, handleConnectorRequest, isConnectorEnabled, markAsDirty, markAsDirtyRecursive, removeExtension, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setParent |
| Methods inherited from interface com.vaadin.shared.Connector |
|---|
getConnectorId |
| Methods inherited from interface com.vaadin.server.RpcTarget |
|---|
getRpcManager |
| 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()
SingleComponentContainerSingleComponentContainer 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 SingleComponentContainerpublic java.util.Iterator<Component> iterator()
HasComponents
iterator in interface HasComponentsiterator in interface java.lang.Iterable<Component>public void addComponentAttachListener(HasComponents.ComponentAttachListener listener)
HasComponents.ComponentAttachDetachNotifier
addComponentAttachListener in interface HasComponents.ComponentAttachDetachNotifierlistener - the listener to add.public void removeComponentAttachListener(HasComponents.ComponentAttachListener listener)
HasComponents.ComponentAttachDetachNotifier
removeComponentAttachListener in interface HasComponents.ComponentAttachDetachNotifierlistener - the listener to removed.public void addComponentDetachListener(HasComponents.ComponentDetachListener listener)
HasComponents.ComponentAttachDetachNotifier
addComponentDetachListener in interface HasComponents.ComponentAttachDetachNotifierpublic void removeComponentDetachListener(HasComponents.ComponentDetachListener listener)
HasComponents.ComponentAttachDetachNotifier
removeComponentDetachListener in interface HasComponents.ComponentAttachDetachNotifierprotected 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 boolean isComponentVisible(Component childComponent)
HasComponentsNote that this will prevent updates from reaching the child even though the child itself is set to visible. Also if a child is set to invisible this will not force it to be visible.
isComponentVisible in interface HasComponentschildComponent - The child component to check
public void setVisible(boolean visible)
ComponentVisible components are drawn in the user interface, while invisible ones are not. The effect is not merely a cosmetic CSS change - no information about an invisible component will be sent to the client. The effect is thus the same as removing the component from its parent.
TextField readonly = new TextField("Read-Only");
readonly.setValue("You can't see this!");
readonly.setVisible(false);
layout.addComponent(readonly);
A component is visible only if all of its parents are also visible. If a component is explicitly set to be invisible, changes in the visibility of its parents will not change the visibility of the component.
setVisible in interface ComponentsetVisible in class AbstractComponentvisible - the boolean value specifying if the component should be
visible after the call or not.Component.isVisible()public Component getContent()
SingleComponentContainer
getContent in interface SingleComponentContainerSingleComponentContainer.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 SingleComponentContainercontent - a component (typically a layout) to use as content
public 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 SizeablesetWidth in class AbstractComponentwidth - the width of the object.unit - the unit used for the width.
public void setHeight(float height,
Sizeable.Unit unit)
Sizeable
setHeight in interface SizeablesetHeight in class AbstractComponentheight - 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 | |||||||||