Package docking.widgets.table.constrainteditor

# Class DataLoadingConstraintEditor<T>

java.lang.Object
docking.widgets.table.constrainteditor.AbstractColumnConstraintEditor<T>
docking.widgets.table.constrainteditor.DataLoadingConstraintEditor<T>

Type Parameters:
  `T` - the column type

All Implemented Interfaces:
  `ColumnConstraintEditor<T>`, `TaskListener`

Direct Known Subclasses:
  `AutocompletingStringConstraintEditor`

public abstract class DataLoadingConstraintEditor<T> extends AbstractColumnConstraintEditor<T> implements TaskListener
Abstract base class for constraint editors that load all the data in a column in order to initialize themselves.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected final ColumnData<T>`
  `columnDataSource`
  `protected JLabel`
  `statusLabel`

  ### Fields inherited from class docking.widgets.table.constrainteditor.AbstractColumnConstraintEditor

  `currentConstraint, INVALID_INPUT_COLOR, VALID_INPUT_COLOR`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `DataLoadingConstraintEditor(ColumnConstraint<T> delegateConstraint, ColumnData<T> columnDataSource)`
  Constructor.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected Component`
  `buildDelegateDetailEditor()`
  Get the delegates' detail component
  `protected Component`
  `buildDelegateInlineEditor()`
  Get the delegates' inline editor component
  `protected Component`
  `buildDetailEditorComponent()`
  Delegate the construction of the detail editor component.
  `protected Component`
  `buildInlineEditorComponent()`
  Delegate the construction of the inline editor component.
  `void`
  `clearColumnData()`
  Request that any state maintained by the delegate editor pertaining to column data be cleared.
  `void`
  `columnDataLoadCancelled()`
  Notification that the column data-load was cancelled.
  `void`
  `columnDataLoadComplete()`
  Notification that the column data-load has been completed.
  `protected abstract void`
  `doUpdateEditorComponent()`
  Indicates the constraint has changed, and the user interface needs to be updated to reflect the new state.
  `String`
  `getErrorMessage()`
  If the editor contains and invalid value, this message should indicate why the value is invalid.
  `protected abstract ColumnConstraint<T>`
  `getValueFromComponent()`
  Get the constraints' new value from the editor component.
  `abstract void`
  `handleColumnDataValue(T value)`
  A value has been read from the table (column); handle it in an editor-specific way.
  `void`
  `reset()`
  Reset the editor to a known-good state.
  `protected abstract void`
  `resetEditor()`
  Reset the delegate editor to a known state
  `void`
  `taskCancelled(Task task)`
  Notification that the task was canceled.
  `void`
  `taskCompleted(Task task)`
  Notification that the task completed.
  `protected void`
  `updateEditorComponent()`
  Indicates to subclasses that the constraint has changed, and the user interface needs to be updated to reflect the new state.

  ### Methods inherited from class docking.widgets.table.constrainteditor.AbstractColumnConstraintEditor

  `addChangeListener, checkEditorValueValidity, formatStatus, getDetailComponent, getInlineComponent, getValue, hasEditorComponents, hasValidValue, notifyConstraintChanged, removeChangeListener, setValue, updateInfoMessage, valueChanged`

  ### Methods inherited from class java.lang.Object

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

- ## Field Details

  - ### columnDataSource

    protected final ColumnData<T> columnDataSource

  - ### statusLabel

    protected JLabel statusLabel

- ## Constructor Details

  - ### DataLoadingConstraintEditor

    public DataLoadingConstraintEditor(ColumnConstraint<T> delegateConstraint, ColumnData<T> columnDataSource)
    Constructor.
    Parameters:
      `delegateConstraint` - the constraint to feed column data to. Provides editors for manipulating constraint values.
      `columnDataSource` - provides access to table data and. Must be non-null.

