com.vlsolutions.swing.docking
public class DockViewTitleBar extends JPanel implements DockableDragSource
Here is an example of a title bar : .
DockViewTitleBar is able to display the following properties of a DockKey :
This title bar supports buttons used for docking features :
function | Version 1.1 | Version 2.0 |
---|---|---|
maximize | ![]() | ![]() |
restore | ![]() | ![]() |
hide | ![]() | ![]() |
dock | ![]() | ![]() |
close | ![]() | ![]() |
float (detach) | n/a | ![]() |
attach | n/a | ![]() |
The buttons managed have no effect on the state of the dockable : they just fire property change events, and it is the responsibility of the DockableContainer to listen to those events and to relay the operation to the docking desktop.
Note : the UI Delegate of the DockViewTitleBar is the DockViewTitleBarUI
Field Summary | |
---|---|
static String | PROPERTY_AUTOHIDE Property name designating the autohide button selection |
static String | PROPERTY_CLOSED Property name designating the close button selection |
static String | PROPERTY_DRAGGED Property name designating a drag gesture beginning |
static String | PROPERTY_FLOAT Property name designating the float button selection |
static String | PROPERTY_MAXIMIZED Property name designating the maximized button selection |
Constructor Summary | |
---|---|
DockViewTitleBar() Constructs an empty title bar (no dockable yet associated) | |
DockViewTitleBar(Dockable dockable) Constructs a title bar for the specified dockable |
Method Summary | |
---|---|
void | closePopUp() This method is invoked to hide the pop-up that could still be visible
(To avoid a visible pop-up for an invisible component) |
JButton | getCloseButton() |
Dockable | getDockable() |
Container | getDockableContainer() |
JButton | getFloatButton() returns the button used for floating (detach) the view. |
JButton | getHideOrDockButton() returns the button used for hiding or docking the view.
|
JButton | getMaximizeOrRestoreButton() returns the button used for maximizing or restoring the view.
|
JLabel | getTitleLabel() Returns the label used to display the dockkey name.
|
String | getUIClassID() |
protected void | initAutoHidePopUp(JPopupMenu popup) |
protected void | initDockedPopUp(JPopupMenu popup) |
protected void | initFloatingPopUp(JPopupMenu popup) Init the popup displayed as the title bar contextual menu |
protected void | initMaximizedPopUp(JPopupMenu popup) Init the popup displayed as the title bar contextual menu |
boolean | isActive() Returns true if the dockable is the currently active one.
|
protected void | layoutTitleBar() called to build the title bar |
void | removeNotify() Overriden as a means to unregister internal listeners, do not call directly |
void | setActive(boolean active) Updates the active property.
|
void | setDockable(Dockable dockable) Changes the dockable this title bar is for |
boolean | startDragComponent(Point p) |
String | toString() Returns a readeable String representing this title bar |
As hiding and docking are mutually exclusive, the same button is used for both purposes
As those operations are mutually exclusive, the same button is used for both purposes
Shouldn't be used to update the title : the best way is to update the DockKey (property listener ensure the labels and buttons stay in sync).
Since: 2.0
Since: 2.0
There is at most one active dockable for a dekstop, and it there is one, it is the one which contains the keybord focused component.