bibliothek.gui.dock.common
Interface MissingCDockableStrategy


public interface MissingCDockableStrategy

A strategy that tells what to do if CControl finds a description of a CDockable that it does not know while reading a layout.

Author:
Benjamin Sigg

Field Summary
static MissingCDockableStrategy PURGE
          A strategy that will always throw away information.
static MissingCDockableStrategy SINGLE
          A strategy that will always throw away information for MultipleCDockables but store information for SingleCDockable.
static MissingCDockableStrategy STORE
          A strategy that will always store any information
 
Method Summary
 boolean shouldCreate(String id, MultipleCDockableFactory<?,?> factory)
          Tells whether the factory factory should be used to create MultipleCDockables for which location information is available.
<L extends MultipleCDockableLayout>
boolean
shouldCreate(String id, MultipleCDockableFactory<?,L> factory, String uniqueId, L data)
          Tells whether the MultipleCDockable with identifier uniqueId should automatically be created outside the normal setup-phase.
 boolean shouldStoreSingle(String id)
          Tells whether layout information for the missing SingleCDockable with identifier id should be stored.
 

Field Detail

PURGE

static final MissingCDockableStrategy PURGE
A strategy that will always throw away information.


SINGLE

static final MissingCDockableStrategy SINGLE
A strategy that will always throw away information for MultipleCDockables but store information for SingleCDockable.


STORE

static final MissingCDockableStrategy STORE
A strategy that will always store any information

Method Detail

shouldStoreSingle

boolean shouldStoreSingle(String id)
Tells whether layout information for the missing SingleCDockable with identifier id should be stored.

Parameters:
id - the identifier of the missing SingleCDockable
Returns:
true if layout information should remain available, false if the information should be purged.

shouldCreate

boolean shouldCreate(String id,
                     MultipleCDockableFactory<?,?> factory)
Tells whether the factory factory should be used to create MultipleCDockables for which location information is available.

Parameters:
id - the identifier of the factory
factory - the factory to use
Returns:
true if dockables can be restored by factory

shouldCreate

<L extends MultipleCDockableLayout> boolean shouldCreate(String id,
                                                         MultipleCDockableFactory<?,L> factory,
                                                         String uniqueId,
                                                         L data)
Tells whether the MultipleCDockable with identifier uniqueId should automatically be created outside the normal setup-phase. This method is not called when applying a new layout through the normal ways, only when factory has become available after the layout was already set.

Type Parameters:
L - the kind of data factory uses
Parameters:
id - the identifier of factory
factory - the factory which would create the new element
uniqueId - the identifier of the element that would be created
data - the data that would be given to factory to create the new element
Returns:
true if a new element should be created