Class TableUpdateJob<T>

  • Type Parameters:
    T - the type of data that each row in the table represents.
    Direct Known Subclasses:
    AddRemoveJob, FilterJob, LoadJob, LoadSpecificDataJob, SortJob

    public class TableUpdateJob<T>
    extends java.lang.Object
    State machine object for performing the various update functions on a ThreadedTableModel. The general pattern is to:
    1. Load
    2. Filter
    3. Process individual adds and removes
    4. Sort
    5. Set the processed data back on the model

    Not all the update functions are performed on a run of a TableUpdateJob. If the reloadData flag is not set, the the data is just copied from the model's current list, instead of calling the model's loadData() method. If the sortComparator is null, then the data is not sorted (for example, when only filtering needs to be done). If there are no add/removes in the list, then that step does nothing.

    Before the job completes, new calls to sort and filter can be called. If the job is past the stage of the new call, the monitor is cancelled, causing the current stage to abort. The next state of this job is set to the appropriate state for the call, the monitor is reset, and the job begins executing the next stage, based upon the new call.

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      ChangeModifier and Type Method Description
      void addRemove​(AddRemoveListItem<T> item, int maxAddRemoveCount)
      Adds the Add/Remove item to the list of items to be processed in the add/remove phase.
      void cancel()  
      boolean filter()
      Tells the job that the filter criteria has changed.
      void reload()
      Forces this job to completely reload the data, instead of copying from the model's current data.
      void run()
      The basic run() method that executes the state machine.
      protected void setData​(TableData<T> data)
      Meant to be called by subclasses, not clients.
      NEWprotected void setForceFilter​(boolean force)
      Allows the precise disabling of the filter operation.
      boolean sort​(TableSortingContext<T> newSortingContext, boolean forceSort)
      Sets the TableColumnComparator to use for sorting the data.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Method Detail

  • setForceFilter NEW

    protected void setForceFilter​(boolean force)
    Allows the precise disabling of the filter operation. For example, when the user sorts, no filtering is needed. If the filter has changed, then a filter will take place, regardless of the state of this variable.
    Parameters:
    force - false to reuse the current filter, if possible.