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 Type
    Method
    Description
    Used to provision this factory with a CyTable that will be used to create tasks.
    default boolean
    Determines if the task factory should appear for the given table.
    default boolean
    isOn(CyTable table)
    If this task factory implements the Togglable 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

      TaskIterator createTaskIterator(CyTable table)
      Used to provision this factory with a CyTable 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

      boolean isReady(CyTable table)
      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

      default boolean isApplicable(CyTable table)
      Determines if the task factory should appear for the given table.
      Parameters:
      table -
      Since:
      3.9
    • isOn

      default boolean isOn(CyTable table)
      If this task factory implements the Togglable interface then this method determines if the button or check box is on or off.
      Since:
      3.9