bibliothek.gui.dock.util
Class PropertyKey<A>

java.lang.Object
  extended by bibliothek.gui.dock.util.PropertyKey<A>
Type Parameters:
A - the type of entry

public class PropertyKey<A>
extends java.lang.Object

The key for an entry in a map of properties.

Author:
Benjamin Sigg

Field Summary
static PropertyKey<javax.swing.Icon> DOCK_STATION_ICON
          The Icon used for a DockStation if it has no icon.
static PropertyKey<java.lang.String> DOCK_STATION_TITLE
          The title of a DockStation if it has no title.
static PropertyKey<java.lang.String> DOCK_STATION_TOOLTIP
          The tooltip used for a DockStation that has no tooltip set
static PropertyKey<javax.swing.Icon> DOCKABLE_ICON
          The Icon used for a Dockable if it has no icon.
static PropertyKey<java.lang.String> DOCKABLE_TITLE
          The title of a Dockable if it has no title.
static PropertyKey<java.lang.String> DOCKABLE_TOOLTIP
          The tooltip used for a Dockable that has no tooltip set
 
Constructor Summary
PropertyKey(java.lang.String id)
          Creates a new key.
PropertyKey(java.lang.String id, PropertyFactory<A> value)
          Deprecated. replaced by PropertyKey(String, PropertyFactory, boolean)
PropertyKey(java.lang.String id, PropertyFactory<A> value, boolean nullValueReplacedByDefault)
          Creates a new key.
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 A getDefault(DockProperties properties)
          Gets a default-value that should be used when no value is set in the DockProperties.
 int hashCode()
           
 boolean isNullValueReplacedByDefault()
          If set, then the null value should be replaced by the default value specified by this key.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

DOCKABLE_ICON

public static final PropertyKey<javax.swing.Icon> DOCKABLE_ICON
The Icon used for a Dockable if it has no icon.
This key should only be used for writing the icon, reading the icon should be done throught the IconManager using the key "dockable.default".


DOCK_STATION_ICON

public static final PropertyKey<javax.swing.Icon> DOCK_STATION_ICON
The Icon used for a DockStation if it has no icon.
This key should only be used for writing the icon, reading the icon should be done throught the IconManager using the key "dockStation.default".


DOCKABLE_TITLE

public static final PropertyKey<java.lang.String> DOCKABLE_TITLE
The title of a Dockable if it has no title.


DOCK_STATION_TITLE

public static final PropertyKey<java.lang.String> DOCK_STATION_TITLE
The title of a DockStation if it has no title.


DOCKABLE_TOOLTIP

public static final PropertyKey<java.lang.String> DOCKABLE_TOOLTIP
The tooltip used for a Dockable that has no tooltip set


DOCK_STATION_TOOLTIP

public static final PropertyKey<java.lang.String> DOCK_STATION_TOOLTIP
The tooltip used for a DockStation that has no tooltip set

Constructor Detail

PropertyKey

public PropertyKey(java.lang.String id)
Creates a new key.

Parameters:
id - a unique identifier, should contain the name of the type of property, represented by this key.

PropertyKey

@Deprecated
public PropertyKey(java.lang.String id,
                              PropertyFactory<A> value)
Deprecated. replaced by PropertyKey(String, PropertyFactory, boolean)

Creates a new key.

Parameters:
id - a unique identifier, should contain the name of the type of property, represented by this key.
value - the value that will be used when no value is set in the properties

PropertyKey

public PropertyKey(java.lang.String id,
                   PropertyFactory<A> value,
                   boolean nullValueReplacedByDefault)
Creates a new key.

Parameters:
id - a unique identifier, should contain the name of the type of property, represented by this key.
value - the value that will be used when no value is set in the properties
nullValueReplacedByDefault - if set, then the null value in DockProperties gets replaced by the default value of this key even if the null value was set explicitely.
Method Detail

getDefault

public final A getDefault(DockProperties properties)
Gets a default-value that should be used when no value is set in the DockProperties.
Note: this method should not be called by clients.

Parameters:
properties - the properties for which the default value will be used
Returns:
the default-value

isNullValueReplacedByDefault

public boolean isNullValueReplacedByDefault()
If set, then the null value should be replaced by the default value specified by this key.

Returns:
true if null means default

hashCode

public final int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public final boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object