| java.lang.Object com.jgoodies.binding.adapter.SpinnerToValueModelConnector
SpinnerToValueModelConnector | final public class SpinnerToValueModelConnector (Code) | | Synchronizes a SpinnerModel with a ValueModel.
author: Karsten Lentzsch version: $Revision: 1.9 $ See Also: SpinnerModel See Also: ValueModel since: 1.1 |
Method Summary | |
public static void | connect(SpinnerModel spinnerModel, ValueModel valueModel, Object defaultValue) Establishes a synchronization between the SpinnerModel and ValueModel. | public void | release() Removes the internal listener from the SpinnerModel and ValueModel. | public void | updateSpinnerModel() Sets the subject value as spinner value. | public void | updateValueModel() Sets the spinner value as value model's value. |
SpinnerToValueModelConnector | public SpinnerToValueModelConnector(SpinnerModel spinnerModel, ValueModel valueModel, Object defaultValue)(Code) | | Constructs a SpinnerToValueModelConnector that establishes a
Synchronization between the SpinnerModel and ValueModel.
This constructor does not synchronize the SpinnerModel and ValueModel now.
You may update the spinner model or value model using
#updateSpinnerModel or #updateValueModel .
In case you don't need the connector instance, you better use
the static method
SpinnerToValueModelConnector.connect(SpinnerModel,ValueModel,Object) .
This constructor may confuse developers if you just use
the side effects performed in the constructor; this is because it is
quite unconventional to instantiate an object that you never use.
Parameters: spinnerModel - the SpinnerModel to be synchronized Parameters: valueModel - the ValueModel to be synchronized Parameters: defaultValue - the value that will be used to updatethe spinnerModel, if the valueModel's value is null throws: NullPointerException - if the spinnerModel, valueModel or defaultValue is null |
connect | public static void connect(SpinnerModel spinnerModel, ValueModel valueModel, Object defaultValue)(Code) | | Establishes a synchronization between the SpinnerModel and ValueModel.
This method does not synchronize the SpinnerModel and ValueModel now.
You may update the spinner model or value model using
#updateSpinnerModel or #updateValueModel .
Parameters: spinnerModel - the SpinnerModel to be synchronized Parameters: valueModel - the ValueModel to be synchronized Parameters: defaultValue - the value used if the valueModel's value is null throws: NullPointerException - if the spinnerModel or valueModel is null |
release | public void release()(Code) | | Removes the internal listener from the SpinnerModel and ValueModel.
This connector must not be used after calling #release .
To avoid memory leaks it is recommended to invoke this method,
if the ValueModel lives much longer than the text component.
Instead of releasing this connector, you typically make the ValueModel
obsolete by releasing the PresentationModel or BeanAdapter that has
created the ValueModel.
As an alternative you may use ValueModels that in turn use
event listener lists implemented using WeakReference .
See Also: PresentationModel.release See Also: BeanAdapter.release See Also: java.lang.ref.WeakReference |
updateSpinnerModel | public void updateSpinnerModel()(Code) | | Sets the subject value as spinner value.
|
updateValueModel | public void updateValueModel()(Code) | | Sets the spinner value as value model's value.
|
|
|