|
Sydney | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object | +--Widget | +--Container
Defined in container.js
Field Summary | |
WidgetList |
children
A list containing this container's children. |
Fields inherited from class Widget |
html, id, parent, layoutData, eventTable
|
Constructor Summary | |
Container
(<boolean> scrolling, <string> tagName, <LayoutManager> layout)
Creates a widget container. |
Method Summary | |
void
|
appendChild(<Widget> widget, <boolean> layout)
Inserts widget into the container after all other children.
|
void
|
clear()
Removes every element from this container. |
boolean
|
contains(<Widget> widget)
Returns true if this container (or one of its descendants)
contains widget , and false otherwise.
|
void
|
insertAfter(<Widget> newWidget, <Widget> oldWidget, <boolean> layout)
Inserts newWidget into the container after
oldWidget .
|
void
|
insertAt(<Widget> widget, <int> index, <boolean> layout)
Inserts widget at the index 'th position in
this container.
|
void
|
insertBefore(<Widget> newWidget, <Widget> oldWidget, <boolean> layout)
Inserts newWidget into the container before
oldWidget .
|
boolean
|
isEmpty()
Returns true if the container is empty and
false otherwise.
|
void
|
prependChild(<Widget> widget, <boolean> layout)
Inserts widget into the container before all other
children.
|
void
|
removeChild(<Widget> widget, <boolean> layout)
Removes widget from the container.
|
void
|
replaceChild(<Widget> newWidget, <Widget> oldWidget, <boolean> layout)
Replaces oldWidget with newWidget .
|
void
|
setEnabled(<boolean> isEnabled)
Set the enabled state of this widget. |
void
|
setLayout(<LayoutManager> layout)
Sets the layout manager for this container. |
Field Detail |
WidgetList children
Constructor Detail |
function Container(<boolean> scrolling, <string> tagName, <LayoutManager> layout)
GridLayout
and
FlowLayout
, but others may be added.
scrolling
- (Optional) - a boolean to indicate whether or not the container should grow scrollbars or clip its content when the content is too big. Defaults to false
, which implies clipping.
tagName
- (Optional) - a string
to use as the tag-name for the container's HTML node. Defaults to 'div'
.
layout
- (Optional) - a layout manager to use. Defaults to a do-nothing layout manager that leaves all widgets in an implementation-defined location.
Method Detail |
void appendChild(<Widget> widget, <boolean> layout)
widget
into the container after all other children.
Does nothing if widget
is null
. If
layout
is true
, then
this.layout()
is called after widget
has been
inserted.
widget
- the widget to be inserted
layout
- (Optional) - a boolean indicating whether or not to call this.layout()
after the insertion. Defaults to false
.
void clear()
boolean contains(<Widget> widget)
true
if this container (or one of its descendants)
contains widget
, and false
otherwise.
widget
- the widget to check
widget
is in this container or one of its descendants
void insertAfter(<Widget> newWidget, <Widget> oldWidget, <boolean> layout)
newWidget
into the container after
oldWidget
. If oldWidget
is null
then newWidget
is prepended to the container. If
layout
is true
, then
this.layout()
is called after newWidget
has
been inserted.
Note: insertAfter
is implemented in
terms of insertBefore
and prependChild
.
Subclassers may want to avoid calling this implementation of
insertAfter
if it would be incorrect to call both the new
implementation of insertAfter
and the new
implementation of either insertBefore
or
prependChild
.
newWidget
- a widget to be inserted
oldWidget
- either null
or a widget in this container
layout
- (Optional) - a boolean indicating whether or not to call this.layout()
after the insertion. Defaults to false
.
void insertAt(<Widget> widget, <int> index, <boolean> layout)
widget
at the index
'th position in
this container. Moves existing widgets down in the list.
widget
- the widget to insert
index
- the index at which to insert widget
layout
- (Optional) - a boolean indicating whether or not to call this.layout()
after the insertion. Defaults to false
.
void insertBefore(<Widget> newWidget, <Widget> oldWidget, <boolean> layout)
newWidget
into the container before
oldWidget
. If oldWidget
is null
then newWidget
is appended to the container. If
layout
is true
, then
this.layout()
is called after newWidget
has
been inserted.
newWidget
- a widget to be inserted
oldWidget
- either null
or a widget in this container
layout
- (Optional) - a boolean indicating whether or not to call this.layout()
after the insertion. Defaults to false
.
boolean isEmpty()
true
if the container is empty and
false
otherwise.
void prependChild(<Widget> widget, <boolean> layout)
widget
into the container before all other
children. Does nothing if widget
is null
. If
layout
is true
, then
this.layout()
is called after widget
has been
inserted.
widget
- the widget to be inserted
layout
- (Optional) - a boolean indicating whether or not to call this.layout()
after the insertion. Defaults to false
.
void removeChild(<Widget> widget, <boolean> layout)
widget
from the container. Does nothing if
widget
is null
. If layout
is
true
, then this.layout()
is called after
widget
has been removed.
widget
- the widget to be removed
layout
- (Optional) - a boolean indicating whether or not to call this.layout()
after the removal. Defaults to false
.
void replaceChild(<Widget> newWidget, <Widget> oldWidget, <boolean> layout)
oldWidget
with newWidget
. Does
nothing if either newWidget
or oldWidget
is
null
. If layout
is true
, then
this.layout()
is called after the replacement has been
made.
newWidget
- the widget to be inserted
oldWidget
- the widget to be removed
layout
- (Optional) - a boolean indicating whether or not to call this.layout()
after the replacement. Defaults to false
.
void setEnabled(<boolean> isEnabled)
isEnabled
- a boolean
indicating whether or not to enable the widget. true
enables the widget and false
disables it.
void setLayout(<LayoutManager> layout)
layout
- a layout manager (for example, FlowLayout
or GridLayout
)
|
Sydney | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |