com.aelitis.azureus.ui.common.table.impl
Class TableColumnManager

java.lang.Object
  extended by com.aelitis.azureus.ui.common.table.impl.TableColumnManager

public class TableColumnManager
extends java.lang.Object

Holds a list of column definitions (TableColumnCore) for all the tables in Azureus. Column definitions are added via PluginInterface.addColumn(TableColumn) See Use javadoc section for more uses.

Author:
Oliver (Original Code), TuxPaper (Modifications to make generic & comments)

Method Summary
 void addColumns(TableColumnCore[] itemsToAdd)
          Adds a column definition to the list
 java.lang.String[] appendLists(java.lang.String[] list1, java.lang.String[] list2)
           
 void ensureIntegrety(java.lang.Class dataSourceType, java.lang.String sTableID)
           
 void generateDiagnostics(IndentWriter writer)
           
 TableColumnCore[] getAllTableColumnCoreAsArray(java.lang.Class forDataSourceType, java.lang.String tableID)
           
 java.util.List getAutoHideOrder(java.lang.String sTableID)
           
 java.lang.Object getColumnData(java.lang.String columnID, java.lang.String key)
           
 TableColumnInfo getColumnInfo(java.lang.Class forDataSourceType, java.lang.String forTableID, java.lang.String columnID)
           
 TableColumnInfo getColumnInfo(TableColumnCore column)
           
 java.lang.String[] getDefaultColumnNames(java.lang.String tableID)
           
 java.lang.String getDefaultSortColumnName(java.lang.String tableID)
           
static TableColumnManager getInstance()
          Retrieve the static TableColumnManager instance
 TableColumnCore getTableColumnCore(java.lang.String sTableID, java.lang.String sColumnName)
           
 int getTableColumnCount(java.lang.String sTableID)
           
static java.util.Comparator<TableColumn> getTableColumnOrderComparator()
           
 java.util.Map<java.lang.String,TableColumnCore> getTableColumnsAsMap(java.lang.Class forDataSourceType, java.lang.String sTableID)
          Retrieves TableColumnCore objects of a particular type.
 java.util.Map getTableConfigMap(java.lang.String sTableID)
           
 java.lang.String[] getTableIDs()
           
 boolean loadTableColumnSettings(java.lang.Class forDataSourceType, java.lang.String sTableID)
           
 void registerColumn(java.lang.Class forDataSourceType, java.lang.String columnID, TableColumnCreationListener listener)
           
 void removeColumnData(java.lang.String columnID, java.lang.String key)
           
 void removeColumns(TableColumnCore[] itemsToRemove)
          Adds a column definition to the list
 void resetColumns(java.lang.Class dataSourceType, java.lang.String tableID)
           
 void saveTableColumns(java.lang.Class forDataSourceType, java.lang.String sTableID)
          Saves all the user configurable Table Column settings at once, complete with a COConfigurationManager.save().
 void setAutoHideOrder(java.lang.String sTableID, java.lang.String[] autoHideOrderColumnIDs)
           
 void setColumnData(java.lang.String columnID, java.lang.String key, java.lang.Object value)
           
 void setDefaultColumnNames(java.lang.String tableID, java.lang.String[] columnNames)
           
 void setDefaultColumnNames(java.lang.String tableID, TableColumn[] columns)
           
 void setDefaultSortColumnName(java.lang.String tableID, java.lang.String columnName)
           
 void setDefaultSortColumnName(java.lang.String tableID, java.lang.String columnName, boolean force)
           
 void unregisterColumn(java.lang.Class forDataSourceType, java.lang.String columnID, TableColumnCreationListener listener)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static TableColumnManager getInstance()
Retrieve the static TableColumnManager instance

Returns:
the static TableColumnManager instance

addColumns

public void addColumns(TableColumnCore[] itemsToAdd)
Adds a column definition to the list

Parameters:
item - The column definition object

removeColumns

public void removeColumns(TableColumnCore[] itemsToRemove)
Adds a column definition to the list

