Package org.jdesktop.beansbinding
Class BindingGroup
- java.lang.Object
-
- org.jdesktop.beansbinding.BindingGroup
-
public class BindingGroup extends java.lang.Object
BindingGroup
allows you to create a group ofBindings
and operate on and/or track state changes to theBindings
as a group.
-
-
Constructor Summary
Constructors Constructor Description BindingGroup()
Creates an emptyBindingGroup
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addBinding(Binding binding)
Adds aBinding
to this group.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.Binding
getBinding(java.lang.String name)
Returns theBinding
in this group with the given name, ornull
if this group doesn't contain aBinding
with the given name.BindingListener[]
getBindingListeners()
Returns the list ofBindingListeners
registered on this group.java.util.List<Binding>
getBindings()
Returns a list of allBindings
in this group.void
removeBinding(Binding binding)
Removes aBinding
from this group.void
removeBindingListener(BindingListener listener)
Removes aBindingListener
from the group.void
unbind()
Callsunbind
on all bound bindings in the group.
-
-
-
Method Detail
-
addBinding
public final void addBinding(Binding binding)
Adds aBinding
to this group.- Parameters:
binding
- theBinding
to add- Throws:
java.lang.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
public final void removeBinding(Binding binding)
Removes aBinding
from this group.- Parameters:
binding
- theBinding
to remove- Throws:
java.lang.IllegalArgumentException
- if the binding is null or if the group doesn't contain this binding
-
getBinding
public final Binding getBinding(java.lang.String name)
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:
java.lang.IllegalArgumentException
- ifname
isnull
-
getBindings
public final java.util.List<Binding> 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
public final void addBindingListener(BindingListener listener)
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
public final void removeBindingListener(BindingListener listener)
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:
addBindingListener(org.jdesktop.beansbinding.BindingListener)
-
getBindingListeners
public final BindingListener[] 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:
addBindingListener(org.jdesktop.beansbinding.BindingListener)
-
-