TableViewer 中的表行是否有悬停事件
我有一个 JFace 表查看器,它由大量行组成,我认为如果每行都有一个简短的描述会更好,作为一种解决方法,我试图实现双击监听器,但这不适合我的需要,我不知道是否有像悬停这样的事件,它显示一个工具提示,其中包含有关特定行的简要信息。
i have a JFace table-viewer, which consists of large number of rows, i thought that it would be better if there is a short description for each row,as a workaround i was trying to implement doubleclick listner but that's not apt to my need,i don't know if there is an event like hover for this,which shows a tooltip containing a brief info about the particular row.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这个问题的答案在某种程度上取决于表格查看器的具体实现。话虽如此,主要选项是:
MouseTrackListener
添加到基础表SWT.MouseHover
的 SWTListener
添加到基础表CellLabelProvider
,看看各种getToolTip...(Object)
方法对于前两个,您必须自己找出行元素 - 看看
event.item.getData()
,而这是在最后一个选项中提供给您的...The answer to this question depends somewhat on the exact implementation of your table viewer. Having said that, the primary options are:
MouseTrackListener
to the underlying tableListener
forSWT.MouseHover
to the underlying tableCellLabelProvider
, have a look at the variousgetToolTip...(Object)
methodsFor the first two, you have to figure out the row element yourself - look at
event.item.getData()
, whereas that is provide to you in the last option...