1 <?xml version='1.0' encoding='UTF-8'?>
\r
2 <!-- Schema file written by PDE -->
\r
3 <schema targetNamespace="org.simantics.ui" xmlns="http://www.w3.org/2001/XMLSchema">
\r
6 <meta.schema plugin="org.simantics.ui" id="resourceEditorAdapter" name="Resource Editor Adapter"/>
\r
10 This extension point allows definition of adapter classes that can open views or editors for specified input selections.
\r
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.
\r
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.
\r
23 <element name="extension">
\r
31 <element ref="group" minOccurs="0" maxOccurs="unbounded"/>
\r
32 <element ref="adapter" minOccurs="0" maxOccurs="unbounded"/>
\r
33 <element ref="adapterClass" minOccurs="0" maxOccurs="unbounded"/>
\r
35 <attribute name="point" type="string" use="required">
\r
42 <attribute name="id" type="string">
\r
49 <attribute name="name" type="string">
\r
55 <meta.attribute translatable="true"/>
\r
62 <element name="adapter">
\r
65 <meta.element labelAttribute="editorId" icon="image"/>
\r
68 This element specifies an adapter that can be used to open an eclipse editor part for a database resource of the specified type.
\r
72 <choice minOccurs="0" maxOccurs="1">
\r
73 <element ref="inContext" minOccurs="1" maxOccurs="unbounded"/>
\r
75 <attribute name="editorId" type="string" use="required">
\r
78 The ID of an IEditorPart registered through the <code>org.eclipse.ui.editor</code> extension point.
\r
82 <attribute name="id" type="string">
\r
85 A unique identifier for this adapter.
\r
89 <attribute name="groupId" type="string">
\r
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.
\r
95 <meta.attribute kind="identifier" basedOn="org.simantics.ui.resourceEditorAdapter/group/@id"/>
\r
99 <attribute name="type_uris" type="string">
\r
102 A comma-separated list of types that are accepted by this adapter, specified as URI strings. For example to accept only diagram instances, <code>http://www.vtt.fi/Simantics/Diagram/1.0/Types#Diagram</code> would be given as the value.
\r
106 <attribute name="priority" type="string" use="default" value="0">
\r
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.
\r
113 <attribute name="label" type="string">
\r
116 An optional overriding label to describe this adapter. If not specified the label is retrieved from the <code>IEditorPart</code> referenced by the editorId attribute.
\r
120 <attribute name="image" type="string">
\r
123 An optional overriding image to describe this adapter. If not specified the image is retrieved from the <code>IEditorPart</code> referenced by the editorId attribute.
\r
126 <meta.attribute kind="resource"/>
\r
133 <element name="adapterClass">
\r
136 <meta.element labelAttribute="class"/>
\r
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 <code>ResourceEditorAdapter</code> extension specified by the <code>class</code> attribute.
\r
143 <choice minOccurs="0" maxOccurs="1">
\r
144 <element ref="inContext" minOccurs="1" maxOccurs="unbounded"/>
\r
146 <attribute name="id" type="string">
\r
149 A unique identifier for this adapter.
\r
153 <attribute name="groupId" type="string">
\r
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.
\r
159 <meta.attribute kind="identifier" basedOn="org.simantics.ui.resourceEditorAdapter/group/@id"/>
\r
163 <attribute name="class" type="string" use="required">
\r
166 The class that implements the <code>org.simantics.ui.workbench.editor.EditorAdapter</code> 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.
\r
169 <meta.attribute kind="java" basedOn="org.simantics.ui.workbench.editor.AbstractResourceEditorAdapter:org.simantics.ui.workbench.editor.EditorAdapter"/>
\r
173 <attribute name="priority" type="string" use="default" value="0">
\r
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 <code>org.simantics.proconf.ui.workbench.editor.AbstractResourceEditorAdapter</code>.
\r
183 <element name="group">
\r
185 <attribute name="id" type="string" use="required">
\r
195 <element name="inContext">
\r
198 This element specifies a reference to a context (contributed via org.eclipse.ui.contexts).
\r
202 <attribute name="id" type="string" use="required">
\r
205 A reference to the ID of a context extension in the org.eclipse.ui.contexts extension point.
\r
208 <meta.attribute kind="identifier" basedOn="org.eclipse.ui.contexts/context/@id"/>
\r
218 <meta.section type="examples"/>
\r
223 point="org.simantics.ui.resourceEditorAdapter">
\r
224 <!-- A fully declarative editor adapter definition for graph resources. Editor is opened by SimpleEditorAdapter. -->
\r
226 editorId="org.simantics.example.diagramEditor"
\r
227 id="org.simantics.example.diagramEditor"
\r
228 priority="100"
\r
229 groupId="org.simantics.example.group"
\r
230 type_uris="http://www.simantics.org/Simantics/Diagram/2.0#Diagram">
\r
232 id="org.simantics.example.context">
\r
235 <!-- A programmatic editor adapter definition, editor is opened by adapter class. -->
\r
237 class="org.simantics.example.MyEditorAdapter"
\r
238 id="org.simantics.example.myEditorAdapter"
\r
239 groupId="org.simantics.example.group"
\r
240 priority="50">
\r
241 </adapterClass>
\r
250 <meta.section type="implementation"/>
\r
253 See <code>org.simantics.ui.workbench.editor.EditorRegistry</code> for the front-end to this extension point.
\r