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 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
 String[] appendLists(String[] list1, String[] list2)
           
 void ensureIntegrety(Class dataSourceType, String sTableID)
           
 void generateDiagnostics(IndentWriter writer)
           
 TableColumnCore[] getAllTableColumnCoreAsArray(Class forDataSourceType, String tableID)
           
 List getAutoHideOrder(String sTableID)
           
 Object getColumnData(String columnID, String key)
           
 TableColumnInfo getColumnInfo(Class forDataSourceType, String forTableID, String columnID)
           
 TableColumnInfo getColumnInfo(TableColumnCore column)
           
 String[] getDefaultColumnNames(String tableID)
           
 String getDefaultSortColumnName(String tableID)
           
static TableColumnManager getInstance()
          Retrieve the static TableColumnManager instance
 TableColumnCore getTableColumnCore(String sTableID, String sColumnName)
           
 int getTableColumnCount(String sTableID)
           
static Comparator<TableColumn> getTableColumnOrderComparator()
           
 Map<String,TableColumnCore> getTableColumnsAsMap(Class forDataSourceType, String sTableID)
          Retrieves TableColumnCore objects of a particular type.
 Map getTableConfigMap(String sTableID)
           
 String[] getTableIDs()
           
 boolean loadTableColumnSettings(Class forDataSourceType, String sTableID)
           
 void registerColumn(Class forDataSourceType, String columnID, TableColumnCreationListener listener)
           
 void removeColumnData(String columnID, String key)
           
 void removeColumns(TableColumnCore[] itemsToRemove)
          Adds a column definition to the list
 void resetColumns(Class dataSourceType, String tableID)
           
 void saveTableColumns(Class forDataSourceType, String sTableID)
          Saves all the user configurable Table Column settings at once, complete with a COConfigurationManager.save().
 void setAutoHideOrder(String sTableID, String[] autoHideOrderColumnIDs)
           
 void setColumnData(String columnID, String key, Object value)
           
 void setDefaultColumnNames(String tableID, String[] columnNames)
           
 void setDefaultColumnNames(String tableID, TableColumn[] columns)
           
 void setDefaultSortColumnName(String tableID, String columnName)
           
 void setDefaultSortColumnName(String tableID, String columnName, boolean force)
           
 void unregisterColumn(Class forDataSourceType, 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 Map<String,TableColumnCore> getTableColumnsAsMap(Class forDataSourceType,
                                                        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(String sTableID)

getAllTableColumnCoreAsArray

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

getDefaultColumnNames

public String[] getDefaultColumnNames(String tableID)

setDefaultColumnNames

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

setDefaultColumnNames

public void setDefaultColumnNames(String tableID,
                                  String[] columnNames)

getTableIDs

public String[] getTableIDs()

appendLists

public String[] appendLists(String[] list1,
                            String[] list2)

getTableColumnCore

public TableColumnCore getTableColumnCore(String sTableID,
                                          String sColumnName)

ensureIntegrety

public void ensureIntegrety(Class dataSourceType,
                            String sTableID)

getDefaultSortColumnName

public String getDefaultSortColumnName(String tableID)

setDefaultSortColumnName

public void setDefaultSortColumnName(String tableID,
                                     String columnName)

setDefaultSortColumnName

public void setDefaultSortColumnName(String tableID,
                                     String columnName,
                                     boolean force)

saveTableColumns

public void saveTableColumns(Class forDataSourceType,
                             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(Class forDataSourceType,
                                       String sTableID)

getTableConfigMap

public Map getTableConfigMap(String sTableID)

setAutoHideOrder

public void setAutoHideOrder(String sTableID,
                             String[] autoHideOrderColumnIDs)

getAutoHideOrder

public List getAutoHideOrder(String sTableID)

generateDiagnostics

public void generateDiagnostics(IndentWriter writer)
Parameters:
writer -

getTableColumnOrderComparator

public static Comparator<TableColumn> getTableColumnOrderComparator()

registerColumn

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

unregisterColumn

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

getColumnInfo

public TableColumnInfo getColumnInfo(Class forDataSourceType,
                                     String forTableID,
                                     String columnID)

getColumnInfo

public TableColumnInfo getColumnInfo(TableColumnCore column)

getColumnData

public Object getColumnData(String columnID,
                            String key)

setColumnData

public void setColumnData(String columnID,
                          String key,
                          Object value)

removeColumnData

public void removeColumnData(String columnID,
                             String key)

resetColumns

public void resetColumns(Class dataSourceType,
                         String tableID)