public class Flow extends StyledComposite
Horizontal:
Vertical:
Modifier and Type | Field and Description |
---|---|
protected boolean |
horizontal
Lay out direction.
|
EMPTY_ELEMENT_ARRAY
Constructor and Description |
---|
Flow()
Creates a horizontal flow composite.
|
Flow(boolean horizontal)
Creates a flow composite specifying its orientation.
|
Modifier and Type | Method and Description |
---|---|
void |
add(Widget widget)
Adds the specified widget to the end of the list of children of this composite.
|
void |
remove(Widget widget)
Removes the specified widget from the list of children of this composite.
|
void |
removeAllWidgets()
Removes all the widgets from the list of children of this composite.
|
protected void |
setBoundsContent(Rectangle bounds)
Sets the bounds of this widget by taking into account the border, margin and padding specified in the style.
|
void |
setHorizontal(boolean horizontal)
Sets the composite orientation: horizontal or vertical.
|
Rectangle |
validateContent(Style style,
Rectangle bounds)
Gets the content size of the renderable without the border, margin and padding specified in the style.
|
addClassSelector, contains, gainFocus, getAttribute, getChild, getChildrenCount, getChildrenElements, getParentElement, getStyle, hasClassSelector, isInState, isTransparent, lostFocus, mergeStyle, removeAllClassSelectors, removeClassSelector, removeInstanceStyle, render, renderContent, setBounds, setClassSelectors, setEnabled, updateStyle, updateStyleOnly, validate
getFocus, getFocusIndex, getNext, getWidget, getWidgetAt, getWidgets, getWidgetsCount, handleEvent, hideNotify, iterator, requestFocus, requestFocus, requestFocusFrom, showNotify
getAbsoluteX, getAbsoluteX, getAbsoluteY, getAbsoluteY, getEventHandler, getHeight, getPanel, getParent, getPreferredHeight, getPreferredWidth, getRelativeX, getRelativeY, getWidth, getX, getY, hasFocus, invalidate, isEnabled, isShown, isValid, isVisible, repaint, repaint, revalidate, revalidateSubTree, setEventHandler, setLocation, setPreferredSize, setSize, setVisible
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getEventHandler, getHeight, getWidth, getX, getY, handleEvent, hideNotify, isShown, repaint, repaint, setEventHandler, showNotify
public Flow()
public Flow(boolean horizontal)
horizontal
- true
to set the composite horizontal, false
to set the composite vertical.public void setHorizontal(boolean horizontal)
horizontal
- true
to set the composite horizontal, false
to set the composite vertical.public void add(Widget widget) throws java.lang.NullPointerException, java.lang.IllegalArgumentException
StyledComposite
If the composite is on a panel hierarchy, it is invalidated.
If the given widget is not an Element
, an IllegalArgumentException
is thrown.
add
in class StyledComposite
widget
- the widget to add.java.lang.NullPointerException
- if the specified widget is null
.java.lang.IllegalArgumentException
- if the given widget is not an element.Element
,
StyledWidget
,
StyledComposite
public void remove(Widget widget) throws java.lang.NullPointerException
Composite
If the composite is on a panel hierarchy, it is invalidated.
If the widget is not in the list of children of the composite, nothing is done.
remove
in class Composite
widget
- the widget to removejava.lang.NullPointerException
- if the specified widget is nullWidget.invalidate()
public void removeAllWidgets()
Composite
If the composite is on a panel hierarchy, it is invalidated.
removeAllWidgets
in class Composite
Widget.invalidate()
public Rectangle validateContent(Style style, Rectangle bounds)
Lays out the children of this composite.
Lays out children in rows if horizontal, or in columns if vertical.
If the width (resp. height) of the row (resp. column) is too small for all the components, it creates several lines (resp. columns). The size of each child is set to the child's preferred size.
validateContent
in interface StyledRenderable
validateContent
in class StyledComposite
style
- the style to use.bounds
- the bounds available for the content. A width or a height equals to MWT.NONE
means no
constraint on this dimension.protected void setBoundsContent(Rectangle bounds)
StyledComposite
setBoundsContent
in class StyledComposite
bounds
- the bounds available for the content.