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 void
addBinding
(Binding binding) Adds aBinding
to this group.final void
addBindingListener
(BindingListener listener) Adds aBindingListener
to be notified of allBindingListener
notifications fired by anyBinding
in the group.void
bind()
Callsbind
on all unbound bindings in the group.final Binding
getBinding
(String name) Returns theBinding
in this group with the given name, ornull
if this group doesn't contain aBinding
with the given name.final BindingListener[]
Returns the list ofBindingListeners
registered on this group.Returns a list of allBindings
in this group.final void
removeBinding
(Binding binding) Removes aBinding
from this group.final void
removeBindingListener
(BindingListener listener) Removes aBindingListener
from the group.void
unbind()
Callsunbind
on all bound bindings in the group.
-
Constructor Details
-
BindingGroup
public BindingGroup()Creates an emptyBindingGroup
.
-
-
Method Details
-
addBinding
Adds aBinding
to this group.- Parameters:
binding
- theBinding
to 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 aBinding
from this group.- Parameters:
binding
- theBinding
to remove- Throws:
IllegalArgumentException
- if the binding is null or if the group doesn't contain this binding
-
getBinding
Returns theBinding
in this group with the given name, ornull
if this group doesn't contain aBinding
with the given name.- Parameters:
name
- the name of theBinding
to fetch- Returns:
- the
Binding
in this group with the given name, ornull
- Throws:
IllegalArgumentException
- ifname
isnull
-
getBindings
Returns a list of allBindings
in this group. Order is undefined. Returns an empty list if the group contains noBindings
.- Returns:
- a list of all
Bindings
in this group.
-
bind
public void bind()Callsbind
on all unbound bindings in the group. -
unbind
public void unbind()Callsunbind
on all bound bindings in the group. -
addBindingListener
Adds aBindingListener
to be notified of allBindingListener
notifications fired by anyBinding
in 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 aBindingListener
from the group. Does nothing if the listener isnull
or 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 ofBindingListeners
registered on this group. Order is undefined. Returns an empty array if there are no listeners.- Returns:
- the list of
BindingListeners
registered on this group - See Also:
-