com.vlsolutions.swing.docking

Class DockableStoreButton

public class DockableStoreButton extends JButton implements DockDropReceiver, DockableDragSource

A Button that can be used to store a dockable (for example to allow moving a dockable between two workspaces).

The button is able to display the Icon, text and toolip of a dockable key, and can be used as a drag source (to initiate a drop into a desktop).

Constructor Summary
DockableStoreButton(String emptyText)
DockableStoreButton()
Method Summary
voidendDragComponent(boolean dropped)
DockablegetDockable()
Return the dockable currently stored (may be null)
ContainergetDockableContainer()
IcongetEmptyIcon()
Returns the Icon used with this button when no dockable is selected
StringgetEmptyText()
Returns the text used for this button when no dockable is stored
StringgetEmptyTooltip()
Returns the text used as tooltip for this button when no dockable is stored
StringgetFullText()
Returns the text used for this button when a dockable is stored
StringgetFullTooltip()
Returns the text used for as tooltip this button when a dockable is stored
voidprocessDockableDrag(DockDragEvent event)
when a dockable is dragged above this button, the button stores it as its new target dockable.
voidprocessDockableDrop(DockDropEvent event)
Rejects the drop as this action isn't possible on this component
voidsetDockable(Dockable dockable)
voidsetEmptyIcon(Icon emptyIcon)
Updates the icon used for this button when no dockable is stored
voidsetEmptyText(String emptyText)
updates the text used for this button when no dockable is stored
voidsetEmptyTooltip(String emptyTooltip)
Updates the text used as tooltip for this button when no dockable is stored
voidsetFullText(String fullText)
Returns the text used for this button when a dockable is stored
voidsetFullTooltip(String fullTooltip)
Updates the text used as tooltip for this button when no dockable is stored.
booleanstartDragComponent(Point p)
voidupdateButtonText()
Override this method if you want to change the display (text and icon) of this button and the default settings don't suit your needs.

Constructor Detail

DockableStoreButton

public DockableStoreButton(String emptyText)

DockableStoreButton

public DockableStoreButton()

Method Detail

endDragComponent

public void endDragComponent(boolean dropped)

getDockable

public Dockable getDockable()
Return the dockable currently stored (may be null)

getDockableContainer

public Container getDockableContainer()

getEmptyIcon

public Icon getEmptyIcon()
Returns the Icon used with this button when no dockable is selected

getEmptyText

public String getEmptyText()
Returns the text used for this button when no dockable is stored

getEmptyTooltip

public String getEmptyTooltip()
Returns the text used as tooltip for this button when no dockable is stored

getFullText

public String getFullText()
Returns the text used for this button when a dockable is stored

getFullTooltip

public String getFullTooltip()
Returns the text used for as tooltip this button when a dockable is stored

processDockableDrag

public void processDockableDrag(DockDragEvent event)
when a dockable is dragged above this button, the button stores it as its new target dockable.

See Also: getDockable

processDockableDrop

public void processDockableDrop(DockDropEvent event)
Rejects the drop as this action isn't possible on this component

setDockable

public void setDockable(Dockable dockable)

setEmptyIcon

public void setEmptyIcon(Icon emptyIcon)
Updates the icon used for this button when no dockable is stored

setEmptyText

public void setEmptyText(String emptyText)
updates the text used for this button when no dockable is stored

setEmptyTooltip

public void setEmptyTooltip(String emptyTooltip)
Updates the text used as tooltip for this button when no dockable is stored

setFullText

public void setFullText(String fullText)
Returns the text used for this button when a dockable is stored

setFullTooltip

public void setFullTooltip(String fullTooltip)
Updates the text used as tooltip for this button when no dockable is stored. The special value '&1' will be replaced by the name of this dockable.

For example "&1 stored" could be replaced by "MyDockable stored"

startDragComponent

public boolean startDragComponent(Point p)

updateButtonText

public void updateButtonText()
Override this method if you want to change the display (text and icon) of this button and the default settings don't suit your needs.
© Copyright 2004-2007 VLSolutions. All Rights Reserved.
www.vlsolutions.com : Java Components - Smart Client Applications