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 TypeMethodDescriptionvoidBinds this model to some component with aBindingobject.voidbindStrongly(Binding binding) Binds this model to aBindingusing 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.voidRemoves the passed binding from this model.voidUnbinds both weak and strongBindingfrom this Model.voidupdate()Called by the implementingModelto notify all listeners that data in theModelhas changed.
-
Constructor Details
-
WeakBindableModel
public WeakBindableModel()
-
-
Method Details
-
bind
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
Binds this model to aBindingusing strong references. -
modelUpdated
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 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 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
Removes the passed binding from this model.- Specified by:
unbindin interfaceBindableModel
-
unbindAll
public void unbindAll()Unbinds both weak and strongBindingfrom this Model.- See Also:
-