V
- the kind of values this UIValue
handlesU
- the kind of UIValue
that the UIProperties
will handle.
This class is either abstract, or a subclass of U
.public abstract class AbstractUIValue<V,U extends UIValue<V>> extends java.lang.Object implements UIValue<V>
UIValue
. This class contains more than
just one resource:
UIProperties
UIProperties
.Constructor and Description |
---|
AbstractUIValue(java.lang.String id)
Creates a new
UIValue . |
AbstractUIValue(java.lang.String id,
Path kind)
Creates a new
UIValue . |
AbstractUIValue(java.lang.String id,
Path kind,
V backup)
Creates a new
UIValue . |
AbstractUIValue(java.lang.String id,
V backup)
Creates a new
UIValue . |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
changed(V oldValue,
V newValue)
Called when the resource of this
AbstractDockColor has changed |
V |
getBackup()
Gets the backup value.
|
java.lang.String |
getId()
Gets the identifier of this value.
|
Path |
getKind()
Gets the kind of this value.
|
V |
getValue()
Gets the override value.
|
protected abstract U |
me()
Returns
this . |
void |
set(V value)
Called when the underlying resource of this
UIValue changes. |
void |
setBackup(V backup)
Sets the backup value.
|
void |
setId(java.lang.String id)
Changes the identifier of this value.
|
void |
setKind(Path kind)
Changes the kind of this value.
|
void |
setManager(UIProperties<V,U,?> manager)
Sets the manager which owns this
UIValue , this will
automatically be added or removed from the current manager . |
void |
setValue(V value)
Sets the override value.
|
void |
setValue(V value,
boolean forceNull)
Sets the override value.
|
void |
update(UIProperties<V,U,?> manager)
|
V |
value()
Gets the first non-
null value of the list
override , value , backup . |
public AbstractUIValue(java.lang.String id)
UIValue
.id
- the id of the resource for which this
should listen forpublic AbstractUIValue(java.lang.String id, Path kind)
UIValue
.id
- the id of the resource for which this
should listen forkind
- the kind of UIValue
this ispublic AbstractUIValue(java.lang.String id, V backup)
UIValue
.id
- the id of the resource for which this
should listen forbackup
- a backup resource, can be null
protected abstract U me()
this
. This method can only be implemented when
the generic boundaries are met, so this methods ensures that this
is really an U
, or abstract
.this
public void setId(java.lang.String id)
id
- the new id, must not be null
public java.lang.String getId()
null
public void setKind(Path kind)
UIProperties
to find out, which UIBridge
should be used to interact with
this UIValue
.kind
- the new kind, not null
. The kind should be
a class or interfaces that is implemented by this UIValue
.public Path getKind()
setKind(Path)
.null
public void setManager(UIProperties<V,U,?> manager)
UIValue
, this
will
automatically be added or removed from the current manager
.manager
- the new manager, can be null
public void set(V value)
UIValue
UIValue
changes.public void update(UIProperties<V,U,?> manager)
manager
- the manager from which to read the valuepublic V value()
null
value of the list
override
, value
, backup
.null
protected abstract void changed(V oldValue, V newValue)
AbstractDockColor
has changedoldValue
- the old value, can be null
newValue
- the new value, can be null
public void setValue(V value)
value
- the new override or null
public void setValue(V value, boolean forceNull)
value()
returns
null
, use forceNull
with care.value
- the new value, can be null
forceNull
- if true
and value
is null
, then
the result of value()
is null
toopublic V getValue()
null
public void setBackup(V backup)
backup
- the backup or null
public V getBackup()
null