Package ej.widget.container
Class List
- java.lang.Object
-
- ej.mwt.Widget
-
- ej.mwt.Container
-
- ej.widget.container.List
-
public class List extends ej.mwt.Container
Lays out any number of children horizontally or vertically.All the children are laid out on the same horizontal or vertical line.
In a horizontal list, all children will have the height of the available space, and their width will be determined proportionally. In a vertical list, all children will have the width of the available space, and their height will be determined proportionally.
Horizontal:
Vertical:
-
-
Constructor Summary
Constructors Constructor Description List(boolean orientation)
Creates a list specifying its orientation.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addChild(ej.mwt.Widget child)
protected void
computeContentOptimalSize(ej.mwt.util.Size size)
boolean
getOrientation()
Gets the orientation of this list.void
insertChild(ej.mwt.Widget child, int index)
protected void
layOutChildren(int contentWidth, int contentHeight)
void
removeAllChildren()
void
removeChild(ej.mwt.Widget child)
void
replaceChild(int index, ej.mwt.Widget child)
void
setOrientation(boolean orientation)
Sets the orientation of this list.-
Methods inherited from class ej.mwt.Container
changeChildIndex, computeChildOptimalSize, getChild, getChildIndex, getChildren, getChildrenCount, getContentBounds, getContentHeight, getContentWidth, getContentX, getContentY, getWidgetAt, layOutAlignedChild, layOutChild, renderChild, renderContent, setHiddenChild, setHiddenChildren, setShownChild, setShownChildren, updateStyle
-
Methods inherited from class ej.mwt.Widget
addClassSelector, contains, containsWidget, getAbsoluteX, getAbsoluteY, getDesktop, getHeight, getParent, getStyle, getWidth, getX, getY, handleEvent, hasClassSelector, isAttached, isEnabled, isInState, isShown, isTransparent, onAttached, onDetached, onHidden, onLaidOut, onShown, removeAllClassSelectors, removeClassSelector, render, requestLayOut, requestRender, requestRender, setClassSelectors, setEnabled, setPosition, setStyle
-
-
-
-
Constructor Detail
-
List
public List(boolean orientation)
Creates a list specifying its orientation.- Parameters:
orientation
- the orientation of the list (seeLayoutOrientation
).
-
-
Method Detail
-
setOrientation
public void setOrientation(boolean orientation)
Sets the orientation of this list.- Parameters:
orientation
- the orientation to set (seeLayoutOrientation
).
-
getOrientation
public boolean getOrientation()
Gets the orientation of this list.- Returns:
- the orientation of this list (see
LayoutOrientation
).
-
addChild
public void addChild(ej.mwt.Widget child)
- Overrides:
addChild
in classej.mwt.Container
-
removeChild
public void removeChild(ej.mwt.Widget child)
- Overrides:
removeChild
in classej.mwt.Container
-
insertChild
public void insertChild(ej.mwt.Widget child, int index)
- Overrides:
insertChild
in classej.mwt.Container
-
replaceChild
public void replaceChild(int index, ej.mwt.Widget child)
- Overrides:
replaceChild
in classej.mwt.Container
-
removeAllChildren
public void removeAllChildren()
- Overrides:
removeAllChildren
in classej.mwt.Container
-
computeContentOptimalSize
protected void computeContentOptimalSize(ej.mwt.util.Size size)
- Specified by:
computeContentOptimalSize
in classej.mwt.Widget
-
layOutChildren
protected void layOutChildren(int contentWidth, int contentHeight)
- Specified by:
layOutChildren
in classej.mwt.Container
-
-