Class SimpleProperty<T>
- java.lang.Object
-
- org.eclipse.emfforms.internal.common.SimpleProperty<T>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.eclipse.emfforms.common.Property
Property.ChangeListener<T>
-
-
Constructor Summary
Constructors Constructor Description SimpleProperty(java.lang.String name, T defaultValue)
The constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addChangeListener(Property.ChangeListener<T> listener)
Attach a listener.void
dispose()
Dispose the value.T
getDefault()
Returns the default value.java.lang.String
getName()
Get the name of the property.T
getValue()
Get the current value.void
removeChangeListener(Property.ChangeListener<T> listener)
Remove the listener.T
resetToDefault()
Resets the value to the initial value and returns the new value.void
setValue(T value)
Set the new value.
-
-
-
Constructor Detail
-
SimpleProperty
public SimpleProperty(java.lang.String name, T defaultValue)
The constructor.- Parameters:
name
- the name of the propertydefaultValue
- the default value
-
-
Method Detail
-
setValue
public void setValue(T value)
Description copied from interface:Property
Set the new value.
-
getName
public java.lang.String getName()
Description copied from interface:Property
Get the name of the property.
-
getDefault
public T getDefault()
Description copied from interface:Property
Returns the default value.- Specified by:
getDefault
in interfaceProperty<T>
- Returns:
- the value
-
resetToDefault
public T resetToDefault()
Description copied from interface:Property
Resets the value to the initial value and returns the new value.- Specified by:
resetToDefault
in interfaceProperty<T>
- Returns:
- the value
-
dispose
public void dispose()
Description copied from interface:Property
Dispose the value.
-
addChangeListener
public void addChangeListener(Property.ChangeListener<T> listener)
Description copied from interface:Property
Attach a listener.- Specified by:
addChangeListener
in interfaceProperty<T>
- Parameters:
listener
- the listener
-
removeChangeListener
public void removeChangeListener(Property.ChangeListener<T> listener)
Description copied from interface:Property
Remove the listener.- Specified by:
removeChangeListener
in interfaceProperty<T>
- Parameters:
listener
- the listener
-
-