|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.gudy.azureus2.pluginsimpl.local.ui.tables.TableManagerImpl
public class TableManagerImpl
Manage Tables There's a TableManager per plugin interface
Field Summary |
---|
Fields inherited from interface org.gudy.azureus2.plugins.ui.tables.TableManager |
---|
TABLE_ACTIVITY, TABLE_ACTIVITY_BIG, TABLE_ALL_PEERS, TABLE_MYSHARES, TABLE_MYTORRENTS_ALL_BIG, TABLE_MYTORRENTS_COMPLETE, TABLE_MYTORRENTS_COMPLETE_BIG, TABLE_MYTORRENTS_INCOMPLETE, TABLE_MYTORRENTS_INCOMPLETE_BIG, TABLE_MYTORRENTS_UNOPENED, TABLE_MYTORRENTS_UNOPENED_BIG, TABLE_MYTRACKER, TABLE_TORRENT_FILES, TABLE_TORRENT_PEERS, TABLE_TORRENT_PIECES, TABLE_TORRENT_TRACKERS |
Constructor Summary | |
---|---|
TableManagerImpl(UIManagerImpl _ui_manager)
|
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 TableManager.registerColumn(Class, String, TableColumnCreationListener) |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TableManagerImpl(UIManagerImpl _ui_manager)
Method Detail |
---|
public TableColumn createColumn(java.lang.String tableID, java.lang.String cellID)
TableManager
In order for this object to be displayed in an Azureus UI table, the
returned object must be added via the TableManager.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)
createColumn
in interface TableManager
tableID
- Which table the column will be visible in. See TableManager
.cellID
- The logical name of the column.
public void registerColumn(java.lang.Class forDataSourceType, java.lang.String cellID, TableColumnCreationListener listener)
TableManager
This method is independent of TableManager.createColumn(String, String)
and
TableManager.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.
registerColumn
in interface TableManager
forDataSourceType
- Class of datasource you want to add a column to,
such as Download
, DownloadTypeComplete
,
DownloadTypeIncomplete
cellID
- The logical name of the column.public void unregisterColumn(java.lang.Class forDataSourceType, java.lang.String cellID, TableColumnCreationListener listener)
TableManager
TableManager.registerColumn(Class, String, TableColumnCreationListener)
unregisterColumn
in interface TableManager
public void addColumn(TableColumn tableColumn)
TableManager
addColumn
in interface TableManager
tableColumn
- a column previously created with TableManager.createColumn(java.lang.String, java.lang.String)
public TableContextMenuItem addContextMenuItem(TableContextMenuItem parent, java.lang.String resourceKey)
TableManager
addContextMenuItem
in interface TableManager
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.
public TableContextMenuItem addContextMenuItem(java.lang.String tableID, java.lang.String resourceKey)
TableManager
addContextMenuItem
in interface TableManager
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.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |