cdx.scorebot.util.swing.binding.delegate
Interface BoundDelegateComponent

All Known Subinterfaces:
BoundDelegateContainer
All Known Implementing Classes:
ButtonGroupDelegate, CalHourBoxComponentDelegate, GenericDelegate, GenericJComponentDelegate, IntermediateFieldDelegate, JComboBoxComponentDelegate, JLabelComponentDelegate, JListComponentDelegate, JMenuComponentDelegate, JTextComponentDelegate, JToggleButtonComponentDelegate, ListBasedComponentDelegate

public interface BoundDelegateComponent

This interface specifies the methods which bind some object to some component.

Author:
David Underhill

Method Summary
 void addBindingListener(BindingListener listener)
          Register a listener for this object
 void changeBinding(Binding b)
          change what this object is bound to (will save the current value to its currently bound object)
 void changeBinding(int index)
          change what this object is bound to (will save the current value to its currently bound object)
 void changeBinding(java.lang.Object newBoundItem)
          change what this object is bound to (will save the current value to its currently bound object)
 void changeBinding(java.lang.Object newBoundItem, int index)
          change what this object is bound to (will save the current value to its currently bound object)
 void changeBinding(java.lang.Object boundItem, java.lang.String varName)
          change what this object is bound to (will save the current value to its currently bound object)
 void changeBinding(java.lang.Object boundItem, java.lang.String getterName, java.lang.String setterName)
          change what this object is bound to (will save the current value to its currently bound object)
 void changeBinding(java.lang.Object boundItem, java.lang.String getterName, java.lang.String setterName, int indexAt)
          change what this object is bound to (will save the current value to its currently bound object)
 Binding getBinding()
          gets the binding for this component
 BoundDelegateContainer getBoundParent()
          gets the parent container for this component
 boolean highlightOnError()
          whether or not to highlight with a red border on error
 boolean isContainer()
          whether or not this bound component is a container of other bound components
 boolean isValidated()
          whether or not a validation error has occurred
 void load()
          load the current value for this component from the bound object
 void notifyListenersOfBindingChanged()
          Notifies all listeners that the binding has changed
 void notifyListenersOfBindingChanging()
          Notifies all listeners that the binding is about to change
 void removeBindingListener(BindingListener listener)
          Remove a registered listener from this object
 void save()
          save the current value in this component to the bound object
 void setBoundParent(BoundDelegateContainer c)
          sets the parent container for this component
 void setHighlightOnError(boolean highlightOnError)
          whether or not to highlight with a red border on error
 

Method Detail

changeBinding

void changeBinding(Binding b)
change what this object is bound to (will save the current value to its currently bound object)

Parameters:
b - the new binding

changeBinding

void changeBinding(java.lang.Object newBoundItem)
change what this object is bound to (will save the current value to its currently bound object)

Parameters:
newBoundItem - the object this is bound to (contains the value to be modified as specified by varName)

changeBinding

void changeBinding(java.lang.Object newBoundItem,
                   int index)
change what this object is bound to (will save the current value to its currently bound object)

Parameters:
newBoundItem - the object this is bound to (contains the value to be modified as specified by varName)
index - the new index to bind to

changeBinding

void changeBinding(int index)
change what this object is bound to (will save the current value to its currently bound object)

Parameters:
index - the new index to bind to

changeBinding

void changeBinding(java.lang.Object boundItem,
                   java.lang.String varName)
change what this object is bound to (will save the current value to its currently bound object)

Parameters:
boundItem - the object this is bound to (contains the value to be modified as specified by varName)
varName - the name of the variable; assumes the getter and setter name will be get and set followed by varName with its first letter capitalized (ex: if varName is "value" then the getter will be getValue).

changeBinding

void changeBinding(java.lang.Object boundItem,
                   java.lang.String getterName,
                   java.lang.String setterName)
change what this object is bound to (will save the current value to its currently bound object)

Parameters:
boundItem - the object this is bound to (contains the value to be modified as specified by the getter and setter name)
getterName - how to get the bound value from the bound object
setterName - how to set the bound value from the bound object

changeBinding

void changeBinding(java.lang.Object boundItem,
                   java.lang.String getterName,
                   java.lang.String setterName,
                   int indexAt)
change what this object is bound to (will save the current value to its currently bound object)

Parameters:
boundItem - the object this is bound to (contains the value to be modified as specified by the getter and setter name)
getterName - how to get the bound value from the bound object
setterName - how to set the bound value from the bound object
indexAt - if bound value is stored within a container with get(index) and set(index, Object) methods, then indexAt should be the index to use; otherwise, indexAt should be -1

load

void load()
load the current value for this component from the bound object


save

void save()
save the current value in this component to the bound object


addBindingListener

void addBindingListener(BindingListener listener)
Register a listener for this object

Parameters:
listener - the object which is listening

notifyListenersOfBindingChanging

void notifyListenersOfBindingChanging()
Notifies all listeners that the binding is about to change


notifyListenersOfBindingChanged

void notifyListenersOfBindingChanged()
Notifies all listeners that the binding has changed


removeBindingListener

void removeBindingListener(BindingListener listener)
Remove a registered listener from this object

Parameters:
listener - the object which is listening to be removed

getBinding

Binding getBinding()
gets the binding for this component


getBoundParent

BoundDelegateContainer getBoundParent()
gets the parent container for this component


setBoundParent

void setBoundParent(BoundDelegateContainer c)
sets the parent container for this component


isContainer

boolean isContainer()
whether or not this bound component is a container of other bound components


isValidated

boolean isValidated()
whether or not a validation error has occurred


highlightOnError

boolean highlightOnError()
whether or not to highlight with a red border on error


setHighlightOnError

void setHighlightOnError(boolean highlightOnError)
whether or not to highlight with a red border on error