Class RegexMarkupValue
java.lang.Object
org.eclipse.nebula.widgets.nattable.extension.nebula.richtext.RegexMarkupValue
- All Implemented Interfaces:
MarkupProcessor
MarkupProcessor implementation that is able to process regular
expression values to identify content that should be surrounded by a markup.
The regular expression needs to contain one group so the replacement can be
done by using a placeholder.- Since:
- 1.1
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionapplyMarkup(String input) Takes an input and applies the HTML markup.protected StringReturns the regular expression that specifies the value that should be surrounded by a markup, with the applied markup.protected StringReturns the regular expression that specifies the value that should be surrounded by a markup.booleanReturn whether thePattern.CASE_INSENSITIVEflag is applied to enable case insensitive matching.booleanReturn whether thePattern.UNICODE_CASEflag is applied to enable Unicode aware case folding.removeMarkup(String input) Takes an input and removes possible markups that where applied by thisMarkupProcessorvoidsetCaseInsensitive(boolean caseInsensitive) Configure whether thePattern.CASE_INSENSITIVEflag should be applied to enable case insensitive matching.voidsetRegexValue(String value) Set the regular expression that specifies the value that should be surrounded by a markup.voidsetUnicodeCase(boolean unicodeCase) Configure whether thePattern.UNICODE_CASEflag should be applied to enable Unicode aware case folding.
-
Constructor Details
-
RegexMarkupValue
- Parameters:
value- The regular expression that specifies the value that should be surrounded by a markup.markupPrefix- The String that should be added as prefix.markupSuffix- The String that should be added as suffix.
-
-
Method Details
-
applyMarkup
Description copied from interface:MarkupProcessorTakes an input and applies the HTML markup.- Specified by:
applyMarkupin interfaceMarkupProcessor- Parameters:
input- The input that should be processed for markup.- Returns:
- The input with additional markups.
-
removeMarkup
Description copied from interface:MarkupProcessorTakes an input and removes possible markups that where applied by thisMarkupProcessor- Specified by:
removeMarkupin interfaceMarkupProcessor- Parameters:
input- The input from which the markup should be removed.- Returns:
- The input value without markups.
-
setRegexValue
Set the regular expression that specifies the value that should be surrounded by a markup.- Parameters:
value- The regular expression that specifies the value that should be surrounded by a markup.
-
getOriginalRegexValue
Returns the regular expression that specifies the value that should be surrounded by a markup. Subclasses can override this method to provide a dynamic markup value, e.g. for highlighting values inserted into a text field.- Returns:
- The regular expression that specifies the value that should be surrounded by a markup.
-
getMarkupRegexValue
Returns the regular expression that specifies the value that should be surrounded by a markup, with the applied markup.- Returns:
- The original regex value with applied markup.
-
isCaseInsensitive
public boolean isCaseInsensitive()Return whether thePattern.CASE_INSENSITIVEflag is applied to enable case insensitive matching.Note: Case-insensitive matching can also be enabled via the embedded flag expression (?i) if the flag in this
RegexMarkupValueis disabled.- Returns:
trueif case insensitive matching is enabled,falseif matching is case sensitive.- Since:
- 1.2
-
setCaseInsensitive
public void setCaseInsensitive(boolean caseInsensitive) Configure whether thePattern.CASE_INSENSITIVEflag should be applied to enable case insensitive matching.Note: Case-insensitive matching can also be enabled via the embedded flag expression (?i) if the flag in this
RegexMarkupValueis disabled.- Parameters:
caseInsensitive-trueif case insensitive matching should be enabled,falseif matching should be case sensitive.- Since:
- 1.2
-
isUnicodeCase
public boolean isUnicodeCase()Return whether thePattern.UNICODE_CASEflag is applied to enable Unicode aware case folding. Only works if case insensitive matching is enabled.Note: Unicode-aware case folding can also be enabled via the embedded flag expression (?u) if the flag in this
RegexMarkupValueis disabled.- Returns:
trueif Unicode aware case folding is enabled,falseif case-insensitive matching assumes that only characters in the US-ASCII charset are being matched.- Since:
- 1.2
-
setUnicodeCase
public void setUnicodeCase(boolean unicodeCase) Configure whether thePattern.UNICODE_CASEflag should be applied to enable Unicode aware case folding. Only works if case insensitive matching is enabled.Note: Unicode-aware case folding can also be enabled via the embedded flag expression (?u) if the flag in this
RegexMarkupValueis disabled.- Parameters:
unicodeCase-trueif Unicode aware case folding should be enabled,falseif case-insensitive matching should only match characters in the US-ASCII charset.- Since:
- 1.2
-