Skip to main content



      Home
Home » Eclipse Projects » NatTable » Custom TextMatchingMode(Add new TextMatchingModes which could handle simple star regex.)
Custom TextMatchingMode [message #1814228] Fri, 06 September 2019 04:06 Go to next message
Eclipse UserFriend
Hello,

I have to implement not java like regex handling in the column filter.
Regex should handle cases like "Di*ry" or "*ry" or "d*t*n*" all of them should resolve word "Dictionary", but not "dictionar" or "dicnioary" .

Is it possible to extend existing TextMatchingMode with the new one or maybe there is another way to do it?

Thanks,
Re: Custom TextMatchingMode [message #1814230 is a reply to message #1814228] Fri, 06 September 2019 04:38 Go to previous messageGo to next message
Eclipse UserFriend
What you actually need is to convert the input String that contains a * to a Java regular expression. We provide the FilterRowRegularExpressionConverter that actually does exactly the same.

We show the usage in the _6031_GlazedListsFilterExample:

configRegistry.registerConfigAttribute(
        FilterRowConfigAttributes.TEXT_MATCHING_MODE,
        TextMatchingMode.REGULAR_EXPRESSION,
        DisplayMode.NORMAL,
        FilterRowDataLayer.FILTER_ROW_COLUMN_LABEL_PREFIX
                + DataModelConstants.FIRSTNAME_COLUMN_POSITION);

configRegistry.registerConfigAttribute(
        CellConfigAttributes.DISPLAY_CONVERTER,
        new FilterRowRegularExpressionConverter(),
        DisplayMode.NORMAL,
        FilterRowDataLayer.FILTER_ROW_COLUMN_LABEL_PREFIX
                + DataModelConstants.FIRSTNAME_COLUMN_POSITION);
Re: Custom TextMatchingMode [message #1815031 is a reply to message #1814230] Tue, 24 September 2019 10:01 Go to previous message
Eclipse UserFriend
Thanks, Dirk
It is exactly what I was looking for.
Previous Topic:Misbehaving two-level column groups
Next Topic:Validation dialog popup multiple times
Goto Forum:
  


Current Time: Fri May 16 02:03:11 EDT 2025

Powered by FUDForum. Page generated in 0.03140 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top