bibliothek.gui.dock.station.support
Class StrategyPlaceholderListItemConverter<D extends PlaceholderListItem<Dockable>>

java.lang.Object
  extended by bibliothek.gui.dock.station.support.PlaceholderListItemAdapter<Dockable,D>
      extended by bibliothek.gui.dock.station.support.StrategyPlaceholderListItemConverter<D>
Type Parameters:
D - the kind of item this converter is used for
All Implemented Interfaces:
PlaceholderListItemConverter<Dockable,D>

public class StrategyPlaceholderListItemConverter<D extends PlaceholderListItem<Dockable>>
extends PlaceholderListItemAdapter<Dockable,D>

This converter uses a PlaceholderStrategy to create new placeholders, but does not convert placeholders back to dockables.

Author:
Benjamin Sigg

Constructor Summary
StrategyPlaceholderListItemConverter(PlaceholderStrategy strategy)
          Creates a new converter
 
Method Summary
 ConvertedPlaceholderListItem convert(int index, D dockable)
          Given some non-null dockable, this method converts the element into some data that can be stored persistently.
 PlaceholderStrategy getStrategy()
          Gets the strategy that is used for creating placeholders.
 
Methods inherited from class bibliothek.gui.dock.station.support.PlaceholderListItemAdapter
added, convert
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StrategyPlaceholderListItemConverter

public StrategyPlaceholderListItemConverter(PlaceholderStrategy strategy)
Creates a new converter

Parameters:
strategy - the strategy to create placeholders, can be null
Method Detail

getStrategy

public PlaceholderStrategy getStrategy()
Gets the strategy that is used for creating placeholders.

Returns:
the strategy, can be null

convert

public ConvertedPlaceholderListItem convert(int index,
                                            D dockable)
Description copied from interface: PlaceholderListItemConverter
Given some non-null dockable, this method converts the element into some data that can be stored persistently.

Specified by:
convert in interface PlaceholderListItemConverter<Dockable,D extends PlaceholderListItem<Dockable>>
Overrides:
convert in class PlaceholderListItemAdapter<Dockable,D extends PlaceholderListItem<Dockable>>
Parameters:
index - the index of dockable in the dockables-list
dockable - the element to store
Returns:
the converted item, can be null to indicate that this element should not be stored