Package org.cytoscape.task
Interface TableTaskFactory
- All Known Subinterfaces:
DeleteTableTaskFactory
,ExportTableTaskFactory
,ImportDataTableTaskFactory
,JoinTablesTaskTaskFactory
,MapGlobalToLocalTableTaskFactory
,MapTableToNetworkTablesTaskFactory
- All Known Implementing Classes:
AbstractTableTaskFactory
public interface TableTaskFactory
A task factory that creates one or more tasks that operate on the specified CyTable.
Example of creating a button in the table browser toolbar...
CountRowsTableTaskFactory tableTaskFactory = new CountRowsTableTaskFactory();
var iconFont = iconManager.getIconFont(22.0f);
var icon = new TextIcon(IconManager.ICON_CALCULATOR, iconFont, 32, 32);
var iconId = "test::countrows";
iconManager.addIcon(iconId, icon);
Properties props = new Properties();
props.setProperty(ServiceProperties.ENABLE_FOR, "table");
props.setProperty(ServiceProperties.TOOLTIP, "Count Table Rows...");
props.setProperty(ServiceProperties.LARGE_ICON_ID, iconId);
props.setProperty(ServiceProperties.TOOL_BAR_GRAVITY, "" + 99);
props.setProperty(ServiceProperties.IN_NODE_TABLE_TOOL_BAR, "true");
props.setProperty(ServiceProperties.IN_EDGE_TABLE_TOOL_BAR, "true");
props.setProperty(ServiceProperties.IN_NETWORK_TABLE_TOOL_BAR, "true");
props.setProperty(ServiceProperties.IN_UNASSIGNED_TABLE_TOOL_BAR, "true");
registerService(bc, tableTaskFactory, TableTaskFactory.class, props);
In order to create a toggleable button the implementation must also implement the Togglable
interface.
Cytoscape Backwards Compatibility (SPI Interface): We expect that this interface will be implemented. Therefore to maintain backwards compatibility this interface will only be modified for major version updates.
Module: core-task-api
To use this in your app, include the following dependency in your POM:
<dependency> <groupId>org.cytoscape</groupId> <artifactId>core-task-api</artifactId> </dependency>
-
Method Summary
Modifier and TypeMethodDescriptioncreateTaskIterator(CyTable table)
Used to provision this factory with aCyTable
that will be used to create tasks.default boolean
isApplicable(CyTable table)
Determines if the task factory should appear for the given table.default boolean
If this task factory implements theTogglable
interface then this method determines if the button or check box is on or off.boolean
Returns true if this task factory is ready to produce a TaskIterator.
-
Method Details
-
createTaskIterator
Used to provision this factory with aCyTable
that will be used to create tasks.- Parameters:
table
- a non-null CyTable- Returns:
- A TaskIterator object containing one or more
Task
objects to execute.
-
isReady
Returns true if this task factory is ready to produce a TaskIterator.- Parameters:
table
- a non-null CyTable- Returns:
- true if this task factory is ready to produce a TaskIterator.
-
isApplicable
Determines if the task factory should appear for the given table.- Parameters:
table
-- Since:
- 3.9
-
isOn
If this task factory implements theTogglable
interface then this method determines if the button or check box is on or off.- Since:
- 3.9
-