|
|||||||||
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
jsky.util.gui.GenericToolBar
public class GenericToolBar
Implements a generic toolbar that can be used for a number of file/URL browser type applications. The class using this toolbar must implement the GenericToolBarTarget interface.
Nested Class Summary | |
---|---|
protected class |
GenericToolBar.ButtonPropertyChangeListener
Local class to enable or disable toolbar buttons when the related actions are enabled or disabled. |
Nested classes/interfaces inherited from class javax.swing.JToolBar |
---|
JToolBar.AccessibleJToolBar, JToolBar.Separator |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary | |
---|---|
protected JButton |
backButton
Handle for the "Back" button |
protected JButton |
forwardButton
Handle for the "Forward" button |
protected JButton |
openButton
Handle for the "Open" button |
protected boolean |
showPictures
If true, display button icons |
protected boolean |
showText
If true, display button labels |
protected GenericToolBarTarget |
target
Target panel |
Fields inherited from class javax.swing.JComponent |
---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, 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 | |
---|---|
GenericToolBar()
Create the toolbar with no target (derived class must add all items) |
|
GenericToolBar(GenericToolBarTarget target)
Create the toolbar for the given Generic target |
|
GenericToolBar(GenericToolBarTarget target,
boolean addItems)
Create the toolbar for the given Generic target. |
|
GenericToolBar(GenericToolBarTarget target,
boolean addItems,
int orientation)
Create the toolbar for the given Generic target. |
Method Summary | |
---|---|
protected void |
addToolBarItems()
Add the items to the tool bar |
JButton |
getBackButton()
|
JButton |
getForwardButton()
|
JButton |
getOpenButton()
|
protected JButton |
makeBackButton()
Make the Back button, if it does not yet exists. |
protected JButton |
makeButton(String toolTip,
Action action,
boolean isMenuButton)
Make and return a toolbar button. |
protected JButton |
makeForwardButton()
Make the Forward button, if it does not yet exists. |
protected JButton |
makeMenuButton(String toolTip,
JPopupMenu menu)
Make and return a menu button with the given tool tip and menu. |
protected JButton |
makeOpenButton()
Make the Open button, if it does not yet exists. |
protected JToggleButton |
makeToggleButton(String toolTip,
Action action)
Make and return a toolbar toggle button. |
void |
setShowPictures(boolean b)
Set to true to show toolbar buttons with icons |
void |
setShowText(boolean b)
Set to true to show toolbar buttons with labels |
protected AbstractButton |
setupButton(AbstractButton button)
Set the common attributes for toolbar buttons |
void |
update()
Update the toolbar display using the current text/pictures options. |
protected void |
updateButton(AbstractButton button,
String text,
Icon icon)
Update the given button to display text, and/or icons, depending on the current settigs. |
Methods inherited from class javax.swing.JToolBar |
---|
add, addImpl, addSeparator, addSeparator, createActionChangeListener, createActionComponent, getAccessibleContext, getComponentAtIndex, getComponentIndex, getMargin, getOrientation, getUI, getUIClassID, isBorderPainted, isFloatable, isRollover, paintBorder, paramString, setBorderPainted, setFloatable, setLayout, setMargin, setOrientation, setRollover, setUI, updateUI |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected GenericToolBarTarget target
protected JButton openButton
protected JButton backButton
protected JButton forwardButton
protected boolean showPictures
protected boolean showText
Constructor Detail |
---|
public GenericToolBar(GenericToolBarTarget target, boolean addItems, int orientation)
target
- the target object owning the toolbaraddItems
- if true, add the toolbar items, otherwise they should
be added by calling addToolBarItems() in a derived class.orientation
- the orientation desiredpublic GenericToolBar(GenericToolBarTarget target, boolean addItems)
target
- the target object owning the toolbaraddItems
- if true, add the toolbar items, otherwise they should
be added by calling addToolBarItems() in a derived class.public GenericToolBar(GenericToolBarTarget target)
public GenericToolBar()
Method Detail |
---|
protected void addToolBarItems()
protected AbstractButton setupButton(AbstractButton button)
protected JButton makeOpenButton()
protected JButton makeBackButton()
protected JButton makeForwardButton()
protected JButton makeButton(String toolTip, Action action, boolean isMenuButton)
toolTip
- the tool tip textaction
- the action for the buttonisMenuButton
- true if the button will have a menuprotected JToggleButton makeToggleButton(String toolTip, Action action)
toolTip
- the tool tip textaction
- the action for the buttonisMenuButton
- true if the button will have a menuprotected JButton makeMenuButton(String toolTip, JPopupMenu menu)
toolTip
- the tool tip text for the buttonmenu
- the menu for the buttonprotected void updateButton(AbstractButton button, String text, Icon icon)
button
- the buttontext
- the button texticon
- the URL string for the button's iconpublic void setShowPictures(boolean b)
public void setShowText(boolean b)
public void update()
public JButton getOpenButton()
public JButton getBackButton()
public JButton getForwardButton()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |