|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.vaadin.ui.AbstractComponent
com.vaadin.ui.AbstractComponentContainer
public abstract class AbstractComponentContainer
Extension to AbstractComponent
that defines the default
implementation for the methods in ComponentContainer
. Basic UI
components that need to contain other components inherit this class to easily
qualify as a component container.
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.ComponentContainer |
---|
ComponentContainer.ComponentAttachEvent, ComponentContainer.ComponentAttachListener, ComponentContainer.ComponentDetachEvent, ComponentContainer.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.terminal.Paintable |
---|
Paintable.RepaintRequestEvent, Paintable.RepaintRequestListener |
Field Summary |
---|
Fields inherited from interface com.vaadin.terminal.Sizeable |
---|
SIZE_UNDEFINED, UNIT_SYMBOLS, UNITS_CM, UNITS_EM, UNITS_EX, UNITS_INCH, UNITS_MM, UNITS_PERCENTAGE, UNITS_PICAS, UNITS_PIXELS, UNITS_POINTS |
Constructor Summary | |
---|---|
AbstractComponentContainer()
Constructs a new component container. |
Method Summary | |
---|---|
void |
addComponent(Component c)
This only implements the events and component parent calls. |
void |
addListener(ComponentContainer.ComponentAttachListener listener)
Listens the component attach events. |
void |
addListener(ComponentContainer.ComponentDetachListener listener)
Listens the component detach events. |
void |
attach()
Notifies all contained components that the container is attached to a window. |
void |
detach()
Notifies all contained components that the container is detached from a window. |
protected void |
fireComponentAttachEvent(Component component)
Fires the component attached event. |
protected void |
fireComponentDetachEvent(Component component)
Fires the component detached event. |
void |
moveComponentsFrom(ComponentContainer source)
Moves all components from an another container into this container. |
void |
removeAllComponents()
Removes all components from the container. |
void |
removeComponent(Component c)
This only implements the events and component parent calls. |
void |
removeListener(ComponentContainer.ComponentAttachListener listener)
Stops the listening component attach events. |
void |
removeListener(ComponentContainer.ComponentDetachListener listener)
Stops the listening component detach events. |
void |
requestRepaintAll()
Causes a repaint of this component, and all components below it. |
void |
setEnabled(boolean enabled)
Enables or disables the component. |
void |
setHeight(float height,
int unit)
Sets the height of the object. |
void |
setWidth(float width,
int 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.ComponentContainer |
---|
getComponentIterator, replaceComponent |
Methods inherited from interface com.vaadin.ui.Component |
---|
addListener, addStyleName, childRequestedRepaint, getApplication, getCaption, getIcon, getLocale, getParent, getStyleName, getWindow, isEnabled, isReadOnly, isVisible, removeListener, removeStyleName, setCaption, setIcon, setParent, setReadOnly, setStyleName, setVisible |
Methods inherited from interface com.vaadin.terminal.Paintable |
---|
addListener, getDebugId, paint, removeListener, requestRepaint, requestRepaintRequests, setDebugId |
Methods inherited from interface com.vaadin.terminal.VariableOwner |
---|
changeVariables, isImmediate |
Methods inherited from interface com.vaadin.terminal.Sizeable |
---|
getHeight, getHeightUnits, getWidth, getWidthUnits, setHeight, setHeight, setHeightUnits, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthUnits |
Constructor Detail |
---|
public AbstractComponentContainer()
Method Detail |
---|
public void removeAllComponents()
removeAllComponents
in interface ComponentContainer
public void moveComponentsFrom(ComponentContainer source)
ComponentContainer
source
.
moveComponentsFrom
in interface ComponentContainer
source
- the container which contains the components that are to be
moved to this container.public void attach()
attach
in interface Component
attach
in class AbstractComponent
Component.attach()
public void detach()
detach
in interface Component
detach
in class AbstractComponent
Component.detach()
public void addListener(ComponentContainer.ComponentAttachListener listener)
ComponentContainer
addListener
in interface ComponentContainer
listener
- the listener to add.public void addListener(ComponentContainer.ComponentDetachListener listener)
ComponentContainer
addListener
in interface ComponentContainer
public void removeListener(ComponentContainer.ComponentAttachListener listener)
ComponentContainer
removeListener
in interface ComponentContainer
listener
- the listener to removed.public void removeListener(ComponentContainer.ComponentDetachListener listener)
ComponentContainer
removeListener
in interface ComponentContainer
protected void fireComponentAttachEvent(Component component)
component
- the component that has been added to this container.protected void fireComponentDetachEvent(Component component)
component
- the component that has been removed from this container.public void addComponent(Component c)
addComponent
in interface ComponentContainer
c
- the component to be added.ComponentContainer.addComponent(Component)
public void removeComponent(Component c)
removeComponent
in interface ComponentContainer
c
- the component to be removed.ComponentContainer.removeComponent(Component)
public void setEnabled(boolean enabled)
Component
Button enabled = new Button("Enabled"); enabled.setEnabled(true); // The default layout.addComponent(enabled); Button disabled = new Button("Disabled"); disabled.setEnabled(false); layout.addComponent(disabled);
This method will trigger a
RepaintRequestEvent
for the component and, if it is a
ComponentContainer
, for all its children recursively.
setEnabled
in interface Component
setEnabled
in class AbstractComponent
enabled
- a boolean value specifying if the component should be enabled
or notpublic void setWidth(float width, int unit)
Sizeable
setWidth
in interface Sizeable
setWidth
in class AbstractComponent
width
- the width of the object.unit
- the unit used for the width. Possible values include
Sizeable.UNITS_PIXELS
, Sizeable.UNITS_POINTS
,
Sizeable.UNITS_PICAS
, Sizeable.UNITS_EM
, Sizeable.UNITS_EX
,
Sizeable.UNITS_MM
, Sizeable.UNITS_CM
, Sizeable.UNITS_INCH
,
Sizeable.UNITS_PERCENTAGE
.public void setHeight(float height, int unit)
Sizeable
setHeight
in interface Sizeable
setHeight
in class AbstractComponent
height
- the height of the object.unit
- the unit used for the width. Possible values include
Sizeable.UNITS_PIXELS
, Sizeable.UNITS_POINTS
,
Sizeable.UNITS_PICAS
, Sizeable.UNITS_EM
, Sizeable.UNITS_EX
,
Sizeable.UNITS_MM
, Sizeable.UNITS_CM
, Sizeable.UNITS_INCH
,
Sizeable.UNITS_PERCENTAGE
.public void requestRepaintAll()
ComponentContainer
requestRepaintAll
in interface ComponentContainer
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |