Class AbstractToStringProperty.ChildProperty<T>
- java.lang.Object
-
- org.openstreetmap.josm.data.preferences.AbstractProperty<T>
-
- org.openstreetmap.josm.data.preferences.AbstractToStringProperty<T>
-
- org.openstreetmap.josm.data.preferences.AbstractToStringProperty.ChildProperty<T>
-
- Type Parameters:
T
- The content type
- Enclosing class:
- AbstractToStringProperty<T>
public static class AbstractToStringProperty.ChildProperty<T> extends AbstractToStringProperty<T>
This is a version of this property that attempts to get the property with a more specialized key and - if that fails - uses the property value as default.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.openstreetmap.josm.data.preferences.AbstractToStringProperty
AbstractToStringProperty.ChildProperty<T>
-
Nested classes/interfaces inherited from class org.openstreetmap.josm.data.preferences.AbstractProperty
AbstractProperty.InvalidPreferenceValueException, AbstractProperty.ValueChangeEvent<T>, AbstractProperty.ValueChangeListener<T>
-
-
Field Summary
Fields Modifier and Type Field Description private AbstractToStringProperty<T>
parent
-
Fields inherited from class org.openstreetmap.josm.data.preferences.AbstractProperty
defaultValue, key, preferences
-
-
Constructor Summary
Constructors Constructor Description ChildProperty(AbstractToStringProperty<T> parent, java.lang.String key)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addListenerImpl(PreferenceChangedListener adapter)
CachingProperty<T>
cached()
Creates a newCachingProperty
instance for this property.protected T
fromString(java.lang.String string)
Converts the string to an object of the given type.T
getDefaultValue()
Replies the default value of this property.protected void
removeListenerImpl(PreferenceChangedListener adapter)
protected void
storeDefaultValue()
Store the default value to the preferences.protected java.lang.String
toString(T t)
Converts the string to an object of the given type.-
Methods inherited from class org.openstreetmap.josm.data.preferences.AbstractToStringProperty
get, getAsString, getChildProperty, getSpecialized, put
-
Methods inherited from class org.openstreetmap.josm.data.preferences.AbstractProperty
addListener, addWeakListener, equals, getKey, getPreferences, hashCode, isSet, remove, removeListener
-
-
-
-
Field Detail
-
parent
private final AbstractToStringProperty<T> parent
-
-
Constructor Detail
-
ChildProperty
ChildProperty(AbstractToStringProperty<T> parent, java.lang.String key)
-
-
Method Detail
-
storeDefaultValue
protected void storeDefaultValue()
Description copied from class:AbstractProperty
Store the default value to the preferences.- Overrides:
storeDefaultValue
in classAbstractProperty<T>
-
getDefaultValue
public T getDefaultValue()
Description copied from class:AbstractProperty
Replies the default value of this property.- Overrides:
getDefaultValue
in classAbstractProperty<T>
- Returns:
- The default value of this property
-
fromString
protected T fromString(java.lang.String string)
Description copied from class:AbstractToStringProperty
Converts the string to an object of the given type.- Specified by:
fromString
in classAbstractToStringProperty<T>
- Parameters:
string
- The string- Returns:
- The object.
-
toString
protected java.lang.String toString(T t)
Description copied from class:AbstractToStringProperty
Converts the string to an object of the given type.- Specified by:
toString
in classAbstractToStringProperty<T>
- Parameters:
t
- The object.- Returns:
- The string representing the object
-
addListenerImpl
protected void addListenerImpl(PreferenceChangedListener adapter)
- Overrides:
addListenerImpl
in classAbstractProperty<T>
-
removeListenerImpl
protected void removeListenerImpl(PreferenceChangedListener adapter)
- Overrides:
removeListenerImpl
in classAbstractProperty<T>
-
cached
public CachingProperty<T> cached()
Description copied from class:AbstractProperty
Creates a newCachingProperty
instance for this property.- Overrides:
cached
in classAbstractProperty<T>
- Returns:
- The new caching property instance.
-
-