Interface TableChooserExecutor


public interface TableChooserExecutor
The interface clients must implement to use the TableChooserDialog. This class is the callback that is used to process items from the dialog's table as users select one or more rows in the table and then press the table's "apply" button.
  • Method Details

    • getButtonName

      String getButtonName()
      A short name suitable for display in the "apply" button that indicates what the "apply" action does.
      Returns:
      A short name suitable for display in the "apply" button that indicates what the "apply" action does.
    • execute

      boolean execute(AddressableRowObject rowObject)
      Applies this executors action to the given rowObject. Return true if the given object should be removed from the table.

      This method call will be wrapped in a transaction so the client does not have to do so. Multiple selected rows will all be processed in a single transaction.

      Parameters:
      rowObject - the AddressRowObject to be executed upon
      Returns:
      true if the rowObject should be removed from the table, false otherwise
    • executeInBulk

      default boolean executeInBulk(List<AddressableRowObject> rowObjects, List<AddressableRowObject> deleted, TaskMonitor monitor)
      A callback that clients can choose to use instead of execute(AddressableRowObject).

      To use this method, simply override it to perform work on each item passed in. Due to supporting backward compatibility, clients still have to implement execute(AddressableRowObject). When using executeInBulk(List, List, TaskMonitor), simply implement execute(AddressableRowObject) as a do-nothing method.

      You are responsible for checking the cancelled state of the task monitor by calling TaskMonitor.isCancelled(). This allows long-running operations to be cancelled. You should also call TaskMonitor.incrementProgress(long) as you process each item in order to show progress in the UI.

      Note: the execute(AddressableRowObject) method is only called with items that are still in the dialog's table model. Some clients may programmatically manipulate the table model by removing row objects via the dialog's add/remove methods. The execute(AddressableRowObject) method is only called for items that still exist in the model. Contrastingly, this version of execute offers no such protection. Thus, if you manipulate the table model yourself, you also need to ensure that any items you process in this method are still in the dialog. To see if the item is still in the dialog, call TableChooserDialog.contains(AddressableRowObject).

      Parameters:
      rowObjects - the objects to be processed
      deleted - place any items to be removed from the table into this list
      monitor - the task monitor
      Returns:
      true if you wish to execute items in bulk; always return true from this method if you override it