Presentation Decorator Providers
Identifier:
org.eclipse.gmf.runtime.diagram.ui.decoratorProviders
Description:
This extension point is used to define decorator providers for the decorator service (
org.eclipse.gmf.runtime.diagram.ui.services.decorator).
The Decoration Service gives clients the ability to decorate diagram elements with an image or figure.
More specifically, the provider service allows implementors to do the following:
-A provider of the decoration service will be able to add an adornment to any diagram element.
-The decoration is typically an image, but can be any sort of graphics object or figure. A provider of the decoration service is not restricted to any specific graphic type.
-The provider can specify any of the following enumerated locations for a decoration on a shape, label, or list compartment item: center, north, northeast, northwest, south, southeast, southwest, east, west. For a connector, the percentage of the distance from the source end of the connector is used to provide a location for the decoration.
-The decoration can be any size that fits within the shape or connector boundary.
-The decoration would be justified accordingly to its position on the shape, i.e. northwest would be left justified with an offset from the top left hand side of the shape and northeast would be right justified with an offset from the top right hand side of the shape.
-Each decoration can either be included in the printed output of the diagram or not.
-If more than one provider adds a decoration to the same location, the decoration from the highest priority provider will appear on top of the other decoration(s).
Configuration Markup:
<!ELEMENT extension (
decoratorProvider)>
<!ATTLIST extension
point CDATA #REQUIRED
id CDATA #IMPLIED
name CDATA #IMPLIED
>
Describes the extension point.
-
point - The identifier of the extension point, i.e. org.eclipse.gmf.runtime.diagram.ui.decoratorProviders
-
id - The identifier of the extension, e.g. myDecoratorProvider.
-
name - The name of the extension, e.g. %ext.myDecoratorProvider.
<!ELEMENT decoratorProvider (
Priority ,
object* ,
context*)>
<!ATTLIST decoratorProvider
class CDATA #REQUIRED
>
The decorator provider description tag.
-
class - The fully qualified name of the decorator provider class, e.g. org.eclipse.gmf.runtime.diagram.ui.providers.MyDecoratorProvider.
This decoration provider class should implement the org.eclipse.gmf.runtime.diagram.ui.services.decorator.IDecoratorProvider
interface.
<!ELEMENT Priority EMPTY>
<!ATTLIST Priority
name (Lowest|Low|Medium|High|Highest)
>
The description for the priority of the decorator provider
<!ELEMENT object (
method* ,
staticMethod*)>
<!ATTLIST object
id CDATA #REQUIRED
class CDATA #IMPLIED
>
A descriptor of an object that is examined by this provider. The object can have an optional set of methods to call upon.
-
id - A unique (within the context of this provider XML definition) identifier for the object
-
class - The fully qualified name of a class/interface who is assignable from or adaptable to the object. The name could be followed (between parenthesis "()") by the id of a plugin whose classloader is able to load that class. The finaly syntax is:
className<(plugin id)>?
<!ELEMENT method (
value* ,
notValue*)>
<!ATTLIST method
name CDATA #REQUIRED
value CDATA #IMPLIED
notValue CDATA #IMPLIED
>
A method to call by reflection on the object. The method has a name and a value. The value could be described by its string representation (value & notValue), or as an object "value" or "notValue".
The rules of evaluation are as follows:
1- The return value string has to be in the "value" string set.
2- The return value string has to be not in the "notValue" string set.
3- The return value object has to be in the "value" object set.
4- The return value object has to be not in the "notValue" object set.
<!ELEMENT value (
method*)>
<!ATTLIST value
class CDATA #IMPLIED
>
A descriptor of an object that represents a method's returned value. The descriptor can include an optional set of methods to call on the "value" object.
-
class - The fully qualified name of a class/interface that is assignable from or adaptable to the "value" object. The name could be followed (between paranthesis "()") by the id of a plugin whose classloader is able to load that class. The finaly syntax is:
className<(plugin id)>?
<!ELEMENT notValue (
method*)>
<!ATTLIST notValue
class CDATA #IMPLIED
>
A descriptor of an object that represents a method's returned value that is not required. The descriptor can include an optional set of methods to call on the "notValue" object.
-
class - The fully qualified name of a class/interface that is assignable from or adaptable to the "value" object. The name could be followed (between paranthesis "()") by the id of a plugin whose classloader is able to load that class. The finaly syntax is:
className<(plugin id)>?
<!ELEMENT context EMPTY>
<!ATTLIST context
decoratorTargets CDATA #IMPLIED
>
The context contains a list of objects to be decorated using this provider.
The list defined in decoratorTargets is comprised of items previously defined in the XML using the object element.
-
decoratorTargets - The decoratorTargets is a comma-separated list of objects that are supported by this provider.
The xml defined object is specified using its id.
<!ELEMENT staticMethod (
value* ,
notValue*)>
<!ATTLIST staticMethod
name CDATA #REQUIRED
value CDATA #IMPLIED
notValue CDATA #IMPLIED
>
A static method to call by reflection on the class.
The static method has a name and a value. The value could be described by its string representation (value & notValue), or as an object "value" or "notValue".
The rules of evaluation are as follows:
1- The return value string has to be in the "value" string set.
2- The return value string has to be not in the "notValue" string set.
3- The return value object has to be in the "value" object set.
4- The return value object has to be not in the "notValue" object set.
-
name - The name of the Static Method, the format should be PluginID\ClassName.method followed by an optional paramter set between paranthesis "()". The parameter set can contain any number of primitive parameters or %Context(pluginID/className) to use the context object as a parameter . other param types are not supported. The method name could contain nested calling separated by "." The general format for this method name is : *>?).<*>?)>*
-
value - A comma-separated (",") list of string representations of the method return value. The string representation of the value is expected to be "one" of those in the list. The syntax to use is the following:
<,>*
If (",") is expected to be in one of the strings, it has to be escaped by a forward slash ("\"). "null" is accepted as a string and it means (a null object).
-
notValue - A comma-separated (",") list of string representations of the method return value that is not expected (the execulsion set). The string representation of the value is expected "not" to be "one" of those in the list. The syntax to use is the following:
<,>*
If (",") is expected to be in one of the strings, it has to be escaped by a forward slash ("\"). "null" is accepted as a string and it means (a null object).
Examples:
An extension to the decorator service would require the implementation of the IDecorator and IDecoratorProvider interfaces.
The following is an example plugin.xml entry for a decorator service provider extension:
<extension
id=
"myDecoratorProvider"
name=
"%ext.myDecoratorProvider"
point=
"org.eclipse.gmf.runtime.diagram.ui.decoratorProviders"
>
<decoratorProvider class=
"org.eclipse.gmf.runtime.diagram.ui.providers.MyDecoratorProvider"
>
<Priority
name=
"Lowest"
>
</Priority>
<object class=
"org.eclipse.gmf.runtime.notation.Node(org.eclipse.gmf.runtime.notation)"
id=
"NODE"
>
<method
name=
"getType()"
value=
"MyNodeType"
>
</method>
</object>
<context
decoratorTargets=
"NODE"
>
</context>
</decoratorProvider>
</extension>
Copyright (c) 2003, 2004 IBM Corporation and others.
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
which accompanies this distribution, and is available at
https://www.eclipse.org/legal/epl-v10.html