Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Mixed Content with elementWildcard and complex subfeatures
Mixed Content with elementWildcard and complex subfeatures [message #401941] Tue, 20 June 2006 11:51 Go to next message
Eclipse UserFriend
Originally posted by: mail.robertmitschke.com

Hi all,

I have a problem using EMF with mixed Content.

I have a class of Type MType2 which can contain mixed content. Besides
Mixed Content it also has a EReference to another Type (SType2).

From the EMF documentation and information from google, I found out that I
have to use FeatureMaps. So MType2 has a mixed attribute and the feature
mtf2 of Type SType2 is derived, volatile and transient. (see ecore
snapshot below, I simplified it a little bit for easier understandability)

When I now use the simple tree based editor to create a model, the Option
of creating a child node SType 2 is greyed out. I can only create the
mixed content stuff.

I debugged through the code and apparently the problem seems to be that
the SType2 instances do not match a wildcard. That fact makes the command
not executable, ... the menu item is greyed out.
I assume it has to do with: <details key="kind" value="elementWildcard"/>
Unfortunately I do not really understand what this ecore entry means to
EMF and thus do not know what else to enter there.

I would like the feature map to store all the mixed content and my feature
of type SType2, so that all are ordered.

Thank you a lot in advance,

Regards Robert





This is the Main Type:

<eClassifiers xsi:type="ecore:EClass" name="MType2">
<eAnnotations
source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="name" value="MType2"/>
<details key="kind" value="mixed"/>
</eAnnotations>
<eStructuralFeatures xsi:type="ecore:EReference" name="mtf2"
ordered="false" upperBound="-1"
eType="#//SType2" volatile="true" transient="true" derived="true"
containment="true">
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="mixed"
unique="false" upperBound="-1"
eType="ecore:EDataType
http://www.eclipse.org/emf/2002/Ecore#//EFeatureMapEntry">
<eAnnotations
source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="name" value=":mixed"/>
<details key="kind" value="elementWildcard"/>
</eAnnotations>
</eStructuralFeatures>
</eClassifiers>


This is the Sub Type (feature of Main Type):

<eClassifiers xsi:type="ecore:EClass" name="SType2">
<eAnnotations
source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="name" value="SType2"/>
<details key="kind" value="mixed"/>
</eAnnotations>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="l"
eType="#//String" volatile="true"
transient="true" derived="true">
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="e"
ordered="false" eType="#//SSType"
volatile="true" transient="true" derived="true" containment="true">
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="mixed"
unique="false" upperBound="-1"
eType="ecore:EDataType
http://www.eclipse.org/emf/2002/Ecore#//EFeatureMapEntry">
<eAnnotations
source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="name" value=":mixed"/>
<details key="kind" value="elementWildcard"/>
</eAnnotations>
</eStructuralFeatures>
</eClassifiers>
Re: Mixed Content with elementWildcard and complex subfeatures [message #401944 is a reply to message #401941] Tue, 20 June 2006 12:25 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33217
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------060402030703010401070200
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Robert,

I'd normally expect the mixed feature to be the first feature. Only
element-based features derive from the mixed feature so you need to add
*this*:

<eStructuralFeatures xsi:type="ecore:EReference" name="mtf2"
ordered="false" upperBound="-1"
eType="#//SType2" volatile="true" transient="true"
derived="true" containment="true">
* <eAnnotations
source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">*
* <details key="kind" value="element"/>*
* </eAnnotations>*
</eStructuralFeatures>


Robert Mitschke wrote:
> Hi all,
>
> I have a problem using EMF with mixed Content.
>
> I have a class of Type MType2 which can contain mixed content. Besides
> Mixed Content it also has a EReference to another Type (SType2).
> From the EMF documentation and information from google, I found out
> that I have to use FeatureMaps. So MType2 has a mixed attribute and
> the feature mtf2 of Type SType2 is derived, volatile and transient.
> (see ecore snapshot below, I simplified it a little bit for easier
> understandability)
>
> When I now use the simple tree based editor to create a model, the
> Option of creating a child node SType 2 is greyed out. I can only
> create the mixed content stuff.
> I debugged through the code and apparently the problem seems to be
> that the SType2 instances do not match a wildcard. That fact makes the
> command not executable, ... the menu item is greyed out.
> I assume it has to do with: <details key="kind" value="elementWildcard"/>
> Unfortunately I do not really understand what this ecore entry means
> to EMF and thus do not know what else to enter there.
> I would like the feature map to store all the mixed content and my
> feature of type SType2, so that all are ordered.
>
> Thank you a lot in advance,
>
> Regards Robert
>
>
>
>
>
> This is the Main Type:
>
> <eClassifiers xsi:type="ecore:EClass" name="MType2">
> <eAnnotations
> source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="name" value="MType2"/>
> <details key="kind" value="mixed"/>
> </eAnnotations>
> <eStructuralFeatures xsi:type="ecore:EReference" name="mtf2"
> ordered="false" upperBound="-1"
> eType="#//SType2" volatile="true" transient="true"
> derived="true" containment="true">
> </eStructuralFeatures>
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="mixed"
> unique="false" upperBound="-1"
> eType="ecore:EDataType
> http://www.eclipse.org/emf/2002/Ecore#//EFeatureMapEntry">
> <eAnnotations
> source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="name" value=":mixed"/>
> <details key="kind" value="elementWildcard"/>
> </eAnnotations>
> </eStructuralFeatures>
> </eClassifiers>
>
>
> This is the Sub Type (feature of Main Type):
>
> <eClassifiers xsi:type="ecore:EClass" name="SType2">
> <eAnnotations
> source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="name" value="SType2"/>
> <details key="kind" value="mixed"/>
> </eAnnotations>
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="l"
> eType="#//String" volatile="true"
> transient="true" derived="true">
> </eStructuralFeatures>
> <eStructuralFeatures xsi:type="ecore:EReference" name="e"
> ordered="false" eType="#//SSType"
> volatile="true" transient="true" derived="true"
> containment="true">
> </eStructuralFeatures>
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="mixed"
> unique="false" upperBound="-1"
> eType="ecore:EDataType
> http://www.eclipse.org/emf/2002/Ecore#//EFeatureMapEntry">
> <eAnnotations
> source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="name" value=":mixed"/>
> <details key="kind" value="elementWildcard"/>
> </eAnnotations>
> </eStructuralFeatures>
> </eClassifiers>
>
>


--------------060402030703010401070200
Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: 8bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Robert,<br>
<br>
I'd normally expect the mixed feature to be the first feature.


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Resetting using the set command.
Next Topic:genPackages prefix case gets mangled
Goto Forum:
  


Current Time: Tue Sep 24 04:34:50 GMT 2024

Powered by FUDForum. Page generated in 0.02837 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top