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 Change Modifier and Type Field Description NEW protected ColumnData<T>columnDataSourceNEW protected javax.swing.JLabelstatusLabel-
Fields inherited from class docking.widgets.table.constrainteditor.AbstractColumnConstraintEditor
currentConstraint, INVALID_INPUT_COLOR, VALID_INPUT_COLOR
-
-
Constructor Summary
Constructors Change Constructor Description DataLoadingConstraintEditor(ColumnConstraint<T> delegateConstraint, ColumnData<T> columnDataSource)Constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Change Modifier and Type Method Description NEW protected java.awt.ComponentbuildDelegateDetailEditor()Get the delegates' detail componentNEW protected java.awt.ComponentbuildDelegateInlineEditor()Get the delegates' inline editor componentNEW protected java.awt.ComponentbuildDetailEditorComponent()Delegate the construction of the detail editor component.NEW protected java.awt.ComponentbuildInlineEditorComponent()Delegate the construction of the inline editor component.voidclearColumnData()Request that any state maintained by the delegate editor pertaining to column data be cleared.voidcolumnDataLoadCancelled()Notification that the column data-load was cancelled.voidcolumnDataLoadComplete()Notification that the column data-load has been completed.NEW protected abstract voiddoUpdateEditorComponent()Indicates the constraint has changed, and the user interface needs to be updated to reflect the new state.java.lang.StringgetErrorMessage()If the editor contains and invalid value, this message should indicate why the value is invalid.NEW protected abstract ColumnConstraint<T>getValueFromComponent()Get the constraints' new value from the editor component.abstract voidhandleColumnDataValue(T value)A value has been read from the table (column); handle it in an editor-specific way.voidreset()Reset the editor to a known-good state.NEW protected abstract voidresetEditor()Reset the delegate editor to a known statevoidtaskCancelled(Task task)Notification that the task was canceled.voidtaskCompleted(Task task)Notification that the task completed.NEW protected voidupdateEditorComponent()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 Detail
-
columnDataSource NEW
protected final ColumnData<T> columnDataSource
Constructor Detail
-
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 Detail
-
buildInlineEditorComponent NEW
protected java.awt.Component buildInlineEditorComponent()
Delegate the construction of the inline editor component.This editor provides a panel containing a
TaskMonitorComponentand 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:
buildInlineEditorComponentin classAbstractColumnConstraintEditor<T>- Returns:
- the editors inline component
- See Also:
buildDelegateInlineEditor()
-
buildDelegateInlineEditor NEW
protected java.awt.Component buildDelegateInlineEditor()
Get the delegates' inline editor component- Returns:
- the inline editor for the delegate constraint
-
buildDetailEditorComponent NEW
protected java.awt.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:
buildDetailEditorComponentin classAbstractColumnConstraintEditor<T>- Returns:
- the editors detail component; null in this implementation
- See Also:
buildDelegateDetailEditor()
-
buildDelegateDetailEditor NEW
protected java.awt.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:ColumnConstraintEditorReset the editor to a known-good state.- Specified by:
resetin interfaceColumnConstraintEditor<T>
-
resetEditor NEW
protected abstract void resetEditor()
Reset the delegate editor to a known state- See Also:
reset()
-
getValueFromComponent NEW
protected abstract ColumnConstraint<T> getValueFromComponent()
Description copied from class:AbstractColumnConstraintEditorGet the constraints' new value from the editor component. This expects the UI to have been constructed.- Specified by:
getValueFromComponentin classAbstractColumnConstraintEditor<T>- Returns:
- See Also:
AbstractColumnConstraintEditor.getValue()
-
getErrorMessage
public java.lang.String getErrorMessage()
Description copied from interface:ColumnConstraintEditorIf the editor contains and invalid value, this message should indicate why the value is invalid. Only called if hasValidValue() returns false.- Specified by:
getErrorMessagein interfaceColumnConstraintEditor<T>- Returns:
- an error message, or an empty string if no error
-
updateEditorComponent NEW
protected void updateEditorComponent()
Description copied from class:AbstractColumnConstraintEditorIndicates to subclasses that the constraint has changed, and the user interface needs to be updated to reflect the new state.- Specified by:
updateEditorComponentin classAbstractColumnConstraintEditor<T>
-
doUpdateEditorComponent NEW
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:TaskListenerNotification that the task completed.- Specified by:
taskCompletedin interfaceTaskListener- Parameters:
task- the task that was running and is now completed
-
taskCancelled
public void taskCancelled(Task task)
Description copied from interface:TaskListenerNotification that the task was canceled.- Specified by:
taskCancelledin interfaceTaskListener- Parameters:
task- the task that was running and was canceled
-
-