[英]How can I get table cell value as “xyz” WITHOUT hit the Enter or Tab key?
I found out if you editing a TableViewer cell without hit the Enter or Tab key. 我发现您是否在不按Enter或Tab键的情况下编辑TableViewer单元格。 Then the new cell value won't take effect.
这样,新的单元格值将不会生效。 For example, a table cell value is "abc" and you change it to "xyz".
例如,表单元格值为“ abc”,然后将其更改为“ xyz”。 Then when you read that table cell value, it still "abc".
然后,当您读取该表单元格值时,它仍为“ abc”。 You MUST hit the Enter or Tab key, then you will get that table cell value as "xyz".
您必须按下Enter或Tab键,然后您才能获得该表格单元格值“ xyz”。
How can I force that table cell value as "xyz" WITHOUT hit the Enter or Tab key? 如何在不按Enter或Tab键的情况下强制将表格单元格值设为“ xyz”?
Thanks very much in advance! 首先十分感谢!
i suggest you check the tableviewer api. 我建议您检查tableviewer api。 if it was a standard JTable you simply use this:
如果它是标准的JTable,则只需使用以下命令:
JTable table = new JTable(...);
table.putClientProperty("terminateEditOnFocusLost", Boolean.TRUE);
Temporally, i make a losing focus by set focus from current view to another view in RCP :). 暂时,我通过将焦点从当前视图设置为RCP中的另一个视图来失去焦点:)。 It's not official solution but effect.
这不是官方的解决方案,而是有效的解决方案。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.