public class BToolBar extends WidgetContainer
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.Modifier and Type | Class and Description |
---|---|
static class |
BToolBar.Orientation
This inner class represents an orientation for the toolbar.
|
Modifier and Type | Field and Description |
---|---|
static BToolBar.Orientation |
HORIZONTAL |
static BToolBar.Orientation |
VERTICAL |
Constructor and Description |
---|
BToolBar()
Create a new BToolBar whose orientation is set to HORIZONTAL.
|
BToolBar(BToolBar.Orientation orientation)
Create a new BToolBar.
|
Modifier and Type | Method and Description |
---|---|
void |
add(Widget widget)
Add a Widget (usually a BButton) to the end of the toolbar.
|
void |
add(Widget widget,
int index)
Add a Widget (usually a BButton) to the toolbar.
|
void |
addSeparator()
Add a dividing line (a BSeparator) to the end of the toolbar.
|
Widget |
getChild(int i)
Get the i'th child of this container.
|
int |
getChildCount()
Get the number of children in this container.
|
int |
getChildIndex(Widget widget)
Get the index of a particular Widget.
|
java.util.Collection<Widget> |
getChildren()
Get a Collection containing all child Widgets of this container.
|
javax.swing.JToolBar |
getComponent()
Get the java.awt.Component corresponding to this Widget.
|
BToolBar.Orientation |
getOrientation()
Get the orientation of this toolbar.
|
void |
layoutChildren()
Layout the child Widgets.
|
void |
remove(Widget widget)
Remove a child Widget from this container.
|
void |
removeAll()
Remove all child Widgets from this container.
|
void |
setOrientation(BToolBar.Orientation orientation)
Set the orientation of this toolbar.
|
isOpaque, setOpaque
addEventLink, dispatchEvent, getBackground, getBounds, getCursor, getFont, getMaximumSize, getMinimumSize, getName, getParent, getPreferredSize, hasFocus, isEnabled, isFocusable, isVisible, repaint, requestFocus, setBackground, setCursor, setEnabled, setFocusable, setFont, setName, setVisible
addEventLink, addEventLink, removeEventLink
public static final BToolBar.Orientation HORIZONTAL
public static final BToolBar.Orientation VERTICAL
public BToolBar()
public BToolBar(BToolBar.Orientation orientation)
orientation
- the orientation of the toolbarpublic javax.swing.JToolBar getComponent()
Widget
getComponent
in class Widget
public BToolBar.Orientation getOrientation()
public void setOrientation(BToolBar.Orientation orientation)
public void add(Widget widget)
widget
- the Widget to addpublic void add(Widget widget, int index)
widget
- the Widget to addindex
- the position at which to add itpublic void addSeparator()
public int getChildCount()
getChildCount
in class WidgetContainer
public Widget getChild(int i)
public java.util.Collection<Widget> getChildren()
getChildren
in class WidgetContainer
public void remove(Widget widget)
remove
in class WidgetContainer
public void removeAll()
removeAll
in class WidgetContainer
public int getChildIndex(Widget widget)
widget
- the Widget to locatepublic void layoutChildren()
layoutChildren
in class WidgetContainer
Written by Peter Eastman.