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 inherited from class docking.widgets.table.constrainteditor.AbstractColumnConstraintEditor
currentConstraint, INVALID_INPUT_COLOR, VALID_INPUT_COLOR
-
Constructor Summary
ConstructorDescriptionDataLoadingConstraintEditor
(ColumnConstraint<T> delegateConstraint, ColumnData<T> columnDataSource) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected Component
Get the delegates' detail componentprotected Component
Get the delegates' inline editor componentprotected Component
Delegate the construction of the detail editor component.protected Component
Delegate the construction of the inline editor component.void
Request that any state maintained by the delegate editor pertaining to column data be cleared.void
Notification that the column data-load was cancelled.void
Notification that the column data-load has been completed.protected abstract void
Indicates the constraint has changed, and the user interface needs to be updated to reflect the new state.If the editor contains and invalid value, this message should indicate why the value is invalid.protected abstract ColumnConstraint
<T> 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
Reset the delegate editor to a known statevoid
taskCancelled
(Task task) Notification that the task was canceled.void
taskCompleted
(Task task) Notification that the task completed.protected void
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
-
Field Details
-
columnDataSource
-
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
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 classAbstractColumnConstraintEditor<T>
- Returns:
- the editors inline component
- See Also:
-
buildDelegateInlineEditor
Get the delegates' inline editor component- Returns:
- the inline editor for the delegate constraint
-
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 classAbstractColumnConstraintEditor<T>
- Returns:
- the editors detail component; null in this implementation
- See Also:
-
buildDelegateDetailEditor
Get the delegates' detail component- Returns:
- the detail editor for the delegate constraint
-
handleColumnDataValue
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 interfaceColumnConstraintEditor<T>
-
resetEditor
protected abstract void resetEditor()Reset the delegate editor to a known state- See Also:
-
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 classAbstractColumnConstraintEditor<T>
- Returns:
- the value
- See Also:
-
getErrorMessage
Description copied from interface:ColumnConstraintEditor
If the editor contains and invalid value, this message should indicate why the value is invalid. Only called ifhasValidValue()
returns false.- Specified by:
getErrorMessage
in interfaceColumnConstraintEditor<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 classAbstractColumnConstraintEditor<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
Description copied from interface:TaskListener
Notification that the task completed.- Specified by:
taskCompleted
in interfaceTaskListener
- Parameters:
task
- the task that was running and is now completed
-
taskCancelled
Description copied from interface:TaskListener
Notification that the task was canceled.- Specified by:
taskCancelled
in interfaceTaskListener
- Parameters:
task
- the task that was running and was canceled
-