Finally, give this TreeViewer an input node.
最后,为这个TreeViewer给定一个输入节点。
To design a TreeViewer demo application, you must create your node class as your data model.
要设计TreeViewer演示应用程序,您必须创建节点类作为数据模型。
First, we create one TreeViewer that can display NBA or MLB players according to your choice.
首先,创建一个可以根据选择显示NBA或MLB球员的TreeViewer。
The idea is that a TreeViewer knows about the root element of the tree that it is going to display.
这里的想法是TreeViewer知道要显示的树的根元素。
Just like the TreeViewer, it has an input (a root object), a content provider, and a label provider.
和TreeViewer一样,它有输入(根对象)、内容提供程序和标签提供程序。
Then we set the desired layout of this tree and add the tree content provider and tree label provider instance to this TreeViewer.
然后设定此树的期望布局并向此TreeViewer中添加树内容提供程序和树标签提供程序实例。
The TreeViewer doesn't talk to the domain objects directly. Instead, it uses another object called a ContentProvider, and this object uses your domain objects, as shown in Figure 7.
TreeViewer并不直接使用域对象 —而是使用另一个名为ContentProvider 的对象,这个对象才使用域对象,如图 7 所示。
After extending org.eclipse.ercp.eworkbench.applications, we create a TreeViewer instance and associate with the current composite in createPartControl methods in the generated SampleView class.
在扩展 org.eclipse.ercp.eworkbench.applications 之后,我们将创建TreeViewer实例并与生成的SampleView类的createPartControl方法中的当前复合内容关联起来。
After extending org.eclipse.ercp.eworkbench.applications, we create a TreeViewer instance and associate with the current composite in createPartControl methods in the generated SampleView class.
在扩展 org.eclipse.ercp.eworkbench.applications 之后,我们将创建TreeViewer实例并与生成的SampleView类的createPartControl方法中的当前复合内容关联起来。
应用推荐