eclipse plugin: Add a shortcut method for the...

...WMLUtils.getValue for the WMLKey class
This commit is contained in:
Timotei Dolean 2011-08-06 21:12:56 +00:00
parent 8dbb34fbc6
commit 4183265854
6 changed files with 33 additions and 2 deletions

View file

@ -41,6 +41,11 @@
defaultValueLiteral=""/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="WMLKey" eSuperTypes="platform:/resource/org.wesnoth/src-gen/org/wesnoth/WML.ecore#//WMLExpression">
<eOperations name="getValue" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="body" value=" return org.wesnoth.utils.WMLUtils.getKeyValue( getValues( ) );"/>
</eAnnotations>
</eOperations>
<eStructuralFeatures xsi:type="ecore:EReference" name="values" upperBound="-1"
eType="ecore:EClass platform:/resource/org.wesnoth/src-gen/org/wesnoth/WML.ecore#//WMLKeyValue"
containment="true"/>

View file

@ -28,6 +28,7 @@
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute platform:/resource/org.wesnoth/src-gen/org/wesnoth/WML.ecore#//WMLKey/_Enum"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute platform:/resource/org.wesnoth/src-gen/org/wesnoth/WML.ecore#//WMLKey/_Translatable"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute platform:/resource/org.wesnoth/src-gen/org/wesnoth/WML.ecore#//WMLKey/_DataType"/>
<genOperations ecoreOperation="platform:/resource/org.wesnoth/src-gen/org/wesnoth/WML.ecore#//WMLKey/getValue"/>
</genClasses>
<genClasses ecoreClass="platform:/resource/org.wesnoth/src-gen/org/wesnoth/WML.ecore#//WMLKeyValue"/>
<genClasses ecoreClass="platform:/resource/org.wesnoth/src-gen/org/wesnoth/WML.ecore#//WMLMacroCall">

View file

@ -143,4 +143,13 @@ public interface WMLKey extends WMLExpression
*/
void set_DataType(String value);
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @model kind="operation"
* annotation="http://www.eclipse.org/emf/2002/GenModel body=' return org.wesnoth.utils.WMLUtils.getKeyValue( getValues( ) );'"
* @generated
*/
String getValue();
} // WMLKey

View file

@ -250,6 +250,16 @@ public class WMLKeyImpl extends WMLExpressionImpl implements WMLKey
eNotify(new ENotificationImpl(this, Notification.SET, WmlPackage.WML_KEY__DATA_TYPE, old_DataType, _DataType));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getValue()
{
return org.wesnoth.utils.WMLUtils.getKeyValue( getValues( ) );
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->

View file

@ -905,6 +905,8 @@ public class WmlPackageImpl extends EPackageImpl implements WmlPackage
initEAttribute(getWMLKey__Translatable(), ecorePackage.getEBoolean(), "_Translatable", "false", 0, 1, WMLKey.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getWMLKey__DataType(), ecorePackage.getEString(), "_DataType", "", 0, 1, WMLKey.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
addEOperation(wmlKeyEClass, ecorePackage.getEString(), "getValue", 0, 1, IS_UNIQUE, IS_ORDERED);
initEClass(wmlKeyValueEClass, WMLKeyValue.class, "WMLKeyValue", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEClass(wmlMacroCallEClass, WMLMacroCall.class, "WMLMacroCall", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);

View file

@ -48,7 +48,7 @@ process( EClass this ):
createAttribute( "_InhertedTagName", estring() , "" ) ->
createAttribute( "_NeedingExpansion", eboolean() , "false" ) ->
createAttribute( "_Description", estring(), "" ) ->
createGenericOperation( "getWMLTags",
"EList<WMLTag> result = new org.eclipse.emf.common.util.BasicEList<WMLTag>();
for ( WMLExpression expression : getExpressions( ) ) {
@ -70,7 +70,11 @@ process( EClass this ):
} else if name == "WMLKey" then {
createAttribute( "_Enum", eboolean(), "false" ) ->
createAttribute( "_Translatable", eboolean(), "false" ) ->
createAttribute( "_DataType", estring(), "" )
createAttribute( "_DataType", estring(), "" ) ->
createOperation( "getValue",
" return org.wesnoth.utils.WMLUtils.getKeyValue( getValues( ) );",
estring( ) )
} else if name == "WMLGrammarElement" then {
// make all WML Grammar inherit from Serializable
eSuperTypes.add( ESerializable() )