Package com.palantir.ptoss.cinch.core
Class WeakBindableModel
java.lang.Object
com.palantir.ptoss.cinch.core.WeakBindableModel
- All Implemented Interfaces:
BindableModel
Superclass for BindableModel
instances, this class handles the binding
tasks for subclassed models.
Basic theory of operation: TODO
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Binds this model to some component with aBinding
object.void
bindStrongly
(Binding binding) Binds this model to aBinding
using strong references.<T extends Enum<T> & ModelUpdate>
voidmodelUpdated
(Object oldValue, Object newValue, T... changed) Fires a model update if the old and new values are different.<T extends Enum<T> & ModelUpdate>
voidmodelUpdated
(T... changed) Alert the bindings that the model has updated with the specified change types.void
Removes the passed binding from this model.void
Unbinds both weak and strongBinding
from this Model.void
update()
Called by the implementingModel
to notify all listeners that data in theModel
has changed.
-
Constructor Details
-
WeakBindableModel
public WeakBindableModel()
-
-
Method Details
-
bind
Binds this model to some component with aBinding
object. This method is called by the variousWiringHarness
objects to bind individual components to this model.- Specified by:
bind
in interfaceBindableModel
-
bindStrongly
Binds this model to aBinding
using strong references. -
modelUpdated
Alert the bindings that the model has updated with the specified change types.- Specified by:
modelUpdated
in interfaceBindableModel
- Parameters:
changed
- list of change types to indicate
-
modelUpdated
public <T extends Enum<T> & ModelUpdate> void modelUpdated(Object oldValue, Object newValue, T... changed) Fires a model update if the old and new values are different.- Type Parameters:
T
- A varargs list of enumeratedModelUpdate
types.- Parameters:
oldValue
- original value to be comparednewValue
- new value to compare against
-
update
public void update()Called by the implementingModel
to notify all listeners that data in theModel
has changed. -
unbind
Removes the passed binding from this model.- Specified by:
unbind
in interfaceBindableModel
-
unbindAll
public void unbindAll()Unbinds both weak and strongBinding
from this Model.- See Also:
-