模型查看器插件—提供的视图可以帮助您轻松地导航和查看关于模型实例内容的详细信息。
Model viewer plug-in - provides views that you can use to easily navigate and see details about the content of a model instance.
可能得到的子元素规定了扩展何时为查看器中的对象提供父对象,在本文的例子中,这些对象指的是EMF模型对象或资源的实例。
The possible children element dictates when our extension can provide parents for objects in the viewer, in our case these are objects that are instances of EMF model objects or resources.
这个导航器仍然不是我们所需要的,因此我们要添加在查看器中显示emf模型的功能。
This navigator is still not what we want, so we need to add the ability to display an EMF model in the viewer.
我们的例子使用了XML数据格式,它定义了矩阵查看器显示的所有矩阵的模型内容。
Our example uses an XML data format that defines the entire model contents for any matrix to be displayed by the matrix viewer.
然后,将图模型对象传递给查看器。
在本文的例子中,当查看器包含有作为emf模型的实例的对象时,将调用导航器内容。
In our case, our navigator content will be invoked when the viewer contains an object that is an instance of an EMF model.
我们已经完成了设定的任务:在查看器中显示EMF模型内容。
We have accomplished what we set out to do: to make EMF model content display in a viewer.
我们已经完成创建插件以便在查看器中显示EMF模型内容的任务。
We have completed our task of creating a plug-in that will display EMF model content in a viewer.
要测试ecore模型中的更改在查看器中得到了反映,我们将只需重新运行应用程序并开始做出更改即可。
To test that changes in the Ecore model are being reflected in the viewer, we will simply rerun our application and start making some changes.
它对应于模型中最顶部的元素,并且其父元素为查看器的根editpart(请参阅图4)。
It corresponds to the top-most element in the model, and is parented by the viewer's root EditPart (see Figure 4).
它对应于模型中最顶部的元素,并且其父元素为查看器的根editpart(参见图4)。
It corresponds to the top-most element in the model and is parented by the viewer's root EditPart (see Figure 4).
它为IResource模型提供了声明性的查看器扩展。
It provides declarative viewer extensions for the IResource model.
在本文最后,我们将拥有一个查看器插件,用于浏览ecore模型(见图1右侧)。
By the end of this article, we will have a viewer plug-in that can be used to navigate an Ecore model (see right side of Figure 1).
通常,EMF项目资源 — 如 EMFEcore模型 —作为查看器中的单个对象进行显示(见图1的左侧)。
Typically, EMF project resources — EMF Ecore models, for example — are displayed as single objects in a viewer (see left side of Figure 1).
要让它刷新当前显示的模型,我们必须让查看器意识到编辑器中做出了更改,并强制刷新。
It will not refresh them unless we make the viewer aware of changes made in the editor and force it to refresh itself.
一个需要注意的重要方面是,树形查看器通过称为内容提供程序的适配器访问模型对象,并使用标签提供程序确定显示对象的方式。
One important aspect to note is that tree viewers access model objects through an adapter called a content provider and determine how the object should be visualized through a label provider.
在设定查看器的内容时,您可以通过为该查看器提供表示输入的模型对象来完成。
When you set the viewer's contents, you do so by providing the model object that represents the input for that viewer.
如果您的应用程序使用了这种通知模型,您可能要为每个查看器添加一个域侦听器。
If your application employs this notification model, you will probably add a domain listener per viewer.
构建查看器涉及大多数X Forms的一个典型部分——X Forms模型,XForms模型被划分为实例数据(我们示例中的场景)和本地状态数据。
Building the viewer involves what is a fairly classic division common to most XForms — an XForms model that is split into the instance data, which is the scenario in question, and local state data.
最后,将我们创建的导航器内容绑定到视图,我们将使用先前同样的方法将IResource模型内容扩展包含到查看器内容绑定。
Finally, to bind the navigator content we have created to our view, we will use the same method we did earlier to include the IResource model content extension to the viewer content binding.
最后,将我们创建的导航器内容绑定到视图,我们将使用先前同样的方法将IResource模型内容扩展包含到查看器内容绑定。
Finally, to bind the navigator content we have created to our view, we will use the same method we did earlier to include the IResource model content extension to the viewer content binding.
应用推荐