bibliothek.gui.dock.station.toolbar.layout
Class GridPlaceholderList<D,S,P extends bibliothek.gui.dock.station.support.PlaceholderListItem<D>>

java.lang.Object
  extended by bibliothek.gui.dock.station.support.PlaceholderList<GridPlaceholderList.ColumnItem<D,S,P>,GridPlaceholderList.ColumnItem<D,S,P>,GridPlaceholderList.Column<D,S,P>>
      extended by bibliothek.gui.dock.station.toolbar.layout.GridPlaceholderList<D,S,P>
Type Parameters:
D - the kind of object that should be treated as Dockable
S - the kind of object that should be treated as DockStation
P - the type of item which represents a Dockable
Direct Known Subclasses:
DockableGridPlaceholderList, PerspectiveGridPlaceholderList

public abstract class GridPlaceholderList<D,S,P extends bibliothek.gui.dock.station.support.PlaceholderListItem<D>>
extends bibliothek.gui.dock.station.support.PlaceholderList<GridPlaceholderList.ColumnItem<D,S,P>,GridPlaceholderList.ColumnItem<D,S,P>,GridPlaceholderList.Column<D,S,P>>

This PlaceholderList stores GridPlaceholderList.Columns as items, where one GridPlaceholderList.Column is just another PlaceholderList.

Author:
Benjamin Sigg

Nested Class Summary
static interface GridPlaceholderList.Column<D,S,P extends bibliothek.gui.dock.station.support.PlaceholderListItem<D>>
          Represents one list of Dockables.
static interface GridPlaceholderList.ColumnItem<D,S,P extends bibliothek.gui.dock.station.support.PlaceholderListItem<D>>
          An class representing either a GridPlaceholderList.Column or a DockElement.
 
Nested classes/interfaces inherited from class bibliothek.gui.dock.station.support.PlaceholderList
bibliothek.gui.dock.station.support.PlaceholderList.Filter<M>, bibliothek.gui.dock.station.support.PlaceholderList.Item, bibliothek.gui.dock.station.support.PlaceholderList.Level
 
Constructor Summary
GridPlaceholderList()
           
 
Method Summary
 GridPlaceholderList.Column<D,S,P> createColumn(bibliothek.gui.dock.station.support.PlaceholderList<D,S,P> content)
          Factory method creating an new GridPlaceholderList.Column that can be added to this list.
protected  GridPlaceholderList.ColumnItem<D,S,P>[] getChildren(GridPlaceholderList.ColumnItem<D,S,P> station)
           
 bibliothek.gui.dock.station.support.PlaceholderListItemConverter<D,P> getConverter()
          Gets the converter that is used to read and write GridPlaceholderList.Columns.
protected abstract  D[] getItemChildren(S station)
          Gets all the children of station
protected abstract  bibliothek.util.Path getItemPlaceholder(D dockable)
          Gest the placeholder of dockable.
protected abstract  bibliothek.gui.dock.station.support.PlaceholderMap getItemPlaceholders(S station)
          Gets all the placeholders of station
protected  bibliothek.util.Path getPlaceholder(GridPlaceholderList.ColumnItem<D,S,P> dockable)
           
protected  bibliothek.gui.dock.station.support.PlaceholderMap getPlaceholders(GridPlaceholderList.ColumnItem<D,S,P> station)
           
protected abstract  S itemToStation(D dockable)
          Converts the item dockable to a station.
 void setConverter(bibliothek.gui.dock.station.support.PlaceholderListItemConverter<D,P> converter)
          Sets the PlaceholderListItemConverter which should be used to convert the interal lists of this grid.
protected abstract  void setItemPlaceholders(S station, bibliothek.gui.dock.station.support.PlaceholderMap map)
          Sets the placeholders that are to be used by station
protected  void setPlaceholders(GridPlaceholderList.ColumnItem<D,S,P> station, bibliothek.gui.dock.station.support.PlaceholderMap map)
           
protected  GridPlaceholderList.ColumnItem<D,S,P> toStation(GridPlaceholderList.ColumnItem<D,S,P> dockable)
           
protected  String toString(GridPlaceholderList.ColumnItem<D,S,P> dockable)
           
 
Methods inherited from class bibliothek.gui.dock.station.support.PlaceholderList
addPlaceholder, baseToLevel, bind, clear, dockables, getDockableAt, getDockableIndex, getItem, getItem, getListIndex, getListIndex, getMap, getMetaMap, getNextListIndex, getStrategy, hasPlaceholder, insertAllPlaceholders, levelToBase, list, listPlaceholders, purePlaceholders, put, put, read, read, remove, remove, removeAll, removeAll, setStrategy, size, toMap, toString, unbind
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GridPlaceholderList

public GridPlaceholderList()
Method Detail

createColumn

public GridPlaceholderList.Column<D,S,P> createColumn(bibliothek.gui.dock.station.support.PlaceholderList<D,S,P> content)
Factory method creating an new GridPlaceholderList.Column that can be added to this list.

Parameters:
content - the content of the column, not null
Returns:
a new, empty column that is yet unknown to this list

setConverter

public void setConverter(bibliothek.gui.dock.station.support.PlaceholderListItemConverter<D,P> converter)
Sets the PlaceholderListItemConverter which should be used to convert the interal lists of this grid.

