D
- the kind of object that represents a Dockable
P
- the kind of data a subclass handlespublic abstract class PlaceholderListItemAdapter<D,P extends PlaceholderListItem<D>> extends Object implements PlaceholderListItemConverter<D,P>
PlaceholderListItemConverter
, all methods implemented by this adapter do nothing.Constructor and Description |
---|
PlaceholderListItemAdapter() |
Modifier and Type | Method and Description |
---|---|
void |
added(P dockable)
Called as soon as the result of
PlaceholderListItemConverter.convert(ConvertedPlaceholderListItem) has been added to the list. |
P |
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,
P dockable)
Given some non-
null dockable, this method converts the element into
some data that can be stored persistently. |
public P convert(ConvertedPlaceholderListItem item)
PlaceholderListItemConverter
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.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)
.convert
in interface PlaceholderListItemConverter<D,P extends PlaceholderListItem<D>>
item
- the item to readnull
public ConvertedPlaceholderListItem convert(int index, P dockable)
PlaceholderListItemConverter
null
dockable, this method converts the element into
some data that can be stored persistently.convert
in interface PlaceholderListItemConverter<D,P extends PlaceholderListItem<D>>
index
- the index of dockable
in the dockables-list
dockable
- the element to storenull
to indicate that this element
should not be storedpublic void added(P dockable)
PlaceholderListItemConverter
PlaceholderListItemConverter.convert(ConvertedPlaceholderListItem)
has been added to the list.added
in interface PlaceholderListItemConverter<D,P extends PlaceholderListItem<D>>
dockable
- the added element, not null