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
BindableModelinstances, 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 voidbind(Binding binding)Binds this model to some component with aBindingobject.voidbindStrongly(Binding binding)Binds this model to aBindingusing 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.voidunbind(Binding binding)Removes the passed binding from this model.voidunbindAll()Unbinds both weak and strongBindingfrom this Model.voidupdate()Called by the implementingModelto notify all listeners that data in theModelhas changed.
-
-
-
Method Detail
-
bind
public void bind(Binding binding)
Binds this model to some component with aBindingobject. This method is called by the variousWiringHarnessobjects to bind individual components to this model.- Specified by:
bindin interfaceBindableModel
-
bindStrongly
public void bindStrongly(Binding binding)
Binds this model to aBindingusing 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:
modelUpdatedin 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 enumeratedModelUpdatetypes.- Parameters:
oldValue- original value to be comparednewValue- new value to compare against
-
update
public void update()
Called by the implementingModelto notify all listeners that data in theModelhas changed.
-
unbind
public void unbind(Binding binding)
Removes the passed binding from this model.- Specified by:
unbindin interfaceBindableModel
-
unbindAll
public void unbindAll()
Unbinds both weak and strongBindingfrom this Model.- See Also:
BindableModel.unbind(Binding)
-
-