Nick-The-Uncharted / tablefilter-swing

Automatically exported from code.google.com/p/tablefilter-swing
1 stars 1 forks source link

Special characters incorrectly rendered in AutoChoices #27

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. create a JTable with a cell that has "****"
2. create a filter with AutoChoices 

What is the expected output? What do you see instead?
I expect to see **** in the AutoChoice drop-down; instead I see \*\*\*\*

What version of the product are you using? On what operating system?
4.4

Please provide any additional information below.

Original issue reported on code.google.com by altm...@gmail.com on 30 Sep 2012 at 10:21

GoogleCodeExporter commented 9 years ago
Hi, the issue here is the presence of special parser characters in the cell. 
The default parser handles '*' as a wildcard, meaning 'any character(s)'; if 
the user wants to use that character, it will require escaping (\*).

The same logic happens for the special characters at the beginning: = > < ~ are 
used to define bigger than, lower than, etc, and the user must escape them if 
required.

There are, anyway, two ways to avoid this behavior:

1- Define the filter editor as non editable. In this case, the user can only 
choose one option in the combobox, so there is no parser involved => no need to 
escape any special characters.

2- Implement your own parser, using other special characters than '*', or 
directly avoiding wildcards. Note that the net.coderazzi.filters.IParser 
interface already covers this scenario, and requires implementing a method 
'escape'.

I would have preferred finding a solution that required no escaping, but its is 
obviously a design requirement: if you need wilcards, using the associated 
characters requires escaping. And because the user can edit the content of the 
choices in the editor combobox, there is no middle-way solution (where the 
combobox choices are not escaped).

Because this is a design issue, I can only mark the issue as invalid (ie, is 
not a bug).

Cheers,

 Lu

Original comment by coderazzi on 3 Oct 2012 at 1:10

GoogleCodeExporter commented 9 years ago
agreed - thanks for the details

Original comment by altm...@gmail.com on 3 Oct 2012 at 7:20