buoy.widget
Class BToolBar
A BToolBar is a WidgetContainer which displays a series of Widgets in a row or column. It is
similar to a
RowContainer
or
ColumnContainer
, but has a different appearance.
Most often, the child Widgets are
BButtons
with icons, and they act as shortcuts for performing
common operations.
addEventLink , dispatchEvent , getBackground , getBounds , getComponent , getCursor , getFont , getMaximumSize , getMinimumSize , getName , getParent , getPreferredSize , hasFocus , isEnabled , isFocusable , isVisible , repaint , requestFocus , setBackground , setCursor , setEnabled , setFocusable , setFont , setName , setVisible |
BToolBar
public BToolBar()
Create a new BToolBar whose orientation is set to HORIZONTAL.
BToolBar
public BToolBar(BToolBar.Orientation orientation)
Create a new BToolBar.
orientation
- the orientation of the toolbar
add
public void add(Widget widget)
Add a Widget (usually a BButton) to the end of the toolbar.
widget
- the Widget to add
add
public void add(Widget widget,
int index)
Add a Widget (usually a BButton) to the toolbar.
widget
- the Widget to addindex
- the position at which to add it
addSeparator
public void addSeparator()
Add a dividing line (a BSeparator) to the end of the toolbar.
getChild
public Widget getChild(int i)
Get the i'th child of this container.
getChildIndex
public int getChildIndex(Widget widget)
Get the index of a particular Widget.
widget
- the Widget to locate
- the position of the Widget within this container, or -1 if the Widget is not a child
of this container
getChildren
public Collection getChildren()
Get a Collection containing all child Widgets of this container.
- getChildren in interface WidgetContainer
getComponent
public JToolBar getComponent()
Get the java.awt.Component corresponding to this Widget.
- getComponent in interface Widget
layoutChildren
public void layoutChildren()
Layout the child Widgets. This may be invoked whenever something has changed (the size of this
WidgetContainer, the preferred size of one of its children, etc.) that causes the layout to no
longer be correct. If a child is itself a WidgetContainer, its layoutChildren() method will be
called in turn.
- layoutChildren in interface WidgetContainer
setOrientation
public void setOrientation(BToolBar.Orientation orientation)
Set the orientation of this toolbar.
Written by Peter Eastman.