Interface Binding


public interface Binding
A bi-directional binding between one or more Swing GUI components and a property in a value container.

This class is not intended to be implemented by clients.

Since:
Ceres 0.6
Version:
$Revision$ $Date$
  • Method Details

    • getContext

      BindingContext getContext()
      Returns:
      The binding context.
    • getComponentAdapter

      ComponentAdapter getComponentAdapter()
      Returns:
      The component adapter.
    • getPropertyName

      String getPropertyName()
      Returns:
      The name of the bound property.
    • getPropertyValue

      Object getPropertyValue()
      Returns:
      The value of the bound property.
    • setPropertyValue

      void setPropertyValue(Object value)
      Sets the value of the bound property. This may trigger a property change event in the associated PropertyContainer. Whether or not setting the value was successful can be retrieved by getProblem().
      Parameters:
      value - The new value of the bound property.
    • getProblem

      BindingProblem getProblem()
      Gets the current problem. If the GUI is in sync with the associated property, the method will return null.
      Returns:
      The current problem, or null.
      Since:
      Ceres 0.10
    • clearProblem

      void clearProblem()
      Clears the current problem.
      Since:
      Ceres 0.10
    • reportProblem

      BindingProblem reportProblem(BindingException cause)
      Reports a problem. The method sets the current problem and will cause the context to fire a problem-occurred event.
      Parameters:
      cause - The cause.
      Returns:
      The resulting problem.
      Since:
      Ceres 0.10
    • adjustComponents

      void adjustComponents()
      Adjusts the Swing components in reaction to a bound property change event in the associated PropertyContainer.

      The method delegates to ComponentAdapter.adjustComponents(), but only if this binding is not already adjusting its GUI components.

      After calling this method the UI is in-sync with the property, so that getProblem() will return null.

      See Also:
    • isAdjustingComponents

      boolean isAdjustingComponents()
      Tests if this binding is currently adjusting the bound GUI components.
      Returns:
      true if so.
      See Also:
    • getComponents

      JComponent[] getComponents()
      Gets all components participating in this binding: the one returned by the associated ComponentAdapter plus the ones added to this binding using the addComponent(javax.swing.JComponent) method.
      Returns:
      All components participating in this binding.
    • addComponent

      void addComponent(JComponent component)
      Adds a secondary Swing component to this binding, e.g. a JLabel.
      Parameters:
      component - The secondary component.
      See Also:
    • removeComponent

      void removeComponent(JComponent component)
      Removes a secondary Swing component from this binding.
      Parameters:
      component - The secondary component.
      See Also: