JFace对SWT添加什么? [英] What does JFace add to SWT?

查看:189
本文介绍了JFace对SWT添加什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下之间有什么区别:


  1. TreeViewer&树

  2. TableViewer&表

  3. TreeViewerColumn& TreeColumn

  4. TableViewerColumn& TableColumn

  1. TreeViewer & Tree
  2. TableViewer & Table
  3. TreeViewerColumn & TreeColumn
  4. TableViewerColumn & TableColumn

何时使用viewer&常规小部件?

When to use viewer & regular widget?

PS:如果您能帮助我找到一个了解他们的好资源,这将是一个很大的帮助。提前谢谢!

PS: It would a great help if you can help me find a good resource for understanding them.Thanks in advance!

推荐答案

你可以把你的问题标题为JFace添加到SWT中的内容。

You could have titled your question "What does JFace add to SWT ?".

来自JFace,Widget来自SWT。

Viewers are from JFace, Widgets are from SWT.

总而言之,JFace使Widget易于操作并插入到GUI中。 JFace可以让您免受操作SWT窗口元素的所有苦难,从而向静态窗口小部件添加行为。 SWT只是提供听众,JFace使用这些听众来让你专注于现实世界模型和SWT表现之间的映射。

In summary, JFace make Widgets easy to manipulate and insert into a GUI. JFace frees you from all the drudgery of manipulating SWT widget elements to add behaviour to static widgets. SWT just provides listeners, JFace uses these listeners for you to allow you to concentrate on the mapping between the real world model and its SWT representation.

我们来看看具体的


  1. 如果您构建标准的SWT小部件,则必须描述树的内容(设置一个或多个顶级项目,将一些TreeItem挂钩到每个根,可能添加选择侦听器),然后管理其所有转换。该树将内置非常少的逻辑:只是压缩/扩展和选择监听器。期间。

    这将是一个静态树。

    TreeViewer将允许您在该树中注入许多不同类型的行为:如何填充,过滤,TreeItems如何标记。

    您将通过注册满足指定接口的类来实现(例如,ILabelProvider将允许您将TreeItem标签映射到文件夹中的文件名)。

    没有TreeViewer,建立一个体面的响应树将是很多辛勤工作。总之,它可以轻松地将基础的真实世界层次模型映射到SWT树表示。

  1. If you build a standard SWT widget, you will have to describe the content of a Tree (set one or more top items, hook some TreeItems to each root, possibly add a selection listener) and then manage all its transitions. That Tree will have very little built in logic: just collapse/expand and selection listeners. Period.
    That will be a static Tree.
    A TreeViewer will allow you to inject many different kinds of behaviours in that Tree: How it is populated, filtered, how the TreeItems are labelled.
    You will do that by registering classes satisfying to well specified interfaces (for instance the ILabelProvider will allow you to map a TreeItem label to a file name in a folder).
    Without the TreeViewer, building a decent responsive tree would be a lot of hard work. In summary, it makes it easy to map the underlying real world hierarchical model to the SWT Tree representation.

同样适用于TableViewer。 TableViewer允许您向表中添加一些自定义行为。例如,您如何编辑单元格。

The same holds true for a TableViewer. A TableViewer allows you to add some custom behaviour to your table. How do you edit a cell for instance.

TreeViewerColumn。很久以前(3.3之前),SWT Trees没有列。树没有列列有列,但没有展开/折叠。从3.3起,您可以向树中添加列。通过将TreeViewerColumn添加到TreeViewer,而不是通过将TreeColumn添加到Tree(您仍然需要执行),因为与上述相似的原因,您可以更好地执行此操作,您可以添加对列单元格内容的编辑支持您可以填充列(通过再次编写Label Provider)。

TreeViewerColumn. A long time ago (before 3.3), SWT Trees did not have columns. Trees did not have Columns Tables had columns but they did not expand/colapse. Since 3.3 you can add columns to a Tree. You do this better with by adding a TreeViewerColumn to your TreeViewer rather than by just adding a TreeColumn to a Tree (which you still have to do) for reasons similar to the ones above, you can add support for editing the content of the column cells and you can populate the column (by writing a Label Provider again).

TableViewerColumn。 TableViewers相同的事情:添加版本和内容管理。

TableViewerColumn. Same thing for TableViewers : adds edition and content management.

对于SWT / JFace文档,请查看。

For SWT/JFace doc, please have a look at.


  1. 属于JFace的观众不要SWT正确,向前看,在Google上查找JFace教程,你会发现很多例子。

  1. Viewers belonging to JFace not to SWT proper, to go forward, look up JFace tutorials on google and you'll find a lot of examples.

Steve Northover的书(父亲SWT)SWT:标准小部件工具包第1卷(AFAIK还没有第二卷)。

Steve Northover's book (the father SWT) "SWT: The Standard Widget Toolkit, Volume 1" (AFAIK there's no second volume yet).

Eric:建立商业质量插件由Eric Clayberg和Dan Rube。 Eric现在是Google副总裁,并且是 WindowBuilder Pro 的父亲

"Eclipse: Building Commercial-Quality Plug-ins" by Eric Clayberg and Dan Rube. Eric is now a Google VP and the father of WindowBuilder Pro

SWT片段也是一个快速-track to masterping SWT objects。

The SWT snippets are also a fast-track to mastering SWT objects.

其他好书包括



  • Manning的SWT / JFAce在行动

这篇关于JFace对SWT添加什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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