A metamodel administrator may provide label decorations and filters that the end-user can activate or deactivate at any time in the model editor. He may also contribute to display the documentation of model elements in tooltips.
Keywords: keywords are used to create a lightweight connections between views displaying various model elements and viewer participants (label decorators, content providers and filters). Rather than explicitly having to reference specific views, a viewer participant states the kind of elements it can handle, though the use of keywords. Each view declares the keywords it can handle, letting the platform bind the corresponding viewer participants.
Here are some notable keywords:
Keyword | Description | Class |
instance |
instances contained in a model | com.sodius.mdw.model.MDWObject |
feature |
feature of a metatype | org.eclipse.emf.ecore.EStructuralFeature |
attribute |
attribute of a metatype | org.eclipse.emf.ecore.EAttribute |
reference |
reference of a metatype | org.eclipse.emf.ecore.EReference |
<!ELEMENT extension (labelDecorator* , viewerFilter* , contentProvider* , documentationProvider*)>
<!ATTLIST extension
point CDATA #REQUIRED
id CDATA #IMPLIED
name CDATA #IMPLIED>
<!ELEMENT labelDecorator EMPTY>
<!ATTLIST labelDecorator
id CDATA #REQUIRED
name CDATA #REQUIRED
description CDATA #IMPLIED
metamodel CDATA #IMPLIED
class CDATA #REQUIRED
enabled (true | false)
keywords CDATA #REQUIRED>
a decorator in charge to customize the labels of model elements. This is used for example by the platform to suffix model elements with their respective type names. A decorator may be activated or deactivated at any time by the user.
org.eclipse.jface.viewers.ILabelDecorator
<!ELEMENT viewerFilter EMPTY>
<!ATTLIST viewerFilter
id CDATA #REQUIRED
name CDATA #REQUIRED
description CDATA #IMPLIED
metamodel CDATA #IMPLIED
class CDATA #REQUIRED
enabled (true | false)
keywords CDATA #REQUIRED>
a filter used to hide some model elements based on a specific criterium. A filter may be activated or deactivated at any time by the user.
org.eclipse.jface.viewers.ViewerFilter
<!ELEMENT contentProvider EMPTY>
<!ATTLIST contentProvider
id CDATA #REQUIRED
name CDATA #REQUIRED
description CDATA #IMPLIED
metamodel CDATA #IMPLIED
enabled (true | false)
keywords CDATA #REQUIRED
contentProvider CDATA #REQUIRED
labelProvider CDATA #IMPLIED
viewerSorter CDATA #IMPLIED
viewerFilter CDATA #IMPLIED
priority (highest|higher|high|normal|low|lower|lowest) >
a content provider used to add additional contents to elements displayed in the model editor. A content provider may be activated or deactivated at any time by the user.
org.eclipse.jface.viewers.ITreeContentProvider
org.eclipse.jface.viewers.ILabelProvider
, in case provided elements cannot be correctly displayed by the default label provider.org.eclipse.jface.viewers.ViewerFilter
, to add a filter when this content provided is activated.<!ELEMENT documentationProvider EMPTY>
<!ATTLIST documentationProvider
id CDATA #REQUIRED
metamodel CDATA #REQUIRED
class CDATA #REQUIRED>
provides documentation for model elements of a particular metamodel. This documentation is shown in a tooltip in the model editor. Only one documentation provider may be contributed per metamodel. For example, a documentation provider is contributed by UML 2.1 metamodel to show the body of the first Comment attached to a model element.
Following is an example of a Documentation Provider extension for the UML 2.1 metamodel:<extension point=
"com.sodius.mdw.platform.model.viewerParticipant"
>
<labelDecorator class=
"com.sodius.mdw.ext.platform.model.adapter.SuffixTypeDecorator"
description=
"Suffix instances with their type name.\ne.g. MyClass (Class)"
enabled=
"true"
id=
"com.sodius.mdw.platform.model.SuffixTypeDecorator"
keywords=
"instance"
name=
"Suffix instances with type name"
/>
</extension>
<extension point=
"com.sodius.mdw.platform.model.viewerParticipant"
>
<documentationProvider class=
"com.sodius.mdw.metamodel.uml21.ide.UMLDocumentationProvider"
id=
"com.sodius.mdw.metamodel.uml21.documentationProvider"
metamodel=
"uml21"
/>
</extension>
SODIUS