bibliothek.gui.dock.frontend
Interface MissingDockableStrategy


public interface MissingDockableStrategy

Used by the DockFrontend to handle missing Dockables. The methods of this interface are called to find out, for which missing Dockable information should be stored, and for which not.

Author:
Benjamin Sigg

Field Summary
static MissingDockableStrategy DISCARD_ALL
          This strategy throws away all information.
static MissingDockableStrategy STORE_ALL
          This strategy stores all information.
 
Method Summary
<L> boolean
shouldCreate(DockFactory<?,?,L> factory, L data)
          Tells whether factory should be used to create a new Dockable using data.
 boolean shouldStoreHidden(String key)
          Tells whether the location of the hidden and missing Dockable key should be stored anyway.
 boolean shouldStoreShown(String key)
          Tells whether the location of the shown but missing Dockable key should be stored anyway.
 

Field Detail

DISCARD_ALL

static final MissingDockableStrategy DISCARD_ALL
This strategy throws away all information.


STORE_ALL

static final MissingDockableStrategy STORE_ALL
This strategy stores all information.

Method Detail

shouldStoreHidden

boolean shouldStoreHidden(String key)
Tells whether the location of the hidden and missing Dockable key should be stored anyway. A DockFrontend will create an empty info for all keys which pass this method.

Parameters:
key - the name of a missing element
Returns:
true if its location should be stored for the case that it becomes known later, or false if its location should be discarded

shouldStoreShown

boolean shouldStoreShown(String key)
Tells whether the location of the shown but missing Dockable key should be stored anyway. A DockFrontend will create an empty info for all keys which pass this method.

Parameters:
key - the name of a missing element
Returns:
true if its location should be stored for the case that it becomes known later, or false if its location should be discarded

shouldCreate

<L> boolean shouldCreate(DockFactory<?,?,L> factory,
                         L data)
Tells whether factory should be used to create a new Dockable using data. This method is only called when the element would be created outside the normal setup phase, i.e. when a new factory has become known and old data is revisited.

Type Parameters:
L - the kind of data to use for factory
Parameters:
factory - the factory which might create new elements
data - the information factory would convert
Returns:
true if factory is allowed to convert data