Parameters:
item - The column definition object

getTableColumnsAsMap

public java.util.Map<java.lang.String,TableColumnCore> getTableColumnsAsMap(java.lang.Class forDataSourceType,
                                                                            java.lang.String sTableID)
Retrieves TableColumnCore objects of a particular type.

Parameters:
sTableID - TABLE_* constant. See TableColumn for list of constants
forDataSourceType -
Returns:
Map of column definition objects matching the supplied criteria. key = name value = TableColumnCore object

getTableColumnCount

public int getTableColumnCount(java.lang.String sTableID)

getAllTableColumnCoreAsArray

public TableColumnCore[] getAllTableColumnCoreAsArray(java.lang.Class forDataSourceType,
                                                      java.lang.String tableID)

getDefaultColumnNames

public java.lang.String[] getDefaultColumnNames(java.lang.String tableID)

setDefaultColumnNames

public void setDefaultColumnNames(java.lang.String tableID,
                                  TableColumn[] columns)

setDefaultColumnNames

public void setDefaultColumnNames(java.lang.String tableID,
                                  java.lang.String[] columnNames)

getTableIDs

public java.lang.String[] getTableIDs()

appendLists

public java.lang.String[] appendLists(java.lang.String[] list1,
                                      java.lang.String[] list2)

getTableColumnCore

public TableColumnCore getTableColumnCore(java.lang.String sTableID,
                                          java.lang.String sColumnName)

ensureIntegrety

public void ensureIntegrety(java.lang.Class dataSourceType,
                            java.lang.String sTableID)

getDefaultSortColumnName

public java.lang.String getDefaultSortColumnName(java.lang.String tableID)

setDefaultSortColumnName

public void setDefaultSortColumnName(java.lang.String tableID,
                                     java.lang.String columnName)

setDefaultSortColumnName

public void setDefaultSortColumnName(java.lang.String tableID,
                                     java.lang.String columnName,
                                     boolean force)

saveTableColumns

public void saveTableColumns(java.lang.Class forDataSourceType,
                             java.lang.String sTableID)
Saves all the user configurable Table Column settings at once, complete with a COConfigurationManager.save().

Parameters:
sTableID - Table to save settings for

loadTableColumnSettings

public boolean loadTableColumnSettings(java.lang.Class forDataSourceType,
                                       java.lang.String sTableID)

getTableConfigMap

public java.util.Map getTableConfigMap(java.lang.String sTableID)

setAutoHideOrder

public void setAutoHideOrder(java.lang.String sTableID,
                             java.lang.String[] autoHideOrderColumnIDs)

getAutoHideOrder

public java.util.List getAutoHideOrder(java.lang.String sTableID)

generateDiagnostics

public void generateDiagnostics(IndentWriter writer)
Parameters:
writer -

getTableColumnOrderComparator

public static java.util.Comparator<TableColumn> getTableColumnOrderComparator()

registerColumn

public void registerColumn(java.lang.Class forDataSourceType,
                           java.lang.String columnID,
                           TableColumnCreationListener listener)
Parameters:
forDataSourceType -
columnID -
listener -
Since:
3.1.1.1

unregisterColumn

public void unregisterColumn(java.lang.Class forDataSourceType,
                             java.lang.String columnID,
                             TableColumnCreationListener listener)

getColumnInfo

public TableColumnInfo getColumnInfo(java.lang.Class forDataSourceType,
                                     java.lang.String forTableID,
                                     java.lang.String columnID)

getColumnInfo

public TableColumnInfo getColumnInfo(TableColumnCore column)

getColumnData

public java.lang.Object getColumnData(java.lang.String columnID,
                                      java.lang.String key)

setColumnData

public void setColumnData(java.lang.String columnID,
                          java.lang.String key,
                          java.lang.Object value)

removeColumnData

public void removeColumnData(java.lang.String columnID,
                             java.lang.String key)

resetColumns

public void resetColumns(java.lang.Class dataSourceType,
                         java.lang.String tableID)