public class List extends StyledComposite implements Scrollable
All lines (or columns if vertical) can have a different height (or width).
Horizontal:
Vertical:
EMPTY_ELEMENT_ARRAY
Constructor and Description |
---|
List()
Creates a horizontal list composite.
|
List(boolean horizontal)
Creates a list composite specifying its orientation.
|
Modifier and Type | Method and Description |
---|---|
void |
add(ej.mwt.Widget widget) |
ej.mwt.Widget |
getWidget(int index) |
ej.mwt.Widget[] |
getWidgets() |
int |
getWidgetsCount() |
java.util.Iterator<ej.mwt.Widget> |
iterator() |
void |
remove(ej.mwt.Widget widget) |
void |
removeAllWidgets() |
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.
|
void |
updateViewport(int x,
int y,
int width,
int height)
Called when the scroll composite updates its viewport.
|
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, getWidgetAt, handleEvent, hideNotify, 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
public List()
public List(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(ej.mwt.Widget widget) throws java.lang.NullPointerException, java.lang.IllegalArgumentException
StyledComposite
If the given widget is not an Element
, an IllegalArgumentException
is thrown.
add
in class StyledComposite
java.lang.IllegalArgumentException
- if the given widget is not an element.java.lang.NullPointerException
Element
,
StyledWidget
,
StyledComposite
public void remove(ej.mwt.Widget widget)
remove
in class ej.mwt.Composite
public void removeAllWidgets()
removeAllWidgets
in class ej.mwt.Composite
public ej.mwt.Widget getWidget(int index) throws java.lang.IndexOutOfBoundsException
getWidget
in class ej.mwt.Composite
java.lang.IndexOutOfBoundsException
public ej.mwt.Widget[] getWidgets()
getWidgets
in class ej.mwt.Composite
public int getWidgetsCount()
getWidgetsCount
in class ej.mwt.Composite
public java.util.Iterator<ej.mwt.Widget> iterator()
iterator
in class ej.mwt.Composite
public Rectangle validateContent(Style style, Rectangle bounds)
StyledComposite
Lays out the children of this composite.
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.public void updateViewport(int x, int y, int width, int height)
Scrollable
updateViewport
in interface Scrollable
x
- the new x coordinate of the viewport.y
- the new y coordinate of the viewport.width
- the new width of the viewport.height
- the new height of the viewport.