Package docking.widgets.table.constraint

# Class StringColumnConstraint

java.lang.Object
docking.widgets.table.constraint.StringColumnConstraint

All Implemented Interfaces:
  `ColumnConstraint<String>`, `Comparable<ColumnConstraint<String>>`

Direct Known Subclasses:
  `StringContainsColumnConstraint`, `StringEndsWithColumnConstraint`, `StringMatchesColumnConstraint`, `StringStartsWithColumnConstraint`

public abstract class StringColumnConstraint extends Object implements ColumnConstraint<String>
Base class for various String constraints.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected Pattern`
  `matchesPattern`

- ## Constructor Summary

  Constructors
  Modifier
  Constructor
  Description
  `protected`
  `StringColumnConstraint(String patternString)`
  Constructs a new StringColumnConstraint using the given pattern and patternString, using the default hint text that explains that you can use globbing characters.
  `protected`
  `StringColumnConstraint(String patternString, String errorMessage)`
  Constructs a new StringColumnConstraint using the given pattern and patternString.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `accepts(String value, TableFilterContext context)`
  Compares value against the current constraint value to determine acceptance; true if value satisfies the constraints' value, false otherwise
  `abstract ColumnConstraint<String>`
  `copy(String newPatternString)`
  subclasses must override to generate new versions of themselves but with a new pattern string.
  `boolean`
  `equals(Object o)`
  `protected Pattern`
  `generateFindsPattern()`
  `protected abstract Pattern`
  `generateMatchesPattern(String value)`
  `Class<String>`
  `getColumnType()`
  Returns the column type that this constraint can be used to filter.
  `String`
  `getConstraintValueString()`
  Returns the "value" of the constraint in string form
  `String`
  `getConstraintValueTooltip()`
  returns a description of the constraint suitable for displaying in a tooltip
  `ColumnConstraintEditor<String>`
  `getEditor(ColumnData<String> columnDataSource)`
  Returns a ColumnConstraintEditor which will provide gui components for users to edit the constraint values.
  `String`
  `getGroup()`
  Returns a "group" string that is used to logically group column constraints for presentation to the user
  `Matcher`
  `getHighlightMatcher(String value)`
  `String`
  `getPatternString()`
  Returns the pattern string for this constraint.
  `int`
  `hashCode()`
  `boolean`
  `isValidPatternString(String value)`
  `ColumnConstraint<String>`
  `parseConstraintValue(String newValue, Object dataSource)`
  Parses the constraint value string for deserialization purposes.
  `String`
  `toString()`

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

  `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

  ### Methods inherited from interface docking.widgets.table.constraint.ColumnConstraint

  `asString, compareTo, getName`

- ## Field Details

  - ### matchesPattern

    protected Pattern matchesPattern

- ## Constructor Details

  - ### StringColumnConstraint

    protected StringColumnConstraint(String patternString, String errorMessage)
    Constructs a new StringColumnConstraint using the given pattern and patternString.
    Parameters:
      `patternString` - the user entered string to form the pattern used to accept column values.
      `errorMessage` - the text to display in an empty editor textfield.

  - ### StringColumnConstraint

    protected StringColumnConstraint(String patternString)
    Constructs a new StringColumnConstraint using the given pattern and patternString, using the default hint text that explains that you can use globbing characters.
    Parameters:
      `patternString` - the user entered string to form the pattern used to accept column values.

- ## Method Details

  - ### getGroup

    public String getGroup()
    Description copied from interface: `ColumnConstraint`
    Returns a "group" string that is used to logically group column constraints for presentation to the user
    Specified by:
      `getGroup` in interface `ColumnConstraint<String>`
    Returns:
      the group this constraint belongs to.

  - ### accepts

    public boolean accepts(String value, TableFilterContext context)
    Description copied from interface: `ColumnConstraint`
    Compares value against the current constraint value to determine acceptance; true if value satisfies the constraints' value, false otherwise
    Specified by:
      `accepts` in interface `ColumnConstraint<String>`
    Parameters:
      `value` - the column value to be tested.
      `context` - provides additional information about the table and its data. This allows the filter to base its decision on information other than just the column value.
    Returns:
      true if the column value passes the constraint, false otherwise

  - ### generateMatchesPattern

    protected abstract Pattern generateMatchesPattern(String value)

  - ### generateFindsPattern

    protected Pattern generateFindsPattern()

  - ### getEditor

    public ColumnConstraintEditor<String> getEditor(ColumnData<String> columnDataSource)
    Description copied from interface: `ColumnConstraint`
    Returns a ColumnConstraintEditor which will provide gui components for users to edit the constraint values.
    Specified by:
      `getEditor` in interface `ColumnConstraint<String>`
    Parameters:
      `columnDataSource` - This provides the constraint with access to the column data in the table model as well as the DataProvider of the table (if it has one)
    Returns:
      A columnConstraintEditor for editing the constraints value.

  - ### copy

    public abstract ColumnConstraint<String> copy(String newPatternString)
    subclasses must override to generate new versions of themselves but with a new pattern string.
    Parameters:
      `newPatternString` - the new string to use for creating the match pattern.
    Returns:
      a new ColumnConstraint that is the same type as this constraint but with a new range defined.

  - ### getPatternString

    public String getPatternString()
    Returns the pattern string for this constraint.
    Returns:
      the pattern string for this constraint.

  - ### getColumnType

    public Class<String> getColumnType()
    Description copied from interface: `ColumnConstraint`
    Returns the column type that this constraint can be used to filter.
    Specified by:
      `getColumnType` in interface `ColumnConstraint<String>`
    Returns:
      the column type

  - ### getConstraintValueTooltip

    public String getConstraintValueTooltip()
    Description copied from interface: `ColumnConstraint`
    returns a description of the constraint suitable for displaying in a tooltip
    Specified by:
      `getConstraintValueTooltip` in interface `ColumnConstraint<String>`
    Returns:
      a description of the constraint.

  - ### getConstraintValueString

    public String getConstraintValueString()
    Description copied from interface: `ColumnConstraint`
    Returns the "value" of the constraint in string form

    This is used for serializing the constraint.

    Specified by:
      `getConstraintValueString` in interface `ColumnConstraint<String>`
    Returns:
      the "value" of the constraint in string form.

  - ### parseConstraintValue

    public ColumnConstraint<String> parseConstraintValue(String newValue, Object dataSource)
    Description copied from interface: `ColumnConstraint`
    Parses the constraint value string for deserialization purposes.
    Specified by:
      `parseConstraintValue` in interface `ColumnConstraint<String>`
    Parameters:
      `newValue` - the value of the constraint in string form.
      `dataSource` - the DataSource from the Table.
    Returns:
      a new ColumnConstraint

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Object`

  - ### hashCode

    public int hashCode()
    Overrides:
      `hashCode` in class `Object`

  - ### equals

    public boolean equals(Object o)
    Overrides:
      `equals` in class `Object`

  - ### getHighlightMatcher

    public Matcher getHighlightMatcher(String value)

  - ### isValidPatternString

    public boolean isValidPatternString(String value)