com.vlsolutions.swing.docking

Class DockKey

public class DockKey extends Object

Provides a unique identification for a Dockable and runtime properties, like icon, name, tooltip, preferred audohide-zone...

As it is the object which identifies uniquely a user Dockable component, it should be associated with one and only one Dockable.

The unique key used for equals() comparison is the dockKey property, other properties can be shared by a set of DockKey (for example, you can share an icon, or even a display name between dockable Components).

Another usage is the decoration of a dockable container, providing informations such as its name, tooltip or icon.

Properties of a DockKey are listened to by the docking framework, so a change of name or icon is reflected on the GUI without further programming.

UNKNOWN: 2006/12/01 Lilian Chamontin : added client property support

Field Summary
static StringPROPERTY_AUTOHIDEABLE
Key identifying a change in the autohideEnabled property
static StringPROPERTY_CLOSEABLE
Key identifying a change in the closeEnabled property
static StringPROPERTY_DOCKABLE_STATE
Key identifying a change in the dockable dockableState
static StringPROPERTY_DOCKKEY
Key identifying a change in the dockKey property
static StringPROPERTY_FLOATABLE
Key identifying a change in the floatableEnabled property
static StringPROPERTY_ICON
Key identifying a change in the icon property
static StringPROPERTY_MAXIMIZABLE
Key identifying a change in the maximizedEnabled property
static StringPROPERTY_NAME
Key identifying a change in the name property
static StringPROPERTY_NOTIFICATION
Key identifying a change in the notification property
static StringPROPERTY_TAB_NAME
Key identifying a change in the tabname property (title used by tabbed containers)
static StringPROPERTY_TOOLTIP
Key identifying a change in the tooltip property
Constructor Summary
DockKey()
JavaBeans constructor : If used, also think to set the dockKey property.
DockKey(String dockKey)
Constructs a DockKey with dockKey (unique key) and name set to the same value
DockKey(String dockKey, String name)
Constructs a DockKey with dockKey (unique key) and a displayed name
DockKey(String dockKey, String name, String tooltip)
Constructs a DockKey with dockKey (unique key), a displayed name and a tooltip
DockKey(String dockKey, String name, String tooltip, Icon icon)
Constructs a DockKey with dockKey (unique key), a displayed name, a tooltip and an icon.
DockKey(String dockKey, String name, String tooltip, Icon icon, DockingConstants.Hide hideBorder)
Constructs a DockKey with dockKey (unique key), a displayed name, a tooltip, an icon and a default autohide border.
Method Summary
voidaddPropertyChangeListener(PropertyChangeListener listener)
Hook for property change notification
booleanequals(Object o)
Overriden for Map storage needs
DockableActionCustomizergetActionCustomizer()
Returns the action customizer associated to this dockkey (may return null)
DockingConstants.HidegetAutoHideBorder()
Returns the autohide border of this dockable, or null if not set
intgetDockableState()
returns the current visible dockableState of the dockable (see DockableState.STATE_ for enumaration values)
DockGroupgetDockGroup()
returns the dockGroup of this dockable
StringgetDockName()
IcongetIcon()
Returns the icon displayed in title bars
StringgetKey()
Returns the unique id designating the user component.
StringgetName()
Returns the name (or title) displayed in title bars
ObjectgetProperty(String name)
returns a property associated to this name, or null if the property is undefined
floatgetResizeWeight()
StringgetTabName()
Returns the tab name (or tab title) displayed when the component is contained into a tabbed container.
StringgetTooltip()
Returns the tooltip associated to the title bar
inthashCode()
Overriden for Map storage needs
booleanisAutoHideEnabled()
Returns try if autohiding is enabled
booleanisCloseEnabled()
Returns true if this dockable can be closed
booleanisFloatEnabled()
Returns true if this dockable can be detached from its desktop
booleanisMaximizeEnabled()
Returns true if this dockable can be maximized
booleanisNotification()
Returns true is a notification has been set.
voidputProperty(String name, Object value)
Allows any property to be stored in a map associated with this dockkey.
ObjectremoveProperty(String name)
returns and removes a property associated to this name, or null if the property is undefined
voidremovePropertyChangeListener(PropertyChangeListener listener)
Remove a property change notification
voidsetActionCustomizer(DockableActionCustomizer actionCustomizer)
Updates the action customizer of this dockable
voidsetAutoHideBorder(DockingConstants.Hide border)
Updates the autohide border property
voidsetAutoHideEnabled(boolean enabled)
Updates the autohideEnabled propety.
voidsetCloseEnabled(boolean enabled)
Updates the closeEnabled propety.
voidsetDockableState(int dockableState)
updates the dockableState property.
voidsetDockGroup(DockGroup group)
Updates the dockGroup of this dockable.
voidsetDockName(String name)
voidsetFloatEnabled(boolean enabled)
Updates the floatEnabled propety.
voidsetIcon(Icon icon)
Updates the icon property.
voidsetKey(String dockKey)
Updates the dockKey property.
voidsetMaximizeEnabled(boolean enabled)
Updates the maximizeEnabled propety.
voidsetName(String name)
Updates the name property.
voidsetNotification(boolean notification)
Updates the notification propety.
voidsetResizeWeight(float weight)
updates the resize weight of this dockable.
voidsetTabName(String tabName)
Updates the tabname property.
voidsetTooltip(String tooltip)
Updates the tooltip property.
StringtoString()

