public class TypedUIProperties
extends java.lang.Object
UIProperties
enhancing the properties with type safety.Modifier and Type | Class and Description |
---|---|
static class |
TypedUIProperties.Type<T>
A class describing a type, different
TypedUIProperties.Type objects may share the same Class object
but with different or even equal generic parameters. |
Constructor and Description |
---|
TypedUIProperties(DockController controller)
Creates a new map.
|
Modifier and Type | Method and Description |
---|---|
<V> void |
add(java.lang.String id,
Path kind,
TypedUIProperties.Type<V> type,
UIValue<V> value)
Adds the listener
value to this manager. |
void |
clear(Priority priority)
Removes all resources that were stored on the level
priority . |
<V> V |
get(java.lang.String id,
TypedUIProperties.Type<V> type)
Gets the current value of the resource
id with type type . |
UIScheme<java.lang.Object,UIValue<java.lang.Object>,UIBridge<java.lang.Object,UIValue<java.lang.Object>>> |
getScheme(Priority priority)
Gets the scheme which fills missing entries on the level
priority |
<V> void |
publish(Priority priority,
Path kind,
TypedUIProperties.Type<V> type,
UIBridge<V,UIValue<V>> bridge)
|
<V> void |
put(Priority priority,
java.lang.String id,
TypedUIProperties.Type<V> type,
V value)
Sets a value of this manager.
|
<T> void |
registerType(TypedUIProperties.Type<T> type)
Registers
type at this properties. |
void |
remove(UIValue<?> value)
Removes the observer
value from this manager. |
void |
setScheme(Priority priority,
UIScheme<java.lang.Object,UIValue<java.lang.Object>,UIBridge<java.lang.Object,UIValue<java.lang.Object>>> scheme)
Sets a scheme that is used to fill missing entries.
|
<V> void |
unpublish(Priority priority,
Path kind,
TypedUIProperties.Type<V> type)
|
<V> void |
unpublish(Priority priority,
UIBridge<V,UIValue<V>> bridge)
Removes any occurrence of
bridge from this manager. |
public TypedUIProperties(DockController controller)
controller
- the controller that uses this mappublic <T> void registerType(TypedUIProperties.Type<T> type)
type
at this properties. Only after type
has been registered it
can be used to call the methods of this object. Note that type
cannot be removed nor can
it be altered. An attempt to use another TypedUIProperties.Type
with the same key will always result in an
exception.T
- the type
type
- the new type, not null
public void setScheme(Priority priority, UIScheme<java.lang.Object,UIValue<java.lang.Object>,UIBridge<java.lang.Object,UIValue<java.lang.Object>>> scheme)
priority
- the level on which the scheme will operatescheme
- the new scheme or null
public UIScheme<java.lang.Object,UIValue<java.lang.Object>,UIBridge<java.lang.Object,UIValue<java.lang.Object>>> getScheme(Priority priority)
priority
priority
- the level to questionnull
public <V> void add(java.lang.String id, Path kind, TypedUIProperties.Type<V> type, UIValue<V> value)
value
to this manager.V
- the type of object value
supports.id
- the unique identifier of the property to observekind
- what kind of object value
actually istype
- V
in a form that can be tested by this managervalue
- the new observerjava.lang.IllegalArgumentException
- if type
is not known to this manager or if either
of the arguments is null
public void remove(UIValue<?> value)
value
from this manager.value
- the observer to removepublic <V> void publish(Priority priority, Path kind, TypedUIProperties.Type<V> type, UIBridge<V,UIValue<V>> bridge)
UIBridge
to this manager, the bridge will be responsible for UIValue
s of kind
kind
. Please note that UIValue
s of a sub-kind of kind
might be handled
by bridge
as well, unless a bridge was installed for that sub-kind.V
- the type
priority
- the importance of bridge
kind
- the kind of UIValue
s bridge
has to handletype
- The type of objects handled by bridge
bridge
- the new bridgepublic <V> void unpublish(Priority priority, Path kind, TypedUIProperties.Type<V> type)
public <V> void unpublish(Priority priority, UIBridge<V,UIValue<V>> bridge)
bridge
from this manager.V
- the type handled by the UIValue
spriority
- the level on which to search the bridgebridge
- the bridge to remove everywherepublic <V> void put(Priority priority, java.lang.String id, TypedUIProperties.Type<V> type, V value)
V
- the type
priority
- the level on which to store value
id
- the unique identifier of value
type
- the type of value
value
- the resources itself, can be null
public <V> V get(java.lang.String id, TypedUIProperties.Type<V> type)
id
with type type
.V
- the type
id
- the identifier of some resourcetype
- the type of the resourcenull
public void clear(Priority priority)
priority
.priority
- the priority of the level to remove