Each model element has attributes which describe its current state, e.g. the size and the position of a window. The application model also
expresses the relationship of the model elements via a hierarchy.
每个模型元素都有描述其当前状态的属性,例如窗口的大小和位置。应用程序模型还通过层次结构表示模型元素的关系。
The individual user interface widgets, which are displayed in a part, are not defined via the application model, e.g., the content of the part
is still defined by your source code.
单独的用户界面小部件(它们是在一个部件中显示的)不是通过应用程序模型来定义的。,该部分的内容仍然由源代码定义
If the application model was a house, it would describe the available rooms (parts) and their arrangement (perspectives, part stacks, part
sash containers), but not the furniture of the rooms. This is illustrated by the following image.
如果应用程序模型是一个房子,它将描述可用的房间(part)和他们的排列(透视图 perspectives,部件堆栈 part stacks,部件边框容器 part sash containers),而
不是房间的家具。如下图所示。
The base of the application model is typically defined as a static file. By default, it is called Application.e4xmi and located in the
main directory of the plug-in which defines the product extension. This file is read at application startup and is used to construct the initial
application model. Changes made by the user are persisted and re-applied at startup.
应用程序模型的基础通常定义为静态文件。默认情况下,它被称为 Application.e4xmi,位于插件的主目录中,它定义了产品的扩展名。此文件在应用
程序启动时读取,并用于构建初始应用程序模型。用户所做的更改在启动时被持久化并重新应用
The application model is extensible, e.g., other plug-ins can contribute to it via model processorsand model fragments.
应用程序模型是可扩展的。其他插件可以通过模型处理器和模型片段对其做出贡献。
7.2. Connecting model elements to classes and resources
将模型元素连接到类和资源
Model elements can point to a class or to a static resource via a Uniform Resource Identifier (URI). For this purpose Eclipse defines two
URI patterns. Eclipse instantiates the referred objects or resources in most cases lazily. For example, the classes for a part are instantiated
when the part gets visible.
模型元素可以通过统一资源标识符(URI)指向类或静态资源。为此目的,Eclipse 定义了两个 URI 模式。Eclipse 在大多数情况下使用惰性实例化所引用的对象或
资源。例如,当部件可见时,部件的类被实例化
The following table describes the support URI patterns. The example assumes that the bundle is called test to have a short name.
下表描述了支持 URI 模式。这个例子假设这个包叫做 test,它有一个短名称
Table 1. URI pattern for class and static file references 类和静态文件引用的 URI 模式
bundleclass://Bundle-
SymbolicName/package.classname
Example:
bundleclass://test/test.parts.MySavePart
Identifier for a Java class. It consists of the
following Java
类的标识符。它由以下内容组成
parts: bundleclass:// is a fixed
prefix. Bundle-SymbolicName is defined
in MANIFEST.MF file. The Bundle-
SymbolicName is followed by a '/' and the
fully qualified classname.
Used to identify resources. Identifier for a