public class TypedPropertyUIScheme extends java.lang.Object implements UIScheme<java.lang.Object,UIValue<java.lang.Object>,UIBridge<java.lang.Object,UIValue<java.lang.Object>>>
UIScheme
is intended to be used by a TypedUIProperties
to fill in gaps by reading selected keys of a DockProperties
.Constructor and Description |
---|
TypedPropertyUIScheme(DockProperties properties)
Creates a new scheme
|
Modifier and Type | Method and Description |
---|---|
void |
addListener(UISchemeListener<java.lang.Object,UIValue<java.lang.Object>,UIBridge<java.lang.Object,UIValue<java.lang.Object>>> listener)
Adds a listener to this scheme.
|
protected void |
fire(UISchemeEvent<java.lang.Object,UIValue<java.lang.Object>,UIBridge<java.lang.Object,UIValue<java.lang.Object>>> event)
Forwards the event
event to all registered UIListener s. |
UIBridge<java.lang.Object,UIValue<java.lang.Object>> |
getBridge(Path name,
UIProperties<java.lang.Object,UIValue<java.lang.Object>,UIBridge<java.lang.Object,UIValue<java.lang.Object>>> properties)
Creates the
UIBridge that handles resources of type name . |
java.lang.Object |
getResource(java.lang.String name,
UIProperties<java.lang.Object,UIValue<java.lang.Object>,UIBridge<java.lang.Object,UIValue<java.lang.Object>>> properties)
Creates the resource with name
name . |
void |
install(UIProperties<java.lang.Object,UIValue<java.lang.Object>,UIBridge<java.lang.Object,UIValue<java.lang.Object>>> properties)
Informs this scheme that it is now used by
properties . |
<V,A extends V> |
link(PropertyKey<A> source,
TypedUIProperties.Type<V> destinationType,
java.lang.String destinationId)
Creates a link between the key
source and the resource destinationId . |
void |
removeListener(UISchemeListener<java.lang.Object,UIValue<java.lang.Object>,UIBridge<java.lang.Object,UIValue<java.lang.Object>>> listener)
Removes a listener from this scheme.
|
void |
uninstall(UIProperties<java.lang.Object,UIValue<java.lang.Object>,UIBridge<java.lang.Object,UIValue<java.lang.Object>>> properties)
Informs this scheme that it is no longer used by
properties . |
<V> void |
unlink(TypedUIProperties.Type<V> destinationType,
java.lang.String destinationId)
Disables the connection leading to the resource
destinationId . |
public TypedPropertyUIScheme(DockProperties properties)
properties
- the source of all the information to read, not null
public <V,A extends V> void link(PropertyKey<A> source, TypedUIProperties.Type<V> destinationType, java.lang.String destinationId)
source
and the resource destinationId
. If there is an
older link to the same id, then the older link is removed first.V
- the type to read from a DockProperties
A
- the type to write into a TypedUIProperties
source
- the key for the resourcedestinationType
- the type of the resourcedestinationId
- the identifier of the resourcepublic <V> void unlink(TypedUIProperties.Type<V> destinationType, java.lang.String destinationId)
destinationId
.V
- the destinationType
destinationType
- the type of the resourcedestinationId
- the identifier of the resource that should no longer be managed by this schemepublic void addListener(UISchemeListener<java.lang.Object,UIValue<java.lang.Object>,UIBridge<java.lang.Object,UIValue<java.lang.Object>>> listener)
UIScheme
addListener
in interface UIScheme<java.lang.Object,UIValue<java.lang.Object>,UIBridge<java.lang.Object,UIValue<java.lang.Object>>>
listener
- the new listener, not null
public void removeListener(UISchemeListener<java.lang.Object,UIValue<java.lang.Object>,UIBridge<java.lang.Object,UIValue<java.lang.Object>>> listener)
UIScheme
removeListener
in interface UIScheme<java.lang.Object,UIValue<java.lang.Object>,UIBridge<java.lang.Object,UIValue<java.lang.Object>>>
listener
- the listener to removeprotected void fire(UISchemeEvent<java.lang.Object,UIValue<java.lang.Object>,UIBridge<java.lang.Object,UIValue<java.lang.Object>>> event)
event
to all registered UIListener
s.event
- the event to forwardpublic UIBridge<java.lang.Object,UIValue<java.lang.Object>> getBridge(Path name, UIProperties<java.lang.Object,UIValue<java.lang.Object>,UIBridge<java.lang.Object,UIValue<java.lang.Object>>> properties)
UIScheme
UIBridge
that handles resources of type name
.public java.lang.Object getResource(java.lang.String name, UIProperties<java.lang.Object,UIValue<java.lang.Object>,UIBridge<java.lang.Object,UIValue<java.lang.Object>>> properties)
UIScheme
name
. This method may be called often
and should complete quickly.getResource
in interface UIScheme<java.lang.Object,UIValue<java.lang.Object>,UIBridge<java.lang.Object,UIValue<java.lang.Object>>>
name
- the name of some resourceproperties
- the map that will use the resourcenull
if this scheme does not know name
public void install(UIProperties<java.lang.Object,UIValue<java.lang.Object>,UIBridge<java.lang.Object,UIValue<java.lang.Object>>> properties)
UIScheme
properties
.public void uninstall(UIProperties<java.lang.Object,UIValue<java.lang.Object>,UIBridge<java.lang.Object,UIValue<java.lang.Object>>> properties)
UIScheme
properties
.