Package com.palantir.ptoss.cinch.core
Class WeakBindableModel
- java.lang.Object
-
- com.palantir.ptoss.cinch.core.WeakBindableModel
-
- All Implemented Interfaces:
BindableModel
public class WeakBindableModel extends java.lang.Object implements BindableModel
Superclass for
BindableModel
instances, this class handles the binding tasks for subclassed models.Basic theory of operation: TODO
-
-
Constructor Summary
Constructors Constructor Description WeakBindableModel()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
bind(Binding binding)
Binds this model to some component with aBinding
object.void
bindStrongly(Binding binding)
Binds this model to aBinding
using strong references.<T extends java.lang.Enum<T> & ModelUpdate>
voidmodelUpdated(java.lang.Object oldValue, java.lang.Object newValue, T... changed)
Fires a model update if the old and new values are different.<T extends java.lang.Enum<T> & ModelUpdate>
voidmodelUpdated(T... changed)
Alert the bindings that the model has updated with the specified change types.void
unbind(Binding binding)
Removes the passed binding from this model.void
unbindAll()
Unbinds both weak and strongBinding
from this Model.void
update()
Called by the implementingModel
to notify all listeners that data in theModel
has changed.
-
-
-
Method Detail
-
bind
public void bind(Binding binding)
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
public void bindStrongly(Binding binding)
Binds this model to aBinding
using strong references.
-
modelUpdated
public <T extends java.lang.Enum<T> & ModelUpdate> void modelUpdated(T... changed)
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 java.lang.Enum<T> & ModelUpdate> void modelUpdated(java.lang.Object oldValue, java.lang.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
public void unbind(Binding binding)
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:
BindableModel.unbind(Binding)
-
-