To design a TableViewer demo application, you must create a data model class.
要设计TableViewer演示应用程序,您必须创建数据模型类。
The method to set the input object is the same as before: TableViewer: void setInput(Object rootElement).
设置输入对象的方法与前面相同
The view chooses to register the JFace TableViewer that it created, as a selection provider for two reasons.
这个视图将它创建的JFaceTableViewer注册为选择提供器有两个原因。
The view plans to use the TableViewer to display its information, and the user will interact with the TableViewer.
这个视图打算使用这个TableViewer显示信息,而且用户将与TableViewer进行交互。
The TableViewer implements the selection provider interface and can source selection events to the workbench part site.
TableViewer 实现了选择提供器接口并能够向工作台部分站点传播选择事件。
Finally, set table content provider and table label provider and give this TableViewer input. (in other words, feed it data.)
最后,设定tablecontentprovider和tablelabel provider并提供此TableViewer输入(换言之,为它提供数据)。
This code enables any UI selection changes in the TableViewer to propagate to the page and finally to the interested consumer views.
这些代码使TableViewer中的任何UI选择改变能够传播到页面,并最终传播到对这种事件感兴趣的消费者视图。
The code snippet in Listing 2 shows the createPartControl() method of a view that creates a JFace TableViewer and adds it as a selection provider to the workbench site.
清单2中的代码片段显示一个视图的createPartControl()方法,这个方法创建一个JFaceTableViewer并将它作为选择提供器添加到工作台站点。
We'll change it to multiselect by adding it as another bit (literally) of the style argument when we create the table viewer: new TableViewer(sash_form, SWT.BORDER | SWT.FULL_SELECTION | SWT.MULTI);.
可以通过在创建表查看器时将多选方式作为样式参数的另一位(以文字表示)添加,将表查看器更改为多选方式。
We'll change it to multiselect by adding it as another bit (literally) of the style argument when we create the table viewer: new TableViewer(sash_form, SWT.BORDER | SWT.FULL_SELECTION | SWT.MULTI);.
可以通过在创建表查看器时将多选方式作为样式参数的另一位(以文字表示)添加,将表查看器更改为多选方式。
应用推荐