Field Detail

PROPERTY_AUTOHIDEABLE

public static final String PROPERTY_AUTOHIDEABLE
Key identifying a change in the autohideEnabled property

PROPERTY_CLOSEABLE

public static final String PROPERTY_CLOSEABLE
Key identifying a change in the closeEnabled property

PROPERTY_DOCKABLE_STATE

public static final String PROPERTY_DOCKABLE_STATE
Key identifying a change in the dockable dockableState

PROPERTY_DOCKKEY

public static final String PROPERTY_DOCKKEY
Key identifying a change in the dockKey property

PROPERTY_FLOATABLE

public static final String PROPERTY_FLOATABLE
Key identifying a change in the floatableEnabled property

PROPERTY_ICON

public static final String PROPERTY_ICON
Key identifying a change in the icon property

PROPERTY_MAXIMIZABLE

public static final String PROPERTY_MAXIMIZABLE
Key identifying a change in the maximizedEnabled property

PROPERTY_NAME

public static final String PROPERTY_NAME
Key identifying a change in the name property

PROPERTY_NOTIFICATION

public static final String PROPERTY_NOTIFICATION
Key identifying a change in the notification property

PROPERTY_TAB_NAME

public static final String PROPERTY_TAB_NAME
Key identifying a change in the tabname property (title used by tabbed containers)

PROPERTY_TOOLTIP

public static final String PROPERTY_TOOLTIP
Key identifying a change in the tooltip property

Constructor Detail

DockKey

public DockKey()
JavaBeans constructor : If used, also think to set the dockKey property.

DockKey

public DockKey(String dockKey)
Constructs a DockKey with dockKey (unique key) and name set to the same value

DockKey

public DockKey(String dockKey, String name)
Constructs a DockKey with dockKey (unique key) and a displayed name

DockKey

public DockKey(String dockKey, String name, String tooltip)
Constructs a DockKey with dockKey (unique key), a displayed name and a tooltip

DockKey

public DockKey(String dockKey, String name, String tooltip, Icon icon)
Constructs a DockKey with dockKey (unique key), a displayed name, a tooltip and an icon.

DockKey

public DockKey(String dockKey, String name, String tooltip, Icon icon, DockingConstants.Hide hideBorder)
Constructs a DockKey with dockKey (unique key), a displayed name, a tooltip, an icon and a default autohide border.

Method Detail

addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener listener)
Hook for property change notification

equals

public boolean equals(Object o)
Overriden for Map storage needs

getActionCustomizer

public DockableActionCustomizer getActionCustomizer()
Returns the action customizer associated to this dockkey (may return null)

getAutoHideBorder

public DockingConstants.Hide getAutoHideBorder()
Returns the autohide border of this dockable, or null if not set

getDockableState

public int getDockableState()
returns the current visible dockableState of the dockable (see DockableState.STATE_ for enumaration values)

See Also: DockableState

getDockGroup

public DockGroup getDockGroup()
returns the dockGroup of this dockable

getDockName

public String getDockName()

Deprecated: use getKey instead

See Also: getKey

getIcon

public Icon getIcon()
Returns the icon displayed in title bars

getKey

public String getKey()
Returns the unique id designating the user component.

