org.gudy.azureus2.plugins.ui.tables
Interface TableManager

All Known Implementing Classes:
TableManagerImpl

public interface TableManager

Allows plugins to manage Azureus UI tables.

Since:
2.0.8.5
Author:
TuxPaper

Field Summary
static java.lang.String TABLE_ACTIVITY
           
static java.lang.String TABLE_ACTIVITY_BIG
           
static java.lang.String TABLE_ALL_PEERS
          Visible for All Peers table
static java.lang.String TABLE_MYSHARES
          Visible for My Shares table
static java.lang.String TABLE_MYTORRENTS_ALL_BIG
           
static java.lang.String TABLE_MYTORRENTS_COMPLETE
          Visible for Completed Torrents table
static java.lang.String TABLE_MYTORRENTS_COMPLETE_BIG
          Visible for Completed Torrents table (big version)
static java.lang.String TABLE_MYTORRENTS_INCOMPLETE
          Visible for Incompleted Torrents table
static java.lang.String TABLE_MYTORRENTS_INCOMPLETE_BIG
          Visible for Incompleted Torrents table (big version)
static java.lang.String TABLE_MYTORRENTS_UNOPENED
           
static java.lang.String TABLE_MYTORRENTS_UNOPENED_BIG
           
static java.lang.String TABLE_MYTRACKER
          Visible for My Tracker table
static java.lang.String TABLE_TORRENT_FILES
          Visible for Torrent Files table
static java.lang.String TABLE_TORRENT_PEERS
          Visible for Torrent Peers table
static java.lang.String TABLE_TORRENT_PIECES
          Visible for Torrent Pieces table
static java.lang.String TABLE_TORRENT_TRACKERS
           
 
Method Summary
 void addColumn(TableColumn tableColumn)
          Adds a column to an Azureus UI table.
 TableContextMenuItem addContextMenuItem(java.lang.String tableID, java.lang.String resourceKey)
          Adds a Context Menu item to the specified table or to all table context menus.
 TableContextMenuItem addContextMenuItem(TableContextMenuItem parent, java.lang.String resourceKey)
          Adds a Context Menu item as a sub-item of the given menu item.
 TableColumn createColumn(java.lang.String tableID, java.lang.String cellID)
          Creates a column for a UI table.
 void registerColumn(java.lang.Class forDataSourceType, java.lang.String cellID, TableColumnCreationListener listener)
          Register a column for a specific data source type.
 void unregisterColumn(java.lang.Class forDataSourceType, java.lang.String cellID, TableColumnCreationListener listener)
          unregister a listener added by @link registerColumn(Class, String, TableColumnCreationListener)
 

Field Detail

TABLE_MYTORRENTS_COMPLETE

static final java.lang.String TABLE_MYTORRENTS_COMPLETE
Visible for Completed Torrents table

See Also:
Constant Field Values

TABLE_MYTORRENTS_INCOMPLETE

static final java.lang.String TABLE_MYTORRENTS_INCOMPLETE
Visible for Incompleted Torrents table

See Also:
Constant Field Values

TABLE_MYTORRENTS_UNOPENED

static final java.lang.String TABLE_MYTORRENTS_UNOPENED
See Also:
Constant Field Values

TABLE_MYTORRENTS_COMPLETE_BIG

static final java.lang.String TABLE_MYTORRENTS_COMPLETE_BIG
Visible for Completed Torrents table (big version)

See Also:
Constant Field Values

TABLE_MYTORRENTS_INCOMPLETE_BIG

static final java.lang.String TABLE_MYTORRENTS_INCOMPLETE_BIG
Visible for Incompleted Torrents table (big version)

See Also:
Constant Field Values

TABLE_MYTORRENTS_UNOPENED_BIG

static final java.lang.String TABLE_MYTORRENTS_UNOPENED_BIG
See Also:
Constant Field Values

TABLE_MYTORRENTS_ALL_BIG

static final java.lang.String TABLE_MYTORRENTS_ALL_BIG
See Also:
Constant Field Values

TABLE_ACTIVITY

static final java.lang.String TABLE_ACTIVITY
See Also:
Constant Field Values

TABLE_ACTIVITY_BIG

static final java.lang.String TABLE_ACTIVITY_BIG
See Also:
Constant Field Values

