Class ComponentAdapter
Clients may derive their own component adapters by implementing this abstract class.
The actual binding is established by calling BindingContext.bind(String, ComponentAdapter)
.
The returned binding may be undone later by calling BindingContext.unbind(Binding)
.
- Since:
- Ceres 0.6
- Version:
- $Revision$ $Date$
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract void
Called by the framework either if a binding is established by callingBindingContext.bind(String, ComponentAdapter)
, ifBindingContext.adjustComponents()
is called, or if a property-change event occurs in the associatedPropertyContainer
of theBindingContext
.abstract void
Called by the framework in order to bind the GUI components to the bound property.Gets the binding which is using this adapter.abstract JComponent[]
Gets the components participating in the binding.final void
setBinding
(Binding binding) Sets the binding which is using this adapter.abstract void
Called by the framework in order to unbind the GUI components from the bound property.
-
Constructor Details
-
ComponentAdapter
public ComponentAdapter()
-
-
Method Details
-
getBinding
Gets the binding which is using this adapter.- Returns:
- The binding.
-
setBinding
Sets the binding which is using this adapter.Clients shall never call this method directly, it is called by the framework.
- Parameters:
binding
- The binding.- Throws:
IllegalStateException
- if the binding has already been set.
-
getComponents
Gets the components participating in the binding.- Returns:
- The array of components. Must not be empty.
-
bindComponents
public abstract void bindComponents()Called by the framework in order to bind the GUI components to the bound property.The frameworks called this method immediately after
setBinding(Binding)
has been called.Most implementations will register a change listener in the editor component which convert the input value and set the bound property by calling
getBinding().setPropertyValue(value)
.- See Also:
-
unbindComponents
public abstract void unbindComponents()Called by the framework in order to unbind the GUI components from the bound property.Most implementations will deregister any registered change listeners from the editor component.
- See Also:
-
adjustComponents
public abstract void adjustComponents()Called by the framework either- if a binding is established by calling
BindingContext.bind(String, ComponentAdapter)
, - if
BindingContext.adjustComponents()
is called, or - if a property-change event occurs in the associated
PropertyContainer
of theBindingContext
.
Most implementations adjusts the editor component with the value retrieved by
getBinding().getPropertyValue()
. Note that changes to the UI component shall be made on the EDT. Consider usingSwingUtilities.invokeLater()
.- See Also:
- if a binding is established by calling
-