以编程方式滚动 SWT 表 [英] Scrolling SWT Table programmatically

查看:37
本文介绍了以编程方式滚动 SWT 表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何以编程方式垂直滚动 SWT 表?我正在桌子上实现搜索功能.找到项目后,它将滚动到找到的项目.

How to do vertical scroll of SWT table programatically? I'm implementing search function on the table. When an item was found then it will be scrolled to the item found.

推荐答案

您可能想尝试以下几种方法:

There are several methods you might want to try:

Table.showItem(TableItem)
Table.showSelection()
Table.showColumn(TableColumn)
Table.setTopIndex(int)

除此之外,我建议使用来自 JFace 的 TableViewer.然后你会用这个方法滚动到一个项目:

Other than that, I suggest using a TableViewer from JFace. Then you'd scroll to an item with this method:

TableViewer.reveal(Object)

这篇关于以编程方式滚动 SWT 表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