在 RCP TableViewer 中手动触发 CellEditor
当先前的编辑完成时,我想通过自动跳转到表格查看器中的下一个单元格来安慰用户。用户需要修改条目列表中的开始-结束时间。我想知道如何手动(以编程方式)触发特定单元格的 CellEditor。我以前没有在 Eclipse 中见过这种情况,所以这次“猴子看,猴子做”似乎没有帮助。 :)
感谢您的宝贵时间
I'd like to comfort the user by automatically jump to the next cell in a tableviewer, when a previous editing is completed. The user needs to modify start- endtimes in a list of entries. I was wondering how am I supposed to manually (programatically) trigger the CellEditor for a specific cell. I haven't seen that before in Eclipse, so "monkey see, monkey do" doesn't seem to help this time. :)
Thanks for your time
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不是完整的答案,但可能对您的问题有足够的帮助。
首先您需要检测编辑何时完成。如果单元格编辑器允许文本输入,则很困难;如果它提供用于选择元素的组合框,则更容易。
您可以将 ICellEditorListener 添加到 CellEditor。每当编辑器值发生更改时都会调用侦听器。这是检查编辑是否完成的触发器,如果是,则继续到“下一个”单元格编辑器(因此您必须定义一个单元格编辑器序列来查找下一个单元格编辑器序列。一个简单的 Map 就足够了)。
希望有帮助!
Not a complete answer but maybe helpful enough for your problem..
First you need to detect when the editing is completed. Difficult, if the cell editor allows for text inputs, easier, if it provides a combo box for selecting an element.
You can add a ICellEditorListener to a CellEditor. The listener is called whenever the editor value has changed. And this is the trigger to check if the editing is completed and, if yes, proceed to the 'next' cell editor (so you have to define a cell editor sequence to lookup the next one. A simple Map could be enough).
Hope it helps!