Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » Custom TextMatchingMode(Add new TextMatchingModes which could handle simple star regex.)
Custom TextMatchingMode [message #1814228] Fri, 06 September 2019 08:06 Go to next message
Nikolai Chebanov is currently offline Nikolai ChebanovFriend
Messages: 4
Registered: April 2019
Junior Member
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 08:38 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
Registered: July 2012
Senior Member
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 14:01 Go to previous message
Nikolai Chebanov is currently offline Nikolai ChebanovFriend
Messages: 4
Registered: April 2019
Junior Member
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: Thu Apr 25 04:16:39 GMT 2024

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

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

Back to the top