Class WeakBindableModel

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

public class WeakBindableModel extends Object implements BindableModel

Superclass for BindableModel instances, this class handles the binding tasks for subclassed models.

Basic theory of operation: TODO

  • Constructor Details

    • WeakBindableModel

      public WeakBindableModel()
  • Method Details

    • bind

      public void bind(Binding binding)
      Binds this model to some component with a Binding object. This method is called by the various WiringHarness objects to bind individual components to this model.
      Specified by:
      bind in interface BindableModel
    • bindStrongly

      public void bindStrongly(Binding binding)
      Binds this model to a Binding using strong references.
    • 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
    • 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 enumerated ModelUpdate types.
      Parameters:
      oldValue - original value to be compared
      newValue - new value to compare against
    • update

      public void update()
      Called by the implementing Model to notify all listeners that data in the Model has changed.
    • unbind

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

      public void unbindAll()
      Unbinds both weak and strong Binding from this Model.
      See Also: