Class BindingGroup

java.lang.Object
org.jdesktop.beansbinding.BindingGroup

public class BindingGroup extends Object
BindingGroup allows you to create a group of Bindings and operate on and/or track state changes to the Bindings as a group.
  • Constructor Details

    • BindingGroup

      public BindingGroup()
      Creates an empty BindingGroup.
  • Method Details

    • addBinding

      public final void addBinding(Binding binding)
      Adds a Binding to this group.
      Parameters:
      binding - the Binding 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

      public final void removeBinding(Binding binding)
      Removes a Binding from this group.
      Parameters:
      binding - the Binding to remove
      Throws:
      IllegalArgumentException - if the binding is null or if the group doesn't contain this binding
    • getBinding

      public final Binding getBinding(String name)
      Returns the Binding in this group with the given name, or null if this group doesn't contain a Binding with the given name.
      Parameters:
      name - the name of the Binding to fetch
      Returns:
      the Binding in this group with the given name, or null
      Throws:
      IllegalArgumentException - if name is null
    • getBindings

      public final List<Binding> getBindings()
      Returns a list of all Bindings in this group. Order is undefined. Returns an empty list if the group contains no Bindings.
      Returns:
      a list of all Bindings in this group.
    • bind

      public void bind()
      Calls bind on all unbound bindings in the group.
    • unbind

      public void unbind()
      Calls unbind on all bound bindings in the group.
    • addBindingListener

      public final void addBindingListener(BindingListener listener)
      Adds a BindingListener to be notified of all BindingListener notifications fired by any Binding in the group. Does nothing if the listener is null. 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 a BindingListener from the group. Does nothing if the listener is null 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

      public final BindingListener[] getBindingListeners()
      Returns the list of BindingListeners 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: