bibliothek.gui.dock.station.toolbar.group.ToolbarColumnModel Maven / Gradle / Ivy
/*
* Bibliothek - DockingFrames
* Library built on Java/Swing, allows the user to "drag and drop"
* panels containing any Swing-Component the developer likes to add.
*
* Copyright (C) 2012 Herve Guillaume, Benjamin Sigg
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Herve Guillaume
* [email protected]
* FR - France
*
* Benjamin Sigg
* [email protected]
* CH - Switzerland
*/
package bibliothek.gui.dock.station.toolbar.group;
import bibliothek.gui.Dockable;
import bibliothek.gui.dock.ToolbarGroupDockStation;
import bibliothek.gui.dock.station.toolbar.layout.DockablePlaceholderToolbarGrid;
import bibliothek.util.FrameworkOnly;
/**
* The {@link ToolbarColumnModel} provides a clearly defined way to access and monitor the columns of a
* {@link ToolbarGroupDockStation}. The model acts as facade for the real datastructures inside
* {@link ToolbarGroupDockStation}, which are usually not accessible.
* The model does not offer any information that could not be retrieved through the methods of {@link 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
* @param the dockable class itself
* @param the wrapper used to describe a {@link Dockable}
*/
@FrameworkOnly
public interface ToolbarColumnModel {
/**
* Gets the total number of columns that are currently available.
* @return the total number of columns
*/
public int getColumnCount();
/**
* Gets the index
'th column of this model.
* @param index the index of the column
* @return the column, not null
* @throws IllegalArgumentException if index
is not within the boundaries
*/
public ToolbarColumn getColumn( int index );
/**
* Searches the column which contains dockable
.
* @param dockable the item to search
* @return the column containing dockable
or null
if not found
*/
public ToolbarColumn getColumn( D dockable );
/**
* Adds the observer listener
to this model.
* @param listener the new observer, not null
*/
public void addListener( ToolbarColumnModelListener listener );
/**
* Removes the observer listener
from this model.
* @param listener the observer to remove
*/
public void removeListener( ToolbarColumnModelListener listener );
}