Package org.jdesktop.beansbinding
Class BindingGroup
java.lang.Object
org.jdesktop.beansbinding.BindingGroup
BindingGroup allows you to create a group of Bindings
and operate on and/or track state changes to the Bindings as
a group.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidaddBinding(Binding binding) Adds aBindingto this group.final voidaddBindingListener(BindingListener listener) Adds aBindingListenerto be notified of allBindingListenernotifications fired by anyBindingin the group.voidbind()Callsbindon all unbound bindings in the group.final BindinggetBinding(String name) Returns theBindingin this group with the given name, ornullif this group doesn't contain aBindingwith the given name.final BindingListener[]Returns the list ofBindingListenersregistered on this group.Returns a list of allBindingsin this group.final voidremoveBinding(Binding binding) Removes aBindingfrom this group.final voidremoveBindingListener(BindingListener listener) Removes aBindingListenerfrom the group.voidunbind()Callsunbindon all bound bindings in the group.
-
Constructor Details
-
BindingGroup
public BindingGroup()Creates an emptyBindingGroup.
-
-
Method Details
-
addBinding
Adds aBindingto this group.- Parameters:
binding- theBindingto add- Throws:
IllegalArgumentException- if the binding is null, is a managed binding, if the group already contains this binding, or if the group already contains a binding with the same (non-null) name
-
removeBinding
Removes aBindingfrom this group.- Parameters:
binding- theBindingto remove- Throws:
IllegalArgumentException- if the binding is null or if the group doesn't contain this binding
-
getBinding
Returns theBindingin this group with the given name, ornullif this group doesn't contain aBindingwith the given name.- Parameters:
name- the name of theBindingto fetch- Returns:
- the
Bindingin this group with the given name, ornull - Throws:
IllegalArgumentException- ifnameisnull
-
getBindings
Returns a list of allBindingsin this group. Order is undefined. Returns an empty list if the group contains noBindings.- Returns:
- a list of all
Bindingsin this group.
-
bind
public void bind()Callsbindon all unbound bindings in the group. -
unbind
public void unbind()Callsunbindon all bound bindings in the group. -
addBindingListener
Adds aBindingListenerto be notified of allBindingListenernotifications fired by anyBindingin the group. Does nothing if the listener isnull. If a listener is added more than once, notifications are sent to that listener once for every time that it has been added. The ordering of listener notification is unspecified.- Parameters:
listener- the listener to add
-
removeBindingListener
Removes aBindingListenerfrom the group. Does nothing if the listener isnullor is not one of those registered. If the listener being removed was registered more than once, only one occurrence of the listener is removed from the list of listeners. The ordering of listener notification is unspecified.- Parameters:
listener- the listener to remove- See Also:
-
getBindingListeners
Returns the list ofBindingListenersregistered on this group. Order is undefined. Returns an empty array if there are no listeners.- Returns:
- the list of
BindingListenersregistered on this group - See Also:
-