bibliothek.gui.dock.station.toolbar.group
Interface ToolbarColumnModel<D,P>

Type Parameters:
D - the dockable class itself
P - the wrapper used to describe a Dockable

@FrameworkOnly
public interface ToolbarColumnModel<D,P>

The ToolbarColumnModel provides a clearly defined way to access and monitor the columns of a ToolbarGroupDockStation. The model acts as facade for the real datastructures inside ToolbarGroupDockStation, which are usually not accessible.
The model does not offer any information that could not be retrieved through the methods of DockablePlaceholderToolbarGrid, but it offers an API to register observers and be notified about changes within the columns.
Clients should not implement this interface.

Author:
Benjamin Sigg

Method Summary
 void addListener(ToolbarColumnModelListener<D,P> listener)
          Adds the observer listener to this model.
 ToolbarColumn<D,P> getColumn(bibliothek.gui.Dockable dockable)
          Searches the column which contains dockable.
 ToolbarColumn<D,P> getColumn(int index)
          Gets the index'th column of this model.
 int getColumnCount()
          Gets the total number of columns that are currently available.
 void removeListener(ToolbarColumnModelListener<D,P> listener)
          Removes the observer listener from this model.
 

Method Detail

getColumnCount

int getColumnCount()
Gets the total number of columns that are currently available.

Returns:
the total number of columns

getColumn

ToolbarColumn<D,P> getColumn(int index)
Gets the index'th column of this model.

Parameters:
index - the index of the column
Returns:
the column, not null
Throws:
IllegalArgumentException - if index is not within the boundaries

getColumn

ToolbarColumn<D,P> getColumn(bibliothek.gui.Dockable dockable)
Searches the column which contains dockable.

Parameters:
dockable - the item to search
Returns:
the column containing dockable or null if not found

addListener

void addListener(ToolbarColumnModelListener<D,P> listener)
Adds the observer listener to this model.

Parameters:
listener - the new observer, not null

removeListener

void removeListener(ToolbarColumnModelListener<D,P> listener)
Removes the observer listener from this model.

Parameters:
listener - the observer to remove