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

java.lang.Object
  extended by bibliothek.gui.dock.station.support.PlaceholderListItemAdapter<D>
Type Parameters:
D - the kind of data a subclass handles
All Implemented Interfaces:
PlaceholderListItemConverter<D>
Direct Known Subclasses:
StrategyPlaceholderListItemConverter

public abstract class PlaceholderListItemAdapter<D extends PlaceholderListItem>
extends Object
implements PlaceholderListItemConverter<D>

An adapter for PlaceholderListItemConverter, all methods implemented by this adapter do nothing.

Author:
Benjamin Sigg

Constructor Summary
PlaceholderListItemAdapter()
           
 
Method Summary
 void added(D dockable)
          Called as soon as the result of PlaceholderListItemConverter.convert(ConvertedPlaceholderListItem) has been added to the list.
 D convert(ConvertedPlaceholderListItem item)
          Given some data that was written by some PlaceholderListItemConverter, this method returns the dockable that belongs to that data.
 ConvertedPlaceholderListItem convert(int index, D dockable)
          Given some non-null dockable, this method converts the element into some data that can be stored persistently.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PlaceholderListItemAdapter

public PlaceholderListItemAdapter()
Method Detail

convert

public D convert(ConvertedPlaceholderListItem item)
Description copied from interface: PlaceholderListItemConverter
Given some data that was written by some PlaceholderListItemConverter, this method returns the dockable that belongs to that data. It is the clients responsibility to ensure that the same PlaceholderListItemConverter is used for reading and writing.
The placeholder property of item will always be null, the map property may not be the same as was associated when calling PlaceholderListItemConverter.convert(int,PlaceholderListItem).

Specified by:
convert in interface PlaceholderListItemConverter<D extends PlaceholderListItem>
Parameters:
item - the item to read
Returns:
the corresponding element, 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<D extends PlaceholderListItem>
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

added

public void added(D dockable)
Description copied from interface: PlaceholderListItemConverter
Called as soon as the result of PlaceholderListItemConverter.convert(ConvertedPlaceholderListItem) has been added to the list.

Specified by:
added in interface PlaceholderListItemConverter<D extends PlaceholderListItem>
Parameters:
dockable - the added element, not null