TABLE_TORRENT_PEERS

static final java.lang.String TABLE_TORRENT_PEERS
Visible for Torrent Peers table

See Also:
Constant Field Values

TABLE_TORRENT_PIECES

static final java.lang.String TABLE_TORRENT_PIECES
Visible for Torrent Pieces table

See Also:
Constant Field Values

TABLE_TORRENT_FILES

static final java.lang.String TABLE_TORRENT_FILES
Visible for Torrent Files table

See Also:
Constant Field Values

TABLE_TORRENT_TRACKERS

static final java.lang.String TABLE_TORRENT_TRACKERS
See Also:
Constant Field Values

TABLE_MYTRACKER

static final java.lang.String TABLE_MYTRACKER
Visible for My Tracker table

See Also:
Constant Field Values

TABLE_MYSHARES

static final java.lang.String TABLE_MYSHARES
Visible for My Shares table

See Also:
Constant Field Values

TABLE_ALL_PEERS

static final java.lang.String TABLE_ALL_PEERS
Visible for All Peers table

See Also:
Constant Field Values
Method Detail

createColumn

TableColumn createColumn(java.lang.String tableID,
                         java.lang.String cellID)
Creates a column for a UI table.

In order for this object to be displayed in an Azureus UI table, the returned object must be added via the addColumn(TableColumn)

The distinction between creating and adding a column is required because some TableColumn functions are not available or act differently after the column had been added.

In order to the plugin to display correctly the column name, you are required to create a key in your language file consisting of the TableManager Table ID of the table you are adding the column to, plus ".column." plus the logical name of your column.

For example, if you are creating a column named "quality" in the table TABLE_TORRENT_FILES, you would have to add the following to your language file:
Files.column.quality=Column Title
and if you wish to have a short description of the column (visible when the user is setting up columns), create another entry with the same key plus ".info". For the example above:
Files.column.quality.info=One line description


If you wish to add a menu item to tables that show torrents, use MenuManager.addMenuItem(String, String)

Parameters:
tableID - Which table the column will be visible in. See TableManager.
cellID - The logical name of the column.
Returns:
an interface object allowing modification of the table column.

registerColumn

void registerColumn(java.lang.Class forDataSourceType,
                    java.lang.String cellID,
                    TableColumnCreationListener listener)
Register a column for a specific data source type. When the column is created, the listener will be fired.

This method is independent of createColumn(String, String) and addColumn(TableColumn). This method improves upon them by saving you from creating and adding the column to every potential table it could be displayed in. It allows for your column to be added to future tables without and code changes on your end.

Parameters:
forDataSourceType - Class of datasource you want to add a column to, such as Download, DownloadTypeComplete, DownloadTypeIncomplete
cellID - The logical name of the column.
listener -
Since:
3.1.1.1

unregisterColumn

void unregisterColumn(java.lang.Class forDataSourceType,
                      java.lang.String cellID,
                      TableColumnCreationListener listener)
unregister a listener added by @link registerColumn(Class, String, TableColumnCreationListener)

Parameters:
forDataSourceType -
cellID -
listener -
Since:
4005

addColumn

void addColumn(TableColumn tableColumn)
Adds a column to an Azureus UI table.

Parameters:
tableColumn - a column previously created with createColumn(java.lang.String, java.lang.String)

addContextMenuItem

TableContextMenuItem addContextMenuItem(java.lang.String tableID,
                                        java.lang.String resourceKey)
Adds a Context Menu item to the specified table or to all table context menus.

Parameters:
tableID - Which table the menu item will be visible in. See TableManager. If null, the menu item will be added to all table context menus.
resourceKey - ID of the context menu, which is also used to retrieve the textual name from the plugin language file.
Returns:
a newly created menu item for the table's context menu.

addContextMenuItem

TableContextMenuItem addContextMenuItem(TableContextMenuItem parent,
                                        java.lang.String resourceKey)
Adds a Context Menu item as a sub-item of the given menu item.

Parameters:
parent - The MenuItem to add this new item to. The parent MenuItem must have its style attribute to be set to "menu".
resourceKey - ID of the context menu, which is also used to retrieve the textual name from the plugin language file.
Returns:
a newly created menu item existing inside the given menu item.