- ## Method Details

  - ### buildInlineEditorComponent

    protected Component buildInlineEditorComponent()
    Delegate the construction of the inline editor component.

    This editor provides a panel containing a `TaskMonitorComponent` and the ability to reload the columns' data; if the delegate editor provides an inline editor, this wraps it, and switches between task view and the editor depending on the executing state of the data-load task.

    Specified by:
      `buildInlineEditorComponent` in class `AbstractColumnConstraintEditor<T>`
    Returns:
      the editors inline component
    See Also:
      - `buildDelegateInlineEditor()`

  - ### buildDelegateInlineEditor

    protected Component buildDelegateInlineEditor()
    Get the delegates' inline editor component
    Returns:
      the inline editor for the delegate constraint

  - ### buildDetailEditorComponent

    protected Component buildDetailEditorComponent()
    Delegate the construction of the detail editor component.

    Subclasses should override this method if they choose to provide a detailed constraint editor. This is an optional feature, and this implementation returns null to satisfy the `ColumnConstraintEditor` contract.

    Overrides:
      `buildDetailEditorComponent` in class `AbstractColumnConstraintEditor<T>`
    Returns:
      the editors detail component; null in this implementation
    See Also:
      - `buildDelegateDetailEditor()`

  - ### buildDelegateDetailEditor

    protected Component buildDelegateDetailEditor()
    Get the delegates' detail component
    Returns:
      the detail editor for the delegate constraint

  - ### handleColumnDataValue

    public abstract void handleColumnDataValue(T value)
    A value has been read from the table (column); handle it in an editor-specific way.
    Parameters:
      `value` - the value read from the table (column)

  - ### columnDataLoadComplete

    public void columnDataLoadComplete()
    Notification that the column data-load has been completed.

  - ### columnDataLoadCancelled

    public void columnDataLoadCancelled()
    Notification that the column data-load was cancelled.

  - ### clearColumnData

    public void clearColumnData()
    Request that any state maintained by the delegate editor pertaining to column data be cleared.

  - ### reset

    public void reset()
    Description copied from interface: `ColumnConstraintEditor`
    Reset the editor to a known-good state.
    Specified by:
      `reset` in interface `ColumnConstraintEditor<T>`

  - ### resetEditor

    protected abstract void resetEditor()
    Reset the delegate editor to a known state
    See Also:
      - `reset()`

  - ### getValueFromComponent

    protected abstract ColumnConstraint<T> getValueFromComponent()
    Description copied from class: `AbstractColumnConstraintEditor`
    Get the constraints' new value from the editor component. This expects the UI to have been constructed.
    Specified by:
      `getValueFromComponent` in class `AbstractColumnConstraintEditor<T>`
    Returns:
      the value
    See Also:
      - `AbstractColumnConstraintEditor.getValue()`

  - ### getErrorMessage

    public String getErrorMessage()
    Description copied from interface: `ColumnConstraintEditor`
    If the editor contains and invalid value, this message should indicate why the value is invalid. Only called if `hasValidValue()` returns false.
    Specified by:
      `getErrorMessage` in interface `ColumnConstraintEditor<T>`
    Returns:
      an error message, or an empty string if no error

  - ### updateEditorComponent

    protected void updateEditorComponent()
    Description copied from class: `AbstractColumnConstraintEditor`
    Indicates to subclasses that the constraint has changed, and the user interface needs to be updated to reflect the new state.
    Specified by:
      `updateEditorComponent` in class `AbstractColumnConstraintEditor<T>`

  - ### doUpdateEditorComponent

    protected abstract void doUpdateEditorComponent()
    Indicates the constraint has changed, and the user interface needs to be updated to reflect the new state.

  - ### taskCompleted

    public void taskCompleted(Task task)
    Description copied from interface: `TaskListener`
    Notification that the task completed.
    Specified by:
      `taskCompleted` in interface `TaskListener`
    Parameters:
      `task` - the task that was running and is now completed

  - ### taskCancelled

    public void taskCancelled(Task task)
    Description copied from interface: `TaskListener`
    Notification that the task was canceled.
    Specified by:
      `taskCancelled` in interface `TaskListener`
    Parameters:
      `task` - the task that was running and was canceled