]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.ui/schema/resourceEditorAdapter.exsd
Fixed all line endings of the repository
[simantics/platform.git] / bundles / org.simantics.ui / schema / resourceEditorAdapter.exsd
1 <?xml version='1.0' encoding='UTF-8'?>
2 <!-- Schema file written by PDE -->
3 <schema targetNamespace="org.simantics.ui" xmlns="http://www.w3.org/2001/XMLSchema">
4 <annotation>
5       <appInfo>
6          <meta.schema plugin="org.simantics.ui" id="resourceEditorAdapter" name="Resource Editor Adapter"/>
7       </appInfo>
8       <documentation>
9          &lt;p&gt;
10 This extension point allows definition of adapter classes that can open views or editors for specified input selections.
11 &lt;/p&gt;
12
13 &lt;p&gt;
14 A priority can be associated to each adapter to provide an ordering for adapters that can handle a specified input. Default priority is 0.
15 &lt;/p&gt;
16
17 &lt;p&gt;
18 A group can be assigned for adapters that allows shadowing based on adapter priority. Only the highest priority adapter of all adapters belonging to the same group will be selected when requesting for suitable adapters for an input. See the extension point description element descriptions for details.
19 &lt;/p&gt;
20       </documentation>
21    </annotation>
22
23    <element name="extension">
24       <annotation>
25          <appInfo>
26             <meta.element />
27          </appInfo>
28       </annotation>
29       <complexType>
30          <sequence>
31             <element ref="group" minOccurs="0" maxOccurs="unbounded"/>
32             <element ref="adapter" minOccurs="0" maxOccurs="unbounded"/>
33             <element ref="adapterClass" minOccurs="0" maxOccurs="unbounded"/>
34          </sequence>
35          <attribute name="point" type="string" use="required">
36             <annotation>
37                <documentation>
38                   
39                </documentation>
40             </annotation>
41          </attribute>
42          <attribute name="id" type="string">
43             <annotation>
44                <documentation>
45                   
46                </documentation>
47             </annotation>
48          </attribute>
49          <attribute name="name" type="string">
50             <annotation>
51                <documentation>
52                   
53                </documentation>
54                <appInfo>
55                   <meta.attribute translatable="true"/>
56                </appInfo>
57             </annotation>
58          </attribute>
59       </complexType>
60    </element>
61
62    <element name="adapter">
63       <annotation>
64          <appInfo>
65             <meta.element labelAttribute="editorId" icon="image"/>
66          </appInfo>
67          <documentation>
68             This element specifies an adapter that can be used to open an eclipse editor part for a database resource of the specified type.
69          </documentation>
70       </annotation>
71       <complexType>
72          <choice minOccurs="0" maxOccurs="1">
73             <element ref="inContext" minOccurs="1" maxOccurs="unbounded"/>
74          </choice>
75          <attribute name="editorId" type="string" use="required">
76             <annotation>
77                <documentation>
78                   The ID of an IEditorPart registered through the &lt;code&gt;org.eclipse.ui.editor&lt;/code&gt; extension point.
79                </documentation>
80             </annotation>
81          </attribute>
82          <attribute name="id" type="string">
83             <annotation>
84                <documentation>
85                   A unique identifier for this adapter.
86                </documentation>
87             </annotation>
88          </attribute>
89          <attribute name="groupId" type="string">
90             <annotation>
91                <documentation>
92                   A group identifier for this adapter. Adapters that belong to the same group shadow each other based on their priority - higher priority shadows lower.
93                </documentation>
94                <appInfo>
95                   <meta.attribute kind="identifier" basedOn="org.simantics.ui.resourceEditorAdapter/group/@id"/>
96                </appInfo>
97             </annotation>
98          </attribute>
99          <attribute name="type_uris" type="string">
100             <annotation>
101                <documentation>
102                   A comma-separated list of types that are accepted by this adapter, specified as URI strings. For example to accept only diagram instances, &lt;code&gt;http://www.vtt.fi/Simantics/Diagram/1.0/Types#Diagram&lt;/code&gt; would be given as the value.
103                </documentation>
104             </annotation>
105          </attribute>
106          <attribute name="priority" type="string" use="default" value="0">
107             <annotation>
108                <documentation>
109                   An integer number number to describe the importance of this adapter with respect to other adapters. A larger number means higher priority. A negative priority means that the action is never selected as a default performed action even if it is the only action available for the specified input.
110                </documentation>
111             </annotation>
112          </attribute>
113          <attribute name="label" type="string">
114             <annotation>
115                <documentation>
116                   An optional overriding label to describe this adapter. If not specified the label is retrieved from the &lt;code&gt;IEditorPart&lt;/code&gt; referenced by the editorId attribute.
117                </documentation>
118             </annotation>
119          </attribute>
120          <attribute name="image" type="string">
121             <annotation>
122                <documentation>
123                   An optional overriding image to describe this adapter. If not specified the image is retrieved from the &lt;code&gt;IEditorPart&lt;/code&gt; referenced by the editorId attribute.
124                </documentation>
125                <appInfo>
126                   <meta.attribute kind="resource"/>
127                </appInfo>
128             </annotation>
129          </attribute>
130       </complexType>
131    </element>
132
133    <element name="adapterClass">
134       <annotation>
135          <appInfo>
136             <meta.element labelAttribute="class"/>
137          </appInfo>
138          <documentation>
139             This element specifies a customized adapter that can be used to perform any activity when the user selects a database resource of an allowed type. Both, the decision of which resources are allowed and what kind of action to perform on the resource, are up to the &lt;code&gt;ResourceEditorAdapter&lt;/code&gt; extension specified by the &lt;code&gt;class&lt;/code&gt; attribute.
140          </documentation>
141       </annotation>
142       <complexType>
143          <choice minOccurs="0" maxOccurs="1">
144             <element ref="inContext" minOccurs="1" maxOccurs="unbounded"/>
145          </choice>
146          <attribute name="id" type="string">
147             <annotation>
148                <documentation>
149                   A unique identifier for this adapter.
150                </documentation>
151             </annotation>
152          </attribute>
153          <attribute name="groupId" type="string">
154             <annotation>
155                <documentation>
156                   A group identifier for this adapter. Adapters that belong to the same group shadow each other based on their priority - higher priority shadows lower.
157                </documentation>
158                <appInfo>
159                   <meta.attribute kind="identifier" basedOn="org.simantics.ui.resourceEditorAdapter/group/@id"/>
160                </appInfo>
161             </annotation>
162          </attribute>
163          <attribute name="class" type="string" use="required">
164             <annotation>
165                <documentation>
166                   The class that implements the &lt;code&gt;org.simantics.ui.workbench.editor.EditorAdapter&lt;/code&gt; interface to perform the actions deemed necessary for a partciular adapter. Implementers must extend the AbstractResourceEditorAdapter class, otherwise the priority attribute will have no effect.
167                </documentation>
168                <appInfo>
169                   <meta.attribute kind="java" basedOn="org.simantics.ui.workbench.editor.AbstractResourceEditorAdapter:org.simantics.ui.workbench.editor.EditorAdapter"/>
170                </appInfo>
171             </annotation>
172          </attribute>
173          <attribute name="priority" type="string" use="default" value="0">
174             <annotation>
175                <documentation>
176                   An integer number number to describe the importance of this adapter with respect to other adapters. A larger number means higher priority. A negative priority means that the action is never selected as a default performed action even if it is the only action available for the specified input. This priority value will only have an effect if the class extends &lt;code&gt;org.simantics.proconf.ui.workbench.editor.AbstractResourceEditorAdapter&lt;/code&gt;.
177                </documentation>
178             </annotation>
179          </attribute>
180       </complexType>
181    </element>
182
183    <element name="group">
184       <complexType>
185          <attribute name="id" type="string" use="required">
186             <annotation>
187                <documentation>
188                   
189                </documentation>
190             </annotation>
191          </attribute>
192       </complexType>
193    </element>
194
195    <element name="inContext">
196       <annotation>
197          <documentation>
198             This element specifies a reference to a context (contributed via org.eclipse.ui.contexts).
199          </documentation>
200       </annotation>
201       <complexType>
202          <attribute name="id" type="string" use="required">
203             <annotation>
204                <documentation>
205                   A reference to the ID of a context extension in the org.eclipse.ui.contexts extension point.
206                </documentation>
207                <appInfo>
208                   <meta.attribute kind="identifier" basedOn="org.eclipse.ui.contexts/context/@id"/>
209                </appInfo>
210             </annotation>
211          </attribute>
212       </complexType>
213    </element>
214
215
216    <annotation>
217       <appInfo>
218          <meta.section type="examples"/>
219       </appInfo>
220       <documentation>
221          &lt;pre&gt;
222    &lt;extension
223          point=&quot;org.simantics.ui.resourceEditorAdapter&quot;&gt;
224       &lt;!-- A fully declarative editor adapter definition for graph resources. Editor is opened by SimpleEditorAdapter. --&gt;
225       &lt;adapter
226             editorId=&quot;org.simantics.example.diagramEditor&quot;
227             id=&quot;org.simantics.example.diagramEditor&quot;
228             priority=&quot;100&quot;
229             groupId=&quot;org.simantics.example.group&quot;
230             type_uris=&quot;http://www.simantics.org/Simantics/Diagram/2.0#Diagram&quot;&gt;
231          &lt;inContext
232                id=&quot;org.simantics.example.context&quot;&gt;
233          &lt;/inContext&gt;
234       &lt;/adapter&gt;
235       &lt;!-- A programmatic editor adapter definition, editor is opened by adapter class. --&gt;
236       &lt;adapterClass
237             class=&quot;org.simantics.example.MyEditorAdapter&quot;
238             id=&quot;org.simantics.example.myEditorAdapter&quot;
239             groupId=&quot;org.simantics.example.group&quot;
240             priority=&quot;50&quot;&gt;
241       &lt;/adapterClass&gt;
242    &lt;/extension&gt;
243 &lt;/pre&gt;
244       </documentation>
245    </annotation>
246
247
248    <annotation>
249       <appInfo>
250          <meta.section type="implementation"/>
251       </appInfo>
252       <documentation>
253          See &lt;code&gt;org.simantics.ui.workbench.editor.EditorRegistry&lt;/code&gt; for the front-end to this extension point.
254       </documentation>
255    </annotation>
256
257
258 </schema>