Class TableManagerImpl
- All Implemented Interfaces:
TableManager
- Since:
- 2.0.8.5
-
Field Summary
FieldsFields inherited from interface TableManager
TABLE_ACTIVITY, TABLE_ACTIVITY_BIG, TABLE_ALL_PEERS, TABLE_ALL_PIECES, TABLE_MYSHARES, TABLE_MYTORRENTS_ALL, TABLE_MYTORRENTS_ALL_BIG, TABLE_MYTORRENTS_ALL_SMALL, TABLE_MYTORRENTS_COMPLETE, TABLE_MYTORRENTS_COMPLETE_BIG, TABLE_MYTORRENTS_INCOMPLETE, TABLE_MYTORRENTS_INCOMPLETE_BIG, TABLE_MYTORRENTS_SUBVIEW, TABLE_MYTORRENTS_UNOPENED, TABLE_MYTORRENTS_UNOPENED_BIG, TABLE_MYTRACKER, TABLE_TORRENT_FILES, TABLE_TORRENT_PEERS, TABLE_TORRENT_PIECES, TABLE_TORRENT_TRACKERS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddColumn(TableColumn tableColumn) Adds a column to an Azureus UI table.addContextMenuItem(TableContextMenuItem parent, String resourceKey) Adds a Context Menu item as a sub-item of the given menu item.addContextMenuItem(String tableID, String resourceKey) Adds a Context Menu item to the specified table or to all table context menus.createColumn(String tableID, String cellID) Creates a column for a UI table.voidregisterColumn(Class forDataSourceType, String cellID, TableColumnCreationListener listener) Register a column for a specific data source type.voidunregisterColumn(Class forDataSourceType, String cellID) unregister a listener added by @linkTableManager.registerColumn(Class, String, TableColumnCreationListener)
-
Field Details
-
ui_manager
-
-
Constructor Details
-
TableManagerImpl
-
-
Method Details
-
createColumn
Description copied from interface:TableManagerCreates 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
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
TableManagerTable 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, useMenuManager.addMenuItem(String, String)- Specified by:
createColumnin interfaceTableManager- Parameters:
tableID- Which table the column will be visible in. SeeTableManager.cellID- The logical name of the column.- Returns:
- an interface object allowing modification of the table column.
-
registerColumn
public void registerColumn(Class forDataSourceType, String cellID, TableColumnCreationListener listener) Description copied from interface:TableManagerRegister a column for a specific data source type. When the column is created, the listener will be fired.This method is independent of
TableManager.createColumn(String, String)andTableManager.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.- Specified by:
registerColumnin interfaceTableManager- Parameters:
forDataSourceType- Class of datasource you want to add a column to, such asDownload,DownloadTypeComplete,DownloadTypeIncompletecellID- The logical name of the column.listener-
-
unregisterColumn
Description copied from interface:TableManagerunregister a listener added by @linkTableManager.registerColumn(Class, String, TableColumnCreationListener)- Specified by:
unregisterColumnin interfaceTableManager- Parameters:
forDataSourceType-cellID-
-
addColumn
Description copied from interface:TableManagerAdds a column to an Azureus UI table.- Specified by:
addColumnin interfaceTableManager- Parameters:
tableColumn- a column previously created withTableManager.createColumn(String, String)
-
addContextMenuItem
Description copied from interface:TableManagerAdds a Context Menu item as a sub-item of the given menu item.- Specified by:
addContextMenuItemin interfaceTableManager- 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.
-
addContextMenuItem
Description copied from interface:TableManagerAdds a Context Menu item to the specified table or to all table context menus.- Specified by:
addContextMenuItemin interfaceTableManager- Parameters:
tableID- Which table the menu item will be visible in. SeeTableManager. 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.
-