A JToolbar suitable for drag and drop purposes.
To use the toolbar feature, you must follow this pattern :
- The toolbars must be contained initially in a ToolBarPanel (which can contain multiple toolbars)
- The ToolBarPanel must be contained in a ToolBarContainer (which can contain as much as 4 ToolBarPanels
, one on each border).
- The center component of the ToolBarContainer can be the DockingDesktop, or any user component.

ToolBarIO
add
public Component add(AbstractButton button)
Adds a new button to this toolbar
add
public Component add(Component comp)
Overriden to track AbstractButton added
add
public Component add(JButton button)
Adds a new button to this toolbar
addSeparator
public void addSeparator()
Adds a new separator to this toolbar
configureButton
public void configureButton(AbstractButton button)
This method is invoked upon adding a button to the toolbar. It can be
overriden to provide another look or feel.
Default settings are :
- setRolloverEnabled(true)
- setContentAreaFilled(false);
- setOpaque(false)
- setBorderPainted(false)
getDraggedBorder
public Border getDraggedBorder()
Returns the border used during drag and drop or the toolbar
installButtonUI
public void installButtonUI(AbstractButton button)
Install custom UI for this button : a light rollover effet and a custom rounded/shaded border.
This method can be overriden to replace the provided "look and feel" which uses the follwing configuration :
- install a VLButtonUI
- set 2 pixels margins
- set a ToolBarButtonBorder.
installMouseHandler
public void installMouseHandler(AbstractButton button)
Used internally to add a mouse listener to the button.
Can be overriden to implement custom event handling.
isCollapsed
public boolean isCollapsed()
Returns true if this toolbar is currently collapsed
isCollapsible
public boolean isCollapsible()
isRolloverBorderPainter
public boolean isRolloverBorderPainter()
Returns the state of the rolloverBorderPainted property
isRolloverContentAreaFilled
public boolean isRolloverContentAreaFilled()
Returns the value of the rolloverContentAreaFilled property
isUseCustomUI
public boolean isUseCustomUI()
Return the value of the useCustomUI property
setCollapsed
public void setCollapsed(boolean collapsed)
Hides the toolbar (just showing the gripper)
setCollapsible
public void setCollapsible(boolean collapsible)
setDraggedBorder
public void setDraggedBorder(Border border)
Changes the border used during drag and drop of the toolbar.
For a better user experience, please note to install an empty border of the
same Insets than this one (otherwise, there will be a size change of the toolbar at the beginning
of the drag and after the drop).
setOrientation
public void setOrientation(int orientation)
Updates the orientation of this toolbar.
This method is called directly by the framework on toolbar installation or
during drag and drop.
setRolloverBorderPainted
public void setRolloverBorderPainted(boolean painted)
Updates the rolloverBorderPainted property.
If true, when one of the toolbar buttons is rolled-over, its border will be shown.
DefaultValue is true
setRolloverContentAreaFilled
public void setRolloverContentAreaFilled(boolean filled)
Updates the rolloverContentAreaFilled property.
If true, when one of the toolbar buttons is rolled-over, its content will be filled.
Default value is
false to accomodate with VLButtonUI which paints itself the button
interiors.
setToolTipText
public void setToolTipText(String tooltip)
Updates the tooltip of the toolbar, and propagates it to the toolbar gripper.
setUseCustomUI
public void setUseCustomUI(boolean useCustomUI)
Updates the useCustomUI property.
Default value is true.
When set to true the installButtonUI() method will be called when a button is added to this
toolbar.
toString
public String toString()