Presentation Model for Find/Filter Widgets.
Compiles and holds a Pattern from rawText. There are different predefined strategies to control the compilation:
Holds state for controlling the match process for both find and filter (TODO - explain). Relevant in all
- caseSensitive -
- empty - true if there's no searchString
- incremental - a hint to clients to react immediately to pattern changes.
Relevant in find contexts:
- backwards - search direction if used in a find context
- wrapping - wrap over the end/start if not found
- foundIndex - storage for last found index
- autoAdjustFoundIndex - flag to indicate auto-incr/decr of foundIndex on setting. Here the property correlates to !isIncremental() - to simplify batch vs. incremental search ui.
JW: Work-in-progress - Anchors will be factored into AnchoredSearchMode
Anchors By default, the scope of the pattern relative to strings being tested are unanchored, ie, the pattern will match any part of the tested string. Traditionally, special characters ('^' and '$') are used to describe patterns that match the beginning (or end) of a string. If those characters are included in the pattern, the regular expression will honor them. However, for ease of use, two properties are included in this model that will determine how the pattern will be evaluated when these characters are omitted.
The StartAnchored property determines if the pattern must match from the beginning of tested strings, or if the pattern can appear anywhere in the tested string. Likewise, the EndAnchored property determines if the pattern must match to the end of the tested string, or if the end of the pattern can appear anywhere in the tested string. The default values (false in both cases) correspond to the common database 'LIKE' operation, where the pattern is considered to be a match if any part of the tested string matches the pattern.
@author Jeanette Winzenburg
@author David Hall