|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JToolBar
com.quadrique.jbuildingblocks.gui.ToolBar
public class ToolBar
This class implements a generic tool bar.
A typical usage is to create a sub-class and to populate the toolbar from that sub-class as shown below:
...
public MainWindowToolBar(Actions zActions) throws Exception
{
super(false);
add(zActions.get(ActionFileNew.CLASS_NAME));
add(zActions.get(ActionFileOpen.CLASS_NAME));
add(zActions.get(ActionFileSave.CLASS_NAME));
addSeparator();
add(zActions.get(ActionFilePrint.CLASS_NAME));
addSeparator();
add(zActions.get(ActionEditCut.CLASS_NAME));
add(zActions.get(ActionEditCopy.CLASS_NAME));
add(zActions.get(ActionEditPaste.CLASS_NAME));
addSeparator();
add(zActions.get(ActionViewDomainPanel.CLASS_NAME));
add(zActions.get(ActionViewDesktopPanel.CLASS_NAME));
add(zActions.get(ActionViewRefresh.CLASS_NAME));
addSeparator();
add(zActions.get(ActionHelpContents.CLASS_NAME));
add(zActions.get(ActionHelpWhatIsThis.CLASS_NAME));
}
...
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JToolBar |
|---|
JToolBar.Separator |
| Nested classes/interfaces inherited from class javax.swing.JComponent |
|---|
JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
Component.BaselineResizeBehavior |
| Field Summary |
|---|
| Fields inherited from class javax.swing.JComponent |
|---|
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
| Fields inherited from class java.awt.Component |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface javax.swing.SwingConstants |
|---|
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
ToolBar(boolean zIsFloatable)
Constructor |
|
ToolBar(boolean zIsFloatable,
int zOrientation)
Constructor |
|
| Method Summary | |
|---|---|
JButton |
add(Action zAction)
Add an action to the toolbar. |
JButton |
add(ActionBase zAction)
Add an action to the toolbar. |
void |
add(ActionBase[] zActions)
Add the actions associated to the toolbar |
void |
addHelpContentsItem(String zItemToolTipText,
String zItemIconFileName)
To add a HelpContents button i.e. |
void |
addHelpWhatIsThisItem(String zItemToolTipText,
String zItemIconFileName)
To add a "Help What's This" button i.e. |
void |
addSeparator(boolean zUseIcon)
Add a separator to the toolbar |
| Methods inherited from class javax.swing.JToolBar |
|---|
addSeparator, addSeparator, getAccessibleContext, getComponentAtIndex, getComponentIndex, getMargin, getOrientation, getUI, getUIClassID, isBorderPainted, isFloatable, isRollover, setBorderPainted, setFloatable, setLayout, setMargin, setOrientation, setRollover, setUI, updateUI |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ToolBar(boolean zIsFloatable)
zIsFloatable - true if the toolbar is floatable
public ToolBar(boolean zIsFloatable,
int zOrientation)
zIsFloatable - true if the toolbar is floatablezOrientation - JToolBar.HORIZONTAL or JToolBar.VERTICAL| Method Detail |
|---|
public JButton add(ActionBase zAction)
zAction - the action
ActionBasepublic JButton add(Action zAction)
add in class JToolBarzAction - the action
Exception - if an error occurspublic void addSeparator(boolean zUseIcon)
public void addHelpContentsItem(String zItemToolTipText,
String zItemIconFileName)
throws Exception
zItemToolTipText - the tooltip textzItemIconFileName - the icon file name
Exception - if an error occurs
public void addHelpWhatIsThisItem(String zItemToolTipText,
String zItemIconFileName)
throws Exception
zItemToolTipText - the tooltip textzItemIconFileName - the icon file name
Exception - if an error occurs
public void add(ActionBase[] zActions)
throws Exception
zActions - an array that contains the toolbar actions. In order
to add a separator, simply use a "null" entry in the array.
For instance, the following sample classLoader sets up an array for a toolbar
with 4 actions and a separator between the save and print action:
Exception - if an error occurs
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||