org.eclipse.gmf.runtime.emf.type.core.elementTypes extension point is used to define application specializations of metamodel types for the following purposes:
The element type specializations may be used for menu or tool palette items for element creation.
Editing behaviour can be extended by associated an editHelperAdvice to a specialization, or
by contributing an adviceBinding that binds an editHelperAdvice to an element type. Edit helper advice is applied 'before' and/or 'after' the behaviour that is provided by the default metamodel editing behaviour.
Custom element types may be created by declaring an IElementTypeFactory which is responsible for creating all element types declaring the same 'kind' as the factory. Custom parameters may be associated with element types created this way.
<!ELEMENT extension (metamodel* , elementTypeFactory* , specializationType*)>
<!ATTLIST extension
point CDATA #REQUIRED
id CDATA #IMPLIED
name CDATA #IMPLIED>
org.eclipse.gmf.runtime.emf.type.core.elementTypes.<!ELEMENT metamodel (metamodelType* , specializationType* , adviceBinding*)>
<!ATTLIST metamodel
nsURI CDATA #REQUIRED>
This element is used to identify the metamodel for which a set of element types and advice bindings are defined. All eclass and eContainmentFeature values specified in the types must be found within this metamodel.
<!ELEMENT elementTypeFactory EMPTY>
<!ATTLIST elementTypeFactory
factory CDATA #REQUIRED
kind CDATA #REQUIRED
params CDATA #IMPLIED>
This element is used to contribute a factory that will create element types declaring the same 'kind' as the factory. Custom parameters may be associated with element types created this way.
org.eclipse.gmf.runtime.emf.type.core.IElementTypeFactory.<!ELEMENT metamodelType (param*)>
<!ATTLIST metamodelType
id CDATA #REQUIRED
icon CDATA #IMPLIED
name CDATA #IMPLIED
eclass CDATA #REQUIRED
edithelper CDATA #IMPLIED
kind CDATA #IMPLIED>
This element is used to define a new metamodel element type.
EClass instance from the metamodel specified in the enclosing metamodel element.org.eclipse.gmf.runtime.emf.type.core.edit.IEditHelper.IElementTypeFactory that is used to instantiate the element type. If it is not specified a default factory will be used to create the element.<!ELEMENT specializationType (specializes+ , (matcher | enablement) , param* , eContainer?)>
<!ATTLIST specializationType
id CDATA #REQUIRED
icon CDATA #IMPLIED
name CDATA #IMPLIED
edithelperadvice CDATA #IMPLIED
kind CDATA #IMPLIED>
This element is used to define a new specialization element type.
org.eclipse.gmf.runtime.emf.type.core.edit.IEditHelperAdvice. This attribute is used to specify the class that provides editing advice for elements of this type. Editing advice can be contributed before and/or after the default editing behaviour.IElementTypeFactory that is used to instantiate the element type. If it is not specified a default factory will be used to create the element.<!ELEMENT adviceBinding ((matcher | enablement) , eContainer)>
<!ATTLIST adviceBinding
typeId CDATA #REQUIRED
class CDATA #REQUIRED
inheritance (all|none) "none"
id CDATA #REQUIRED>
This element is used to bind an IEditHelperAdvice with an element type.
org.eclipse.gmf.runtime.emf.type.core.edit.IEditHelperAdvice. This attribute is used to specify the class that provides editing advice for elements of this type. Editing advice can be contributed before and/or after the default editing behaviour.<!ELEMENT specializes EMPTY>
<!ATTLIST specializes
id CDATA #REQUIRED>
This element is used to identify another element type (metamodel or specialization) that this type specializes.
<!ELEMENT matcher EMPTY>
<!ATTLIST matcher
class CDATA #REQUIRED>
This element is used to specify the class that will determine whether or not an existing model element matches this type.
org.eclipse.gmf.runtime.emf.type.core.IElementMatcher.<!ELEMENT eContainer (eContainmentFeature* , (matcher | enablement))>
This element is used to describe the qualities of the container model element for which this edit helper advice is relevant.
<!ELEMENT eContainmentFeature EMPTY>
<!ATTLIST eContainmentFeature
qname CDATA #REQUIRED>
This element is used to specify the containment feature for model elements for which this edit helper advice is relevant.
<!ELEMENT param EMPTY>
<!ATTLIST param
name CDATA #REQUIRED
value CDATA #REQUIRED>
A custom parameter name and value pair.
<!ELEMENT enablement (not , and , or , instanceof , test , systemTest , equals , count , with , resolve , adapt , iterate)*>
A generic root element. The element can be used inside an extension point to define its enablement expression. The children of an enablement expression are combined using the and operator.
<!ELEMENT not (not | and | or | instanceof | test | systemTest | equals | count | with | resolve | adapt | iterate)>
This element represent a NOT operation on the result of evaluating it's sub-element expression.
<!ELEMENT and (not , and , or , instanceof , test , systemTest , equals , count , with , resolve , adapt , iterate)*>
This element represent an AND operation on the result of evaluating all it's sub-elements expressions.
<!ELEMENT or (not , and , or , instanceof , test , systemTest , equals , count , with , resolve , adapt , iterate)*>
This element represent an OR operation on the result of evaluating all it's sub-element expressions.
<!ELEMENT instanceof EMPTY>
<!ATTLIST instanceof
value CDATA #REQUIRED>
This element is used to perform an instanceof check of the object in focus. The expression returns EvaluationResult.TRUE if the object's type is a sub type of the type specified by the attribute value. Otherwise EvaluationResult.FALSE is returned.
<!ELEMENT test EMPTY>
<!ATTLIST test
property CDATA #REQUIRED
args CDATA #IMPLIED
value CDATA #IMPLIED>
This element is used to evaluate the property state of the object in focus. The set of testable properties can be extended using the propery tester extension point. The test expression returns EvaluationResult.NOT_LOADED if teh property tester doing the actual testing isn't loaded yet.
<!ELEMENT systemTest EMPTY>
<!ATTLIST systemTest
property CDATA #REQUIRED
value CDATA #REQUIRED>
Tests a system property by calling the System.getProperty method and compares the result with the value specified through the value attribute.
<!ELEMENT equals EMPTY>
<!ATTLIST equals
value CDATA #REQUIRED>
This element is used to perform an equals check of the object in focus. The expression returns EvaluationResult.TRUE if the object is equal to the value provided by the attribute value. Otherwise EvaluationResult.FALSE is returned.
<!ELEMENT count EMPTY>
<!ATTLIST count
value CDATA #REQUIRED>
This element is used to test the number of elements in a collection.
<!ELEMENT with (not , and , or , instanceof , test , systemTest , equals , count , with , resolve , adapt , iterate)*>
<!ATTLIST with
variable CDATA #REQUIRED>
This element changes the object to be inspected for all its child element to the object referneced by the given variable. If the variable can not be resolved then the expression will throw a ExpressionException when evaluating it. The children of a with expression are combined using the and operator.
<!ELEMENT resolve (not , and , or , instanceof , test , systemTest , equals , count , with , resolve , adapt , iterate)*>
<!ATTLIST resolve
variable CDATA #REQUIRED
args CDATA #IMPLIED>
This element changes the object to be inspected for all its child element to the object referneced by the given variable. If the variable can not be resolved then the expression will throw a ExpressionException when evaluating it. The children of a with expression are combined using the and operator.
<!ELEMENT adapt (not , and , or , instanceof , test , systemTest , equals , count , with , resolve , adapt , iterate)*>
<!ATTLIST adapt
type CDATA #REQUIRED>
This element is used to adapt the object in focus to the type specified by the attribute type. The expression returns not loaded if either the adapter or the type referenced isn't loaded yet. It throws a ExpressionException during evaluation if the type name doesn't exist at all. The children of an adapt expression are combined using the and operator.
<!ELEMENT iterate (not , and , or , instanceof , test , systemTest , equals , count , with , resolve , adapt , iterate)*>
<!ATTLIST iterate
operator (or|and) >
This element is used to iterate over a variable that is of type java.util.Collection. If the object in focus is not of type java.util.Collection then an ExpressionException will be thrown while evaluating the expression.
<extension point=
"org.eclipse.gmf.runtime.emf.type.core.elementTypes"
>
<metamodel nsURI=
"http://www.eclipse.org/emf/2002/Ecore"
>
<metamodelType id=
"org.eclipse.gmf.runtime.emf.type.core.eobject"
icon=
"icons/eobject.gif"
name=
"%EObject"
eclass=
"EObject"
edithelper =
"org.eclipse.gmf.runtime.emf.type.core.EObjectEditHelper"
>
</metamodelType>
<specializationType id=
"org.eclipse.gmf.runtime.emf.type.core.special"
icon=
"icons/special.gif"
name=
"%Special"
edithelperadvice=
"org.eclipse.gmf.runtime.emf.type.core.SpecialEditHelperAdvice"
>
<specializes id=
"org.eclipse.gmf.runtime.emf.type.core.eobject"
/>
<matcher class=
"org.eclipse.gmf.runtime.emf.type.core.specialMatcher"
/>
</specializationType>
<specializationType id=
"org.eclipse.gmf.runtime.emf.type.core.special2"
icon=
"icons/special2.gif"
name=
"%Special2"
edithelperadvice=
"org.eclipse.gmf.runtime.emf.type.core.Special2EditHelperAdvice"
>
<specializes id=
"org.eclipse.gmf.runtime.emf.type.core.eobject"
/>
<eContainer>
<enablement>
<test property=
"special2"
value=
"special2Value"
/>
</enablement>
</eContainer>
<enablement>
<test property=
"special2"
value=
"special2Value"
/>
</enablement>
</specializationType>
<specializationType id=
"org.eclipse.gmf.runtime.emf.type.core.customType"
icon=
"icons/customType.gif"
name=
"%CustomType"
kind=
"org.eclipse.gmf.runtime.emf.type.core.CustomElementKind"
edithelperadvice=
"org.eclipse.gmf.runtime.emf.type.core.CustomEditHelperAdvice"
>
<specializes id=
"org.eclipse.gmf.runtime.emf.type.core.eobject"
/>
<param name=
"customParameter1"
value=
"value1"
>
</param>
<param name=
"customParameter2"
value=
"value2"
>
</param>
</specializationType>
<adviceBinding id=
"org.eclipse.gmf.runtime.emf.type.core.advisedType"
typeId=
"org.eclipse.gmf.runtime.emf.type.core.eobject"
class=
"org.eclipse.gmf.runtime.emf.type.core.advisedTypeEditHelperAdvice"
applyToSubtypes=
"false"
>
<eContainer>
<enablement>
<test property=
"advised"
value=
"advisedValue"
/>
</enablement>
</eContainer>
</adviceBinding>
</metamodel>
<elementTypeFactory factory=
"org.eclipse.gmf.runtime.emf.type.core.CustomElementTypeFactory"
kind =
"org.eclipse.gmf.runtime.emf.type.core.CustomElementKind"
params =
"customParameter1, customParameter2"
>
</elementTypeFactory>
</extension>
org.eclipse.gmf.runtime.emf.type.core package in the org.eclipse.gmf.runtime.emf.type.core plug-in for the API description.
Copyright (c) 2005 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
http://www.eclipse.org/legal/epl-v10.html