[SWINGX-1470] AutoCompleteDecorator fails to undecorate Created: 03/Nov/11  Updated: 14/Nov/12  Resolved: 14/Nov/12

Status: Resolved
Project: swingx
Component/s: Autocomplete
Affects Version/s: 1.6.1
Fix Version/s: 1.6.5

Type: Bug Priority: Minor
Reporter: MikeAdler Assignee: Karl Schaefer
Resolution: Works as designed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Windows XP, Java SE 6



 Description   

Calling AutoCompleteDecorator.decorate on a JTextField does not remove previous decorations.
This results in the AutoComplete list shrinking to nothing when the argument Lists are disjunctive.

Code example:

class MyEditor extends DefaultCellEditor {

public MyEditor() {
super(new JTextField());
}

public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) {
JTextField field = (JTextField) super.getTableCellEditorComponent(table, value, isSelected, row, column);

List<String> suggestions = this.getSuggestions(column, value);

if (column == 2)

{ AutoCompleteDecorator.decorate(field, suggestions, true); }

if (column == 3)

{ AutoCompleteDecorator.decorate(field, suggestions, false); }

return field;
}

Now, when the editor is called on column 2, field is decorated. When it is subsequently called on column 3, there are no suggestions in the list.

This may be worked around by making AutoCompleteDecorator.undecorate() accessible.



 Comments   
Comment by Karl Schaefer [ 06/Feb/12 ]

Do you can a runnable test case?

Comment by Karl Schaefer [ 14/Nov/12 ]

You need to use a separate editor for each column.

Generated at Tue Dec 06 15:54:47 UTC 2016 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.