org.jdesktop.swingx.treetable.TreeTableModelProvider Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of swingx-all Show documentation
Show all versions of swingx-all Show documentation
A Maven project to aggregate all modules into a single artifact.
The newest version!
/*
* Created on 11.01.2011
*
*/
package org.jdesktop.swingx.treetable;
/**
* Interface which guarantees access to a TreeTableModel. It is implemented by
* the internal TreeTableModelAdapter of JXTreeTable to allow direct access to
* the underlying TreeTableModel from the adapter.
*
*
* That's useful f.i. when trying to configure TableColumnExt in a
* ColumnFactory, like in
*
*
*
* JXTreeTable table = new JXTreeTable();
* ColumnFactory factory = new ColumnFactory() {
*
* @Override
* public void configureTableColumn(TableModel model,
* TableColumnExt columnExt) {
* super.configureTableColumn(model, columnExt);
* if (model instanceof TreeTableModelProvider) {
* TreeTableModel treeTableModel = ((TreeTableModelProvider) model).getTreeTableModel();
* if (treeTableModel.getHierarchicalColumn() == columnExt.getModelIndex()) {
* columnExt.setTitle("Hierarchical: " + columnExt.getTitle());
* }
* }
* }
* };
* table.setColumnFactory(factory);
* table.setTreeTableModel(new FileSystemModel());
*
*
*
*
* @author Jeanette Winzenburg, Berlin
*/
public interface TreeTableModelProvider {
/**
* Returns a TreeTableModel, guaranteed to be not null.
*
* @return a TreeTableModel, guaranteed to be not null.
*/
TreeTableModel getTreeTableModel();
}