Class MappedColumnConstraintEditor<T,​M>

  • Type Parameters:
    T - The column (mapped from) type.
    M - the mapped to type.
    All Implemented Interfaces:
    ColumnConstraintEditor<T>

    public class MappedColumnConstraintEditor<T,​M>
    extends java.lang.Object
    implements ColumnConstraintEditor<T>
    A constraint editor that supports object type conversions, wrapping the editor for the converted-to type. This is used to convert one column type to another that we already have editors for. For example, suppose there is a Foo type where the column is returning Foo objects but the rendering is just displaying Foo.getName(). In this case you would create a FooEditor that wraps the various string editors. So even though the column uses Foo objects, the user filters on just strings.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addChangeListener​(javax.swing.event.ChangeListener constraintEditorChangeListener)
      Register a callback handler for responding to changes made within the editor
      java.awt.Component getDetailComponent()
      The detail component resides in the configuration interface below the column and constraint selection widgets, and is afforded greater space.
      java.lang.String getErrorMessage()
      If the editor contains and invalid value, this message should indicate why the value is invalid.
      java.awt.Component getInlineComponent()
      The inline component resides in the configuration interface on the same visual line as the column and constraint selection widgets.
      ColumnConstraint<T> getValue()
      Get the current value from the editor, in the form of a constraint.
      boolean hasValidValue()
      Determine if the editor contains a valid value; do the UI widgets and state match, is the state sensible for the constraint.
      void removeChangeListener​(javax.swing.event.ChangeListener constraintEditorChangeListener)
      Remove a callback handler that was responding changes made within the editor
      void reset()
      Reset the editor to a known-good state.
      void setValue​(ColumnConstraint<T> value)
      Sets the T-converted-to-W type in the delegate editor
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MappedColumnConstraintEditor

        public MappedColumnConstraintEditor​(MappedColumnConstraint<T,​M> constraint,
                                            ColumnConstraintEditor<M> delegateEditor)
        Constructor.
        Parameters:
        constraint - Type-converting constraint for which this component is an editor.
        delegateEditor - Editor for the converted-to type.
    • Method Detail

      • getInlineComponent

        public java.awt.Component getInlineComponent()
        Description copied from interface: ColumnConstraintEditor
        The inline component resides in the configuration interface on the same visual line as the column and constraint selection widgets. It is intended to be a relatively small and simple interface for configuring the constraints' values.
        Specified by:
        getInlineComponent in interface ColumnConstraintEditor<T>
        Returns:
        the inline editor component
      • getDetailComponent

        public java.awt.Component getDetailComponent()
        Description copied from interface: ColumnConstraintEditor
        The detail component resides in the configuration interface below the column and constraint selection widgets, and is afforded greater space. It is intended to be a more feature-rich editor that provides greater insight or control of the constraints value definition.
        Specified by:
        getDetailComponent in interface ColumnConstraintEditor<T>
        Returns:
        the detail editor component
      • setValue

        public void setValue​(ColumnConstraint<T> value)
        Sets the T-converted-to-W type in the delegate editor

        Set the current value within the editor

        Specified by:
        setValue in interface ColumnConstraintEditor<T>
        Parameters:
        value - the new value to set
      • hasValidValue

        public boolean hasValidValue()
        Description copied from interface: ColumnConstraintEditor
        Determine if the editor contains a valid value; do the UI widgets and state match, is the state sensible for the constraint.
        Specified by:
        hasValidValue in interface ColumnConstraintEditor<T>
        Returns:
        true if the configuration is valid, false otherwise
      • getErrorMessage

        public java.lang.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
      • addChangeListener

        public void addChangeListener​(javax.swing.event.ChangeListener constraintEditorChangeListener)
        Description copied from interface: ColumnConstraintEditor
        Register a callback handler for responding to changes made within the editor
        Specified by:
        addChangeListener in interface ColumnConstraintEditor<T>
        Parameters:
        constraintEditorChangeListener - listener callback
      • removeChangeListener

        public void removeChangeListener​(javax.swing.event.ChangeListener constraintEditorChangeListener)
        Description copied from interface: ColumnConstraintEditor
        Remove a callback handler that was responding changes made within the editor
        Specified by:
        removeChangeListener in interface ColumnConstraintEditor<T>
        Parameters:
        constraintEditorChangeListener - listener callback