Parameters:
converter - the converter to use, can be null

getConverter

public bibliothek.gui.dock.station.support.PlaceholderListItemConverter<D,P> getConverter()
Gets the converter that is used to read and write GridPlaceholderList.Columns.

Returns:
the converer, never null

getPlaceholder

protected bibliothek.util.Path getPlaceholder(GridPlaceholderList.ColumnItem<D,S,P> dockable)
Specified by:
getPlaceholder in class bibliothek.gui.dock.station.support.PlaceholderList<GridPlaceholderList.ColumnItem<D,S,P extends bibliothek.gui.dock.station.support.PlaceholderListItem<D>>,GridPlaceholderList.ColumnItem<D,S,P extends bibliothek.gui.dock.station.support.PlaceholderListItem<D>>,GridPlaceholderList.Column<D,S,P extends bibliothek.gui.dock.station.support.PlaceholderListItem<D>>>

toString

protected String toString(GridPlaceholderList.ColumnItem<D,S,P> dockable)
Specified by:
toString in class bibliothek.gui.dock.station.support.PlaceholderList<GridPlaceholderList.ColumnItem<D,S,P extends bibliothek.gui.dock.station.support.PlaceholderListItem<D>>,GridPlaceholderList.ColumnItem<D,S,P extends bibliothek.gui.dock.station.support.PlaceholderListItem<D>>,GridPlaceholderList.Column<D,S,P extends bibliothek.gui.dock.station.support.PlaceholderListItem<D>>>

toStation

protected GridPlaceholderList.ColumnItem<D,S,P> toStation(GridPlaceholderList.ColumnItem<D,S,P> dockable)
Specified by:
toStation in class bibliothek.gui.dock.station.support.PlaceholderList<GridPlaceholderList.ColumnItem<D,S,P extends bibliothek.gui.dock.station.support.PlaceholderListItem<D>>,GridPlaceholderList.ColumnItem<D,S,P extends bibliothek.gui.dock.station.support.PlaceholderListItem<D>>,GridPlaceholderList.Column<D,S,P extends bibliothek.gui.dock.station.support.PlaceholderListItem<D>>>

getPlaceholders

protected bibliothek.gui.dock.station.support.PlaceholderMap getPlaceholders(GridPlaceholderList.ColumnItem<D,S,P> station)
Specified by:
getPlaceholders in class bibliothek.gui.dock.station.support.PlaceholderList<GridPlaceholderList.ColumnItem<D,S,P extends bibliothek.gui.dock.station.support.PlaceholderListItem<D>>,GridPlaceholderList.ColumnItem<D,S,P extends bibliothek.gui.dock.station.support.PlaceholderListItem<D>>,GridPlaceholderList.Column<D,S,P extends bibliothek.gui.dock.station.support.PlaceholderListItem<D>>>

setPlaceholders

protected void setPlaceholders(GridPlaceholderList.ColumnItem<D,S,P> station,
                               bibliothek.gui.dock.station.support.PlaceholderMap map)
Specified by:
setPlaceholders in class bibliothek.gui.dock.station.support.PlaceholderList<GridPlaceholderList.ColumnItem<D,S,P extends bibliothek.gui.dock.station.support.PlaceholderListItem<D>>,GridPlaceholderList.ColumnItem<D,S,P extends bibliothek.gui.dock.station.support.PlaceholderListItem<D>>,GridPlaceholderList.Column<D,S,P extends bibliothek.gui.dock.station.support.PlaceholderListItem<D>>>

getChildren

protected GridPlaceholderList.ColumnItem<D,S,P>[] getChildren(GridPlaceholderList.ColumnItem<D,S,P> station)
Specified by:
getChildren in class bibliothek.gui.dock.station.support.PlaceholderList<GridPlaceholderList.ColumnItem<D,S,P extends bibliothek.gui.dock.station.support.PlaceholderListItem<D>>,GridPlaceholderList.ColumnItem<D,S,P extends bibliothek.gui.dock.station.support.PlaceholderListItem<D>>,GridPlaceholderList.Column<D,S,P extends bibliothek.gui.dock.station.support.PlaceholderListItem<D>>>

itemToStation

protected abstract S itemToStation(D dockable)
Converts the item dockable to a station.

Parameters:
dockable - the item to convert
Returns:
the converted item or null

getItemChildren

protected abstract D[] getItemChildren(S station)
Gets all the children of station

Parameters:
station - the station whose children are searched
Returns:
all the children

getItemPlaceholder

protected abstract bibliothek.util.Path getItemPlaceholder(D dockable)
Gest the placeholder of dockable.

Parameters:
dockable - some element of this grid
Returns:
the placeholder or null

getItemPlaceholders

protected abstract bibliothek.gui.dock.station.support.PlaceholderMap getItemPlaceholders(S station)
Gets all the placeholders of station

Parameters:
station - some station
Returns:
all the placeholders, can be null

setItemPlaceholders

protected abstract void setItemPlaceholders(S station,
                                            bibliothek.gui.dock.station.support.PlaceholderMap map)
Sets the placeholders that are to be used by station

Parameters:
station - the station whose layout is to be updated
map - the new placeholders, never null