[英]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. 我已经创建了一个表查看器,其输入为带有默认数组内容提供程序,列标签提供程序的
List<String>
。
In addition to that I have added the EditingSupport for that column. 除此之外,我还为该列添加了EditingSupport。
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.
使用默认的TextCellEditor。
In the function setValue
the element and value are strings. 在函数
setValue
,元素和值是字符串。 Can anyone provide some suggestions. 谁能提供一些建议。
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. 由于无法更改
String
的值,因此您将必须更改内容提供商使用的模型以使用包含字符串的类。 You can then call methods of that class to set the new value. 然后,您可以调用该类的方法来设置新值。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.