|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object bibliothek.gui.dock.util.TypedUIProperties
public class TypedUIProperties
A wrapper around an UIProperties
enhancing the properties with type safety.
Nested Class Summary | |
---|---|
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 Summary | |
---|---|
TypedUIProperties(DockController controller)
Creates a new map. |
Method Summary | ||
---|---|---|
|
add(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 . |
|
|
get(String id,
TypedUIProperties.Type<V> type)
Gets the current value of the resource id with type type . |
|
UIScheme<Object,UIValue<Object>,UIBridge<Object,UIValue<Object>>> |
getScheme(Priority priority)
Gets the scheme which fills missing entries on the level priority |
|
|
publish(Priority priority,
Path kind,
TypedUIProperties.Type<V> type,
UIBridge<V,UIValue<V>> bridge)
Adds an UIBridge to this manager, the bridge will be responsible for UIValue s of kind
kind . |
|
|
put(Priority priority,
String id,
TypedUIProperties.Type<V> type,
V value)
Sets a value of this manager. |
|
|
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<Object,UIValue<Object>,UIBridge<Object,UIValue<Object>>> scheme)
Sets a scheme that is used to fill missing entries. |
|
|
unpublish(Priority priority,
Path kind,
TypedUIProperties.Type<V> type)
Removes the UIBridge that was responsible for handling UIValue s of kind kind
and wrapping type type |
|
|
unpublish(Priority priority,
UIBridge<V,UIValue<V>> bridge)
Removes any occurrence of bridge from this manager. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TypedUIProperties(DockController controller)
controller
- the controller that uses this mapMethod Detail |
---|
public <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<Object,UIValue<Object>,UIBridge<Object,UIValue<Object>>> scheme)
priority
- the level on which the scheme will operatescheme
- the new scheme or null
public UIScheme<Object,UIValue<Object>,UIBridge<Object,UIValue<Object>>> getScheme(Priority priority)
priority
priority
- the level to question
null
public <V> void add(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 observer
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 hanlded by bridge
bridge
- the new bridgepublic <V> void unpublish(Priority priority, Path kind, TypedUIProperties.Type<V> type)
UIBridge
that was responsible for handling UIValue
s of kind kind
and wrapping type type
V
- the type
priority
- the level on which the bridge workedkind
- the kind of UIValue
the bridge handledtype
- the type of value the UIValue
s handlepublic <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, 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(String id, TypedUIProperties.Type<V> type)
id
with type type
.
V
- the type
id
- the identifier of some resourcetype
- the type of the resource
null
public void clear(Priority priority)
priority
.
priority
- the priority of the level to remove
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |