Class WeakBindableModelSupport

java.lang.Object
com.palantir.ptoss.cinch.core.WeakBindableModelSupport
All Implemented Interfaces:
BindableModel

public class WeakBindableModelSupport extends Object implements BindableModel
A stand-alone implementation of BindableModel. Uses WeakReferences to attach bindings to models.
  • Constructor Details

    • WeakBindableModelSupport

      public WeakBindableModelSupport()
  • Method Details

    • bind

      public void bind(Binding binding)
      Attach the binding to the model. Whenever the model is updated then the binding will be triggered.
      Specified by:
      bind in interface BindableModel
    • update

      public void update()
      Shortcut call for a generic model update.
    • modelUpdated

      public <T extends Enum<T> & ModelUpdate> void modelUpdated(T... changed)
      Alert the bindings that the model has updated with the specified change types.
      Specified by:
      modelUpdated in interface BindableModel
      Parameters:
      changed - list of change types to indicate
    • unbind

      public void unbind(Binding toUnbind)
      Removes the passed binding from this model.
      Specified by:
      unbind in interface BindableModel
    • unbindAll

      public void unbindAll()
      Removes all bindings from this model.