com.vlsolutions.swing.toolbars
public class VLToolBar extends JPanel
To use the toolbar feature, you must follow this pattern :
The VLToolBar contains buttons and other components, and is included in a ToolBarPanel of a ToolBarContainer .
Loading and saving toolbar configurations is done with the ToolBarIO utility class.
Toolbars can now be collapsed (to gain space on screen). this property is disabled by default to keep compatibility with previous releases. For a better usage of collapsing it is better to set a tooltip text on the toolbar (it will be propagated to the gripper, which will be the only one component visible when collapsed).
UNKNOWN: 2006/02/20 Lilian Chamontin : added support for collapsible toolbars 2006/03/16 Lilian Chamontin : added animation effect when collapsing toolbars
Constructor Summary | |
---|---|
VLToolBar() Constructs a toolbar with a null name (this toolbar will not be
able to write its structure in a XML encoder, unless you call setName(String)
with a non null name before saving).
| |
VLToolBar(String name) Constructs a toolbar with the given name.
|
Method Summary | |
---|---|
Component | add(Component comp) Overriden to track AbstractButton added |
Component | add(AbstractButton button) Adds a new button to this toolbar |
Component | add(JButton button) Adds a new button to this toolbar |
void | addSeparator() Adds a new separator to this toolbar |
void | configureButton(AbstractButton button) This method is invoked upon adding a button to the toolbar. |
Border | getDraggedBorder() Returns the border used during drag and drop or the toolbar |
void | installButtonUI(AbstractButton button) Install custom UI for this button : a light rollover effet and a custom rounded/shaded border.
|
void | installMouseHandler(AbstractButton button) Used internally to add a mouse listener to the button.
|
boolean | isCollapsed() Returns true if this toolbar is currently collapsed |
boolean | isCollapsible() |
boolean | isRolloverBorderPainter() Returns the state of the rolloverBorderPainted property |
boolean | isRolloverContentAreaFilled() Returns the value of the rolloverContentAreaFilled property |
boolean | isUseCustomUI() Return the value of the useCustomUI property |
void | setCollapsed(boolean collapsed) Hides the toolbar (just showing the gripper) |
void | setCollapsible(boolean collapsible) |
void | setDraggedBorder(Border border) Changes the border used during drag and drop of the toolbar.
|
void | setOrientation(int orientation) Updates the orientation of this toolbar.
|
void | setRolloverBorderPainted(boolean painted) Updates the rolloverBorderPainted property.
|
void | setRolloverContentAreaFilled(boolean filled) Updates the rolloverContentAreaFilled property.
|
void | setToolTipText(String tooltip) Updates the tooltip of the toolbar, and propagates it to the toolbar gripper. |
void | setUseCustomUI(boolean useCustomUI) Updates the useCustomUI property.
|
String | toString() |
The name is used when reading/writing XML configuration. It must not be null if you use this feature.
Default settings are :
This method can be overriden to replace the provided "look and feel" which uses the follwing configuration :
Can be overriden to implement custom event handling.
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).
This method is called directly by the framework on toolbar installation or during drag and drop.
If true, when one of the toolbar buttons is rolled-over, its border will be shown.
DefaultValue is true
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.
Default value is true.
When set to true the installButtonUI() method will be called when a button is added to this toolbar.