bibliothek.gui.dock.accept
Class MultiDockAcceptance

java.lang.Object
  extended by bibliothek.gui.dock.accept.MultiDockAcceptance
All Implemented Interfaces:
DockAcceptance

public class MultiDockAcceptance
extends java.lang.Object
implements DockAcceptance

A DockAcceptance which consists of other acceptances, and returns only true if all children of this acceptance return true.

Author:
Benjamin Sigg

Field Summary
private  java.util.List<DockAcceptance> acceptances
           
 
Constructor Summary
MultiDockAcceptance()
           
 
Method Summary
 boolean accept(DockStation parent, Dockable child)
          Tells whether or not child is allowed to become a real child of parent.
 boolean accept(DockStation parent, Dockable child, Dockable next)
          Tells whether child, which may be already a child of parent, and next are allowed to be combined.
 void add(DockAcceptance acceptance)
          Adds a DockAcceptance to the list of acceptances, which must be asked, before an accept-method returns true.
 void remove(DockAcceptance acceptance)
          Removes a DockAcceptance which was earlier added to this MultiDockAcceptance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

acceptances

private java.util.List<DockAcceptance> acceptances
Constructor Detail

MultiDockAcceptance

public MultiDockAcceptance()
Method Detail

add

public void add(DockAcceptance acceptance)
Adds a DockAcceptance to the list of acceptances, which must be asked, before an accept-method returns true.

Parameters:
acceptance - the acceptance to ask

remove

public void remove(DockAcceptance acceptance)
Removes a DockAcceptance which was earlier added to this MultiDockAcceptance.

Parameters:
acceptance - the acceptance to remove

accept

public boolean accept(DockStation parent,
                      Dockable child)
Description copied from interface: DockAcceptance
Tells whether or not child is allowed to become a real child of parent.

Specified by:
accept in interface DockAcceptance
Parameters:
parent - the future parent
child - the future child
Returns:
whether or not child and parent are allowed to be combined

accept

public boolean accept(DockStation parent,
                      Dockable child,
                      Dockable next)
Description copied from interface: DockAcceptance
Tells whether child, which may be already a child of parent, and next are allowed to be combined. The result of this combination would replace child on parent.

Specified by:
accept in interface DockAcceptance
Parameters:
parent - the future parent of the combination
child - a Dockable which may be a child of parent
next - a new Dockable
Returns:
whether the combination is allowed or not