Package bibliothek.gui.dock.common
Interface MultipleCDockableFactory<F extends MultipleCDockable,L extends MultipleCDockableLayout>
- Type Parameters:
F- the kind of dockable that is managed by this factoryL- the kind of meta-data this factory reads and writes aboutF
- All Known Implementing Classes:
EmptyMultipleCDockableFactory,NullMultipleCDockableFactory
public interface MultipleCDockableFactory<F extends MultipleCDockable,L extends MultipleCDockableLayout>
A factory that can create and store
MultipleCDockables. This factory
converts a MultipleCDockable in a MultipleCDockableLayout and
then writes the layout in various forms (like xml).- Author:
- Benjamin Sigg
-
Method Summary
Modifier and TypeMethodDescriptioncreate()Creates a new, empty layout.booleanTells whether the meta-datalayoutbelongs todockable, meaningwrite( dockable )would producelayoutandread( layout )would producedockable.
This method is used to create a pairing of dockables and meta-data.Creates aMultipleCDockablethat gets its layout fromlayout.Collects all the properties ofdockableand writes them into a newMultipleCDockableLayout.
-
Method Details
-
write
Collects all the properties ofdockableand writes them into a newMultipleCDockableLayout.- Parameters:
dockable- the element whose properties should be collected- Returns:
- the layout that has been written
-
read
Creates aMultipleCDockablethat gets its layout fromlayout.- Parameters:
layout- the set of properties that can be used to create the newCDockable.- Returns:
- the new dockable or
nullif the layout can't be read
-
match
Tells whether the meta-datalayoutbelongs todockable, meaningwrite( dockable )would producelayoutandread( layout )would producedockable.
This method is used to create a pairing of dockables and meta-data. Dockables without partner are most likely deleted. If a dockable or some meta-data has more than one potential partner, then one pair is randomly chosen.
This method is primarily used for optimization: assumedockableis shown or known to the view andlayouthas been read from a file. Normally all dockables produced by this factory would be removed and replaced by newly created dockables. If however this method finds a match between a layout and a dockable, then the dockable can be reused.
The second goal of this method is to help prevent unnecessary events to theCVetoClosingListenerfor dockables that just get replaced by a "clone".- Parameters:
dockable- some element that is shown or known to the viewlayout- some layout that will be applied- Returns:
trueifdockablewould be produced byread(layout).
-
create
L create()Creates a new, empty layout. The contents of the layout will be set using one of theread-methods ofMultipleCDockableLayout.- Returns:
- the new empty layout
-