|
||||||||||
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
com.vaadin.ui.AbstractLayout
com.vaadin.ui.AbstractOrderedLayout
public abstract class AbstractOrderedLayout
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.Layout |
---|
Layout.AlignmentHandler, Layout.MarginHandler, Layout.MarginInfo, Layout.SpacingHandler |
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 | |
---|---|
static Alignment |
ALIGNMENT_DEFAULT
|
protected LinkedList<Component> |
components
Custom layout slots containing the components. |
Fields inherited from class com.vaadin.ui.AbstractLayout |
---|
margins |
Fields inherited from interface com.vaadin.ui.Layout.AlignmentHandler |
---|
ALIGNMENT_BOTTOM, ALIGNMENT_HORIZONTAL_CENTER, ALIGNMENT_LEFT, ALIGNMENT_RIGHT, ALIGNMENT_TOP, ALIGNMENT_VERTICAL_CENTER |
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 | |
---|---|
AbstractOrderedLayout()
|
Method Summary | |
---|---|
void |
addComponent(Component c)
Add a component into this container. |
void |
addComponent(Component c,
int index)
Adds a component into indexed position in this container. |
void |
addComponentAsFirst(Component c)
Adds a component into this container. |
void |
addListener(LayoutEvents.LayoutClickListener listener)
Add a click listener to the layout. |
Component |
getComponent(int index)
Returns the component at the given position. |
Alignment |
getComponentAlignment(Component childComponent)
Returns the current Alignment of given component. |
int |
getComponentCount()
Gets the number of contained components. |
int |
getComponentIndex(Component component)
Returns the index of the given component. |
Iterator<Component> |
getComponentIterator()
Gets the component container iterator for going trough all the components in the container. |
float |
getExpandRatio(Component component)
Returns the expand ratio of given component. |
boolean |
isSpacing()
|
boolean |
isSpacingEnabled()
Deprecated. |
void |
paintContent(PaintTarget target)
Paints the content of this component. |
void |
removeComponent(Component c)
Removes the component from this container. |
void |
removeListener(LayoutEvents.LayoutClickListener listener)
Removes an LayoutClickListener. |
void |
replaceComponent(Component oldComponent,
Component newComponent)
Replaces the component in the container with another one without changing position. |
void |
setComponentAlignment(Component childComponent,
Alignment alignment)
Set alignment for one contained component in this layout. |
void |
setComponentAlignment(Component childComponent,
int horizontalAlignment,
int verticalAlignment)
Set alignment for one contained component in this layout. |
void |
setComponentAlignment(Component component,
String alignment)
Deprecated. Replaced by setComponentAlignment(Component, Alignment) |
void |
setExpandRatio(Component component,
float ratio)
This method is used to control how excess space in layout is distributed among components. |
void |
setSpacing(boolean enabled)
Enable spacing between child components within this layout. |
Methods inherited from class com.vaadin.ui.AbstractLayout |
---|
changeVariables, fireClick, getMargin, setMargin, setMargin, setMargin |
Methods inherited from class com.vaadin.ui.AbstractComponentContainer |
---|
addListener, addListener, attach, detach, fireComponentAttachEvent, fireComponentDetachEvent, moveComponentsFrom, removeAllComponents, removeListener, removeListener, requestRepaintAll, setEnabled, setHeight, setWidth |
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 |
---|
addListener, addListener, moveComponentsFrom, removeAllComponents, removeListener, removeListener, requestRepaintAll |
Methods inherited from interface com.vaadin.ui.Component |
---|
addListener, addStyleName, attach, childRequestedRepaint, detach, getApplication, getCaption, getIcon, getLocale, getParent, getStyleName, getWindow, isEnabled, isReadOnly, isVisible, removeListener, removeStyleName, setCaption, setEnabled, 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 |
---|
isImmediate |
Methods inherited from interface com.vaadin.terminal.Sizeable |
---|
getHeight, getHeightUnits, getWidth, getWidthUnits, setHeight, setHeight, setHeight, setHeightUnits, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidth, setWidthUnits |
Field Detail |
---|
public static final Alignment ALIGNMENT_DEFAULT
protected LinkedList<Component> components
Constructor Detail |
---|
public AbstractOrderedLayout()
Method Detail |
---|
public void addComponent(Component c)
addComponent
in interface ComponentContainer
addComponent
in class AbstractComponentContainer
c
- the component to be added.ComponentContainer.addComponent(Component)
public void addComponentAsFirst(Component c)
c
- the component to be added.public void addComponent(Component c, int index)
c
- the component to be added.index
- the index of the component position. The components currently
in and after the position are shifted forwards.public void removeComponent(Component c)
removeComponent
in interface ComponentContainer
removeComponent
in class AbstractComponentContainer
c
- the component to be removed.ComponentContainer.removeComponent(Component)
public Iterator<Component> getComponentIterator()
getComponentIterator
in interface ComponentContainer
public int getComponentCount()
getComponentIterator()
.
public void paintContent(PaintTarget target) throws PaintException
paintContent
in class AbstractLayout
target
- the Paint Event.
PaintException
- if the paint operation failed.public void replaceComponent(Component oldComponent, Component newComponent)
ComponentContainer
This method replaces component with another one is such way that the new component overtakes the position of the old component. If the old component is not in the container, the new component is added to the container. If the both component are already in the container, their positions are swapped. Component attach and detach events should be taken care as with add and remove.
replaceComponent
in interface ComponentContainer
oldComponent
- the old component that will be replaced.newComponent
- the new component to be replaced.public void setComponentAlignment(Component childComponent, int horizontalAlignment, int verticalAlignment)
Layout.AlignmentHandler
setComponentAlignment
in interface Layout.AlignmentHandler
childComponent
- the component to align within it's layout cell.horizontalAlignment
- the horizontal alignment for the child component (left,
center, right). Use ALIGNMENT constants.verticalAlignment
- the vertical alignment for the child component (top,
center, bottom). Use ALIGNMENT constants.public void setComponentAlignment(Component childComponent, Alignment alignment)
Layout.AlignmentHandler
layout.setComponentAlignment(myComponent, Alignment.TOP_RIGHT);
setComponentAlignment
in interface Layout.AlignmentHandler
childComponent
- the component to align within it's layout cell.alignment
- the Alignment value to be setpublic Alignment getComponentAlignment(Component childComponent)
Layout.AlignmentHandler
getComponentAlignment
in interface Layout.AlignmentHandler
Alignment
public void setSpacing(boolean enabled)
Layout.SpacingHandler
NOTE: This will only affect the space between
components, not the space around all the components in the layout
(i.e. do not confuse this with the cellspacing attribute of a HTML
Table). Use Layout.setMargin(boolean)
to add space around the
layout.
See the reference manual for more information about CSS rules for defining the amount of spacing to use.
setSpacing
in interface Layout.SpacingHandler
enabled
- true if spacing should be turned on, false if it should be
turned off@Deprecated public boolean isSpacingEnabled()
isSpacingEnabled
in interface Layout.SpacingHandler
public boolean isSpacing()
isSpacing
in interface Layout.SpacingHandler
public void setExpandRatio(Component component, float ratio)
This method is used to control how excess space in layout is distributed among components. Excess space may exist if layout is sized and contained non relatively sized components don't consume all available space.
Example how to distribute 1:3 (33%) for component1 and 2:3 (67%) for
component2 :
layout.setExpandRatio(component1, 1);
layout.setExpandRatio(component2, 2);
If no ratios have been set, the excess space is distributed evenly among all components.
Note, that width or height (depending on orientation) needs to be defined for this method to have any effect.
component
- the component in this layout which expand ratio is to be setratio
- Sizeable
public float getExpandRatio(Component component)
component
- which expand ratios is requested
@Deprecated public void setComponentAlignment(Component component, String alignment)
setComponentAlignment(Component, Alignment)
component
- A child component in this layoutalignment
- A short hand notation described in AlignmentUtils
public void addListener(LayoutEvents.LayoutClickListener listener)
LayoutEvents.LayoutClickNotifier
LayoutEvents.LayoutClickEvent
.
Use #removeListener(LayoutClickListener)
to remove the
listener.
addListener
in interface LayoutEvents.LayoutClickNotifier
listener
- The listener to addpublic void removeListener(LayoutEvents.LayoutClickListener listener)
LayoutEvents.LayoutClickNotifier
removeListener
in interface LayoutEvents.LayoutClickNotifier
listener
- LayoutClickListener to be removedpublic int getComponentIndex(Component component)
component
- The component to look up.
public Component getComponent(int index) throws IndexOutOfBoundsException
index
- The position of the component.
IndexOutOfBoundsException
- If the index is out of range.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |