Raaam
Raaam

Reputation: 105

How to edit a jface table which holds a list of string as the model

I have created a table viewer with input as a List<String> with the default array-content provider, column label provider.

In addition to that I have added the EditingSupport for that column.

EditingSupport#setValue(java.lang.Object element, java.lang.Object value)

The problem am facing is not able to change the string contents after the cell is being edited. Using a default TextCellEditor.

In the function setValue the element and value are strings. Can anyone provide some suggestions.

Upvotes: 0

Views: 118

Answers (1)

greg-449
greg-449

Reputation: 111142

Since it is not possible to change the value of a String you will have to change the model used by your content provider to use a class which contains the string. You can then call methods of that class to set the new value.

Upvotes: 1

Related Questions