Note : This used to be the getDockName prior version 2.0. It has been renamed to clarify the concept (there was a naming problem between getName() and getDockName()

getName

public String getName()
Returns the name (or title) displayed in title bars

getProperty

public Object getProperty(String name)
returns a property associated to this name, or null if the property is undefined

Parameters: name the name used to lookup the property

Since: 2.1.2

getResizeWeight

public float getResizeWeight()

getTabName

public String getTabName()
Returns the tab name (or tab title) displayed when the component is contained into a tabbed container.

getTooltip

public String getTooltip()
Returns the tooltip associated to the title bar

hashCode

public int hashCode()
Overriden for Map storage needs

isAutoHideEnabled

public boolean isAutoHideEnabled()
Returns try if autohiding is enabled

isCloseEnabled

public boolean isCloseEnabled()
Returns true if this dockable can be closed

isFloatEnabled

public boolean isFloatEnabled()
Returns true if this dockable can be detached from its desktop

isMaximizeEnabled

public boolean isMaximizeEnabled()
Returns true if this dockable can be maximized

isNotification

public boolean isNotification()
Returns true is a notification has been set.

default notification is making title bars blink.

putProperty

public void putProperty(String name, Object value)
Allows any property to be stored in a map associated with this dockkey. A property change event is propagated to listeners (with a property name equal to "clientProperty." + name)

Parameters: name the name used to lookup the property value the value of the property

Since: 2.1.2

removeProperty

public Object removeProperty(String name)
returns and removes a property associated to this name, or null if the property is undefined

Parameters: name the name used to lookup the property

Since: 2.1.2

removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener listener)
Remove a property change notification

setActionCustomizer

public void setActionCustomizer(DockableActionCustomizer actionCustomizer)
Updates the action customizer of this dockable

setAutoHideBorder

public void setAutoHideBorder(DockingConstants.Hide border)
Updates the autohide border property

setAutoHideEnabled

public void setAutoHideEnabled(boolean enabled)
Updates the autohideEnabled propety.

PropertyListeners are notified of that change

setCloseEnabled

public void setCloseEnabled(boolean enabled)
Updates the closeEnabled propety.

PropertyListeners are notified of that change

setDockableState

public void setDockableState(int dockableState)
updates the dockableState property.

Warning : do not call this method, it is for the sole use of the DockingDesktop API.

See Also: DockableState

setDockGroup

public void setDockGroup(DockGroup group)
Updates the dockGroup of this dockable.

setDockName

public void setDockName(String name)

Deprecated: use setKey instead

See Also: setKey

setFloatEnabled

public void setFloatEnabled(boolean enabled)
Updates the floatEnabled propety.

PropertyListeners are notified of that change

setIcon

public void setIcon(Icon icon)
Updates the icon property.

PropertyListeners are notified of that change

setKey

public void setKey(String dockKey)
Updates the dockKey property.

Although PropertyListeners are notified of that change, it is not recommended to change dynamicaly the dockKey property, as it is heavily used in the docking framework to identify dockable components.

Note : This used to be the getDockName prior version 2.0. It has been renamed to clarify the concept (there was a naming problem between getName() and getDockName()

setMaximizeEnabled

public void setMaximizeEnabled(boolean enabled)
Updates the maximizeEnabled propety.

PropertyListeners are notified of that change

setName

public void setName(String name)
Updates the name property. The name property is used by dockable container headers to associate a title with a dockable.

PropertyListeners are notified of that change

setNotification

public void setNotification(boolean notification)
Updates the notification propety. Notification results in a visual change of the dockable in order to attract attention from the user to this dockable.

PropertyListeners are notified of that change.

setResizeWeight

public void setResizeWeight(float weight)
updates the resize weight of this dockable. Valid values range between 0.0f and 1.0f

setTabName

public void setTabName(String tabName)
Updates the tabname property. This property is used by tabbed containers to display a shorter version of the title of this dockable.

Default value is null, meaning the name

PropertyListeners are notified of that change

Since: 2.1

setTooltip

public void setTooltip(String tooltip)
Updates the tooltip property.

PropertyListeners are notified of that change

toString

public String toString()
© Copyright 2004-2007 VLSolutions. All Rights Reserved.
www.vlsolutions.com : Java Components - Smart Client Applications