public interface Container<O extends OutputManager<?>> extends Widget<O>
Widget.ZOrderClass
Modifier and Type | Method and Description |
---|---|
Container<O> |
add(int pos,
Widget<O> widget)
Add the widget on the specified position.
|
Container<O> |
add(Widget<O> widget)
Add widget to container.
|
Container<O> |
add(Widget<O> before,
Widget<O> widget)
Add the new widget before the given widget's position.
|
Point |
childrenLocation(Widget<O> child)
Get children location for one child.
|
boolean |
clipping()
This method should be overridden in a container that allows clipping.
|
Widget<O> |
currentFocus()
Get widget which is in focus.
|
Widget<O> |
currentFocus(boolean recurse)
Get widget which is in focus.
|
Widget<O> |
defaultFocus()
Get default focusable widget.
|
void |
detach(Widget<O> widget)
Detach this widget from this container.
|
void |
doLayout()
Lay out container.
|
void |
endSizeChange(boolean repaint)
Indicates the ending of the resize process.
|
void |
firstFocus()
Set focus to first focusable widget.
|
Widget<O> |
focus()
Returns the focused direct child Component.
|
Widget<O> |
get(int index)
Get widget for provided index or
null if no such component
exists. |
Rectangle |
getClipRect()
Get clipping rectangle.
|
java.util.Set<Widget<?>> |
getIgnoreFocus()
Returns the set of widgets that are never selected for focus.
|
LayoutManager<O> |
getLayout()
Get active layout manager for the container.
|
boolean |
hasFocusable(Widget<O> exclude)
Reports if there is at least 1 focusable widget that is not the given
widget.
|
Insets |
insets()
Get container insets.
|
void |
lastFocus()
Set focus to last focusable widget.
|
void |
moveAfterTabItem(Widget<O> widget,
Widget<O> after)
Mode specified after before the widget "after".
|
void |
moveBeforeTabItem(Widget<O> widget,
Widget<O> before)
Mode specified widget before the widget "before".
|
void |
moveToBottom(Widget<O> widget)
Mode specified widget to the bottom of the widget list.
|
boolean |
moveToBottomInClass(Widget<O> widget)
Mode specified widget to the bottom of the widget list considering Z-order class.
|
void |
moveToTop(Widget<O> widget)
Move specified widget to the top of the widget list.
|
boolean |
moveToTopInClass(Widget<O> widget)
Move specified widget to the top of the widget list considering Z-order class.
|
void |
moveToZpos(Widget<O> widget,
int pos)
Move widget to specified position in the widget list.
|
void |
nextFocus()
Select next focusable widget.
|
void |
prevFocus()
Select previous focusable widget.
|
void |
remove(Widget<O> widget)
Remove specified widget from the widget list.
|
void |
replace(Widget<O> oldWidget,
Widget<O> newWidget)
Replace specified widget with another with preserving widget Z-order.
|
void |
setFocus(Widget<O> focus)
Set focus to specified widget.
|
void |
setHeight(double height)
Set container height.
|
void |
setIgnoreFocus(java.util.Collection<Widget<?>> widgets)
Sets the set of widgets that are never selected for focus.
|
void |
setInsets(Insets insets)
Set container insets.
|
void |
setLayout(LayoutManager<O> manager)
Set layout manager for the container.
|
void |
setSize(Dimension size)
Set container size.
|
void |
setSize(double width,
double height)
Set container size.
|
void |
setWidth(double width)
Set container width.
|
void |
startSizeChange(boolean saveOldRect)
Indicates the beginning of the resize process.
|
Widget<O>[] |
widgets()
Get all widgets stored in the container.
|
addFocusListener, addKeyListener, ancestor, ancestorId, bounds, clearWidget, config, defaultMousePtr, destroy, dimension, displayPhysicalLocation, draw, drawCaret, enclosingFrame, enforceDefaultMousePtr, findMouseSource, focusTraversable, forceCursorOnFocus, forceVisibility, getActualBounds, getCustomMousePointer, getEffectiveMousePointer, getId, getLegacyWidget, getLoadedMousePointer, getMenuMouse, getMouseActions, getSelectedText, getState, getVisiblePart, getZOrderClass, hasFocus, height, hidden, hide, highlighted, isDirectManipulable, isDisplayed, isEnabled, isFocusable, isHeader, isRealized, isRMBEntrySupported, isTabStop, isThreeD, isTotallyObscured, isVisible, location, minimumSize, moveToBottom, moveToTop, name, navigable, parent, parent, parentOrSelf, physicalBounds, physicalDimension, physicalLocation, postprocessConfig, processDirectManipulationEvent, processEvent, processFocusEvent, processKeyEvent, processKeyListeners, processMnemonic, raiseLegacyMouseEvents, repaint, repaint, requestFocus, requestSync, resizeTo, screen, screenLocation, screenPhysicalLocation, setEnabled, setHidden, setHighlighted, setLocation, setLocation, setMousePointer, setParent, setPhysicalLocation, setState, setVisible, show, supportsCustomMousePointer, topLevelWindow, unrealize, width, window
Container<O> add(Widget<O> widget)
widget
- Widget to add.this
for fluent syntax support.Container<O> add(Widget<O> before, Widget<O> widget)
before
- The widget to insert before.widget
- The child widget to add.this
for fluent syntax support.java.lang.IllegalArgumentException
- when the argument is null or instance of TopLevelWindow
Container<O> add(int pos, Widget<O> widget)
pos
- The widget's position.widget
- The child widget to add.this
for fluent syntax support.java.lang.IllegalArgumentException
- when the argument is null or instance of TopLevelWindow
boolean clipping()
true
if container clips its children.Widget<O> currentFocus(boolean recurse)
The method allows to choose whether the focused widget is searched in the nested
containers (recurse == true
) or whether only this container is searched
(recurse == false
).
recurse
- The parameter controls whether the method should recurse to the nested
containers when searching for the focused widget.Widget<O> defaultFocus()
void doLayout()
void endSizeChange(boolean repaint)
startSizeChange
and endSizeChange
calls is
suppressed.repaint
- If true
then the current bounding rectangle and
the rectangle saved during startSizeChange
call
are repainted.Widget<O> focus()
Widget<O> get(int index)
null
if no such component
exists.index
- Widget index.null
if index is out
of range.Rectangle getClipRect()
boolean hasFocusable(Widget<O> exclude)
exclude
- A widget to ignore or null
if any focusable
widget will do.true
if there is at least one other widget that
can be focused.Insets insets()
insets
in interface Widget<O extends OutputManager<?>>
void moveBeforeTabItem(Widget<O> widget, Widget<O> before)
widget
- Widget to move.before
- The widget before to insert mover.void moveAfterTabItem(Widget<O> widget, Widget<O> after)
widget
- Widget to move.after
- The widget before to insert mover.void moveToBottom(Widget<O> widget)
widget
- Widget to mover.void moveToTop(Widget<O> widget)
widget
- Widget to mover.boolean moveToBottomInClass(Widget<O> widget)
widget
- Widget to mover.true
if the widget was movedboolean moveToTopInClass(Widget<O> widget)
widget
- Widget to mover.true
if the widget was movedvoid moveToZpos(Widget<O> widget, int pos)
widget
- Widget to mover.pos
- Position in Z-order.void nextFocus()
void prevFocus()
void remove(Widget<O> widget)
widget
- Widget to remove.void replace(Widget<O> oldWidget, Widget<O> newWidget)
oldWidget
- Old widget.newWidget
- New widget.void setFocus(Widget<O> focus)
focus
- Widget to set focus on.void setHeight(double height)
height
- New container height.void setInsets(Insets insets)
insets
- Insets to set.void setLayout(LayoutManager<O> manager)
manager
- New layout manager.LayoutManager<O> getLayout()
void setSize(Dimension size)
size
- Size to set.void setSize(double width, double height)
width
- New width.height
- New height.void setWidth(double width)
width
- Width to set.void startSizeChange(boolean saveOldRect)
startSizeChange
and endSizeChange
calls is
suppressed.saveOldRect
- If true
then the current bounding rectangle is
saved for future repainting.Widget<O>[] widgets()
void firstFocus()
void lastFocus()
void detach(Widget<O> widget)
widget
- Widget to detach.java.util.Set<Widget<?>> getIgnoreFocus()
null
.void setIgnoreFocus(java.util.Collection<Widget<?>> widgets)
null
may be used to clear the set.widgets
- Set of widgets or null
.