Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Code generation for RCP editor broken?
Code generation for RCP editor broken? [message #657429] Wed, 02 March 2011 18:40 Go to next message
Mauro Condarelli is currently offline Mauro CondarelliFriend
Messages: 428
Registered: September 2009
Senior Member
Hi,
I had a working model (World.genmodel) I was using directly with no edit/editor in my RCP editor.
I wanted to explore "enhanced" EMF capabilities and I generated the default editor that (unsurprisingly) is able to edit my model.
Then I wanted to generate the RCP code and I changed a single property in World.genmodel: "Runtime Platform" -> RCP

After regenerating from scratch Edit and Editor (I removed the projects from disk) I got the following errors:

Description Resource Path Location Type
EcoreEditor cannot be resolved to a variable WorldEditorAdvisor.java /it.condarelli.writer.model.editor/src/it/condarelli/writer/ model/world/presentation line 85 Java Problem
The import org.eclipse.emf.ecore.presentation cannot be resolved WorldEditorAdvisor.java /it.condarelli.writer.model.editor/src/it/condarelli/writer/ model/world/presentation line 55 Java Problem
The import org.eclipse.emf.ecore.xml.type.presentation cannot be resolved WorldEditorAdvisor.java /it.condarelli.writer.model.editor/src/it/condarelli/writer/ model/world/presentation line 57 Java Problem
XMLTypeEditor cannot be resolved to a variable WorldEditorAdvisor.java /it.condarelli.writer.model.editor/src/it/condarelli/writer/ model/world/presentation line 84 Java Problem

The first import error can be cured adding manually the org.eclipse.emf.ecore.editor plugin to the required bundles, but even "Search repositories ..." could not find org.eclipse.emf.ecore.xml.type.presentation.XMLTypeEditor anywhere.

What am I doing wrong?

TiA
Mauro
Re: Code generation for RCP editor broken? [message #657438 is a reply to message #657429] Wed, 02 March 2011 18:49 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 30543
Registered: July 2009
Senior Member
Mauro,

Comments below.


Mauro Condarelli wrote:
> Hi,
> I had a working model (World.genmodel) I was using directly with no edit/editor in my RCP editor.
> I wanted to explore "enhanced" EMF capabilities and I generated the default editor that (unsurprisingly) is able to edit my model.
> Then I wanted to generate the RCP code and I changed a single property in World.genmodel: "Runtime Platform" -> RCP
>
> After regenerating from scratch Edit and Editor (I removed the projects from disk) I got the following errors:
>
> Description Resource Path Location Type
> EcoreEditor cannot be resolved to a variable WorldEditorAdvisor.java /it.condarelli.writer.model.editor/src/it/condarelli/writer/ model/world/presentation line 85 Java Problem
> The import org.eclipse.emf.ecore.presentation cannot be resolved WorldEditorAdvisor.java /it.condarelli.writer.model.editor/src/it/condarelli/writer/ model/world/presentation line 55 Java Problem
> The import org.eclipse.emf.ecore.xml.type.presentation cannot be resolved WorldEditorAdvisor.java /it.condarelli.writer.model.editor/src/it/condarelli/writer/ model/world/presentation line 57 Java Problem
> XMLTypeEditor cannot be resolved to a variable WorldEditorAdvisor.java /it.condarelli.writer.model.editor/src/it/condarelli/writer/ model/world/presentation line 84 Java Problem
>
> The first import error can be cured adding manually the org.eclipse.emf.ecore.editor plugin to the required bundles, but even "Search repositories ..." could not find org.eclipse.emf.ecore.xml.type.presentation.XMLTypeEditor anywhere.
>
There is no generated editor for the XMLType model I'm not sure why
your model would need/want one. Maybe there's something special about
your model that I can't know without seeing it. All schema-based models
use that package, so I don't think it's just using it that's a problem...
> What am I doing wrong?
>
> TiA
> Mauro
>
Re: Code generation for RCP editor broken? [message #657439 is a reply to message #657438] Wed, 02 March 2011 19:06 Go to previous messageGo to next message
Mauro Condarelli is currently offline Mauro CondarelliFriend
Messages: 428
Registered: September 2009
Senior Member
Thanks for fast answer, Ed.

Comments below.

Il 02/03/2011 19:49, Ed Merks ha scritto:
> Mauro,
>
> Comments below.
>
>
> Mauro Condarelli wrote:
>> Hi,
>> I had a working model (World.genmodel) I was using directly with no
>> edit/editor in my RCP editor.
>> I wanted to explore "enhanced" EMF capabilities and I generated the
>> default editor that (unsurprisingly) is able to edit my model.
>> Then I wanted to generate the RCP code and I changed a single property
>> in World.genmodel: "Runtime Platform" -> RCP
>>
>> After regenerating from scratch Edit and Editor (I removed the
>> projects from disk) I got the following errors:
>>
>> Description Resource Path Location Type
>> EcoreEditor cannot be resolved to a variable WorldEditorAdvisor.java
>> /it.condarelli.writer.model.editor/src/it/condarelli/writer/ model/world/presentation
>> line 85 Java Problem
>> The import org.eclipse.emf.ecore.presentation cannot be resolved
>> WorldEditorAdvisor.java
>> /it.condarelli.writer.model.editor/src/it/condarelli/writer/ model/world/presentation
>> line 55 Java Problem
>> The import org.eclipse.emf.ecore.xml.type.presentation cannot be
>> resolved WorldEditorAdvisor.java
>> /it.condarelli.writer.model.editor/src/it/condarelli/writer/ model/world/presentation
>> line 57 Java Problem
>> XMLTypeEditor cannot be resolved to a variable WorldEditorAdvisor.java
>> /it.condarelli.writer.model.editor/src/it/condarelli/writer/ model/world/presentation
>> line 84 Java Problem
>>
>> The first import error can be cured adding manually the
>> org.eclipse.emf.ecore.editor plugin to the required bundles, but even
>> "Search repositories ..." could not find
>> org.eclipse.emf.ecore.xml.type.presentation.XMLTypeEditor anywhere.
> There is no generated editor for the XMLType model I'm not sure why your
> model would need/want one. Maybe there's something special about your
> model that I can't know without seeing it. All schema-based models use
> that package, so I don't think it's just using it that's a problem...
I have no problem showing the model; find it at the bottom.

I still do not understand:
generating for IDE runs like a champ, but generating for RCP does not even compile.
Nothing else changed.
I tried several times and I'm quite sure I changed only that property.

TiA
Mauro


<?xml version="1.0" encoding="UTF-8"?>
<ecore:EPackage xmi:version="2.0"
xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="world"
nsURI="http:///it/condarelli/writer/model/world.ecore" nsPrefix="it.condarelli.writer.model.world">
<eClassifiers xsi:type="ecore:EClass" name="Actor">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="name" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"
defaultValueLiteral="Nemo"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="type" eType="#//ActorType"
changeable="false" volatile="true" transient="true" derived="true"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="bio" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="desc" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="fullName" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="goals" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="aka" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="major" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="notes" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="unused" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Book" eSuperTypes="#//IBase">
<eStructuralFeatures xsi:type="ecore:EReference" name="world" eType="#//World"
transient="true" eOpposite="#//World/book"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="project" eType="#//Project"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="actor" upperBound="-1"
eType="#//Actor" containment="true" resolveProxies="false"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="chapter" upperBound="-1"
eType="#//Chapter" containment="true" resolveProxies="false" eOpposite="#//Chapter/book"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="location" upperBound="-1"
eType="#//Location" containment="true" resolveProxies="false"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="item" upperBound="-1" eType="#//Item"
containment="true" resolveProxies="false"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="wordCount" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"
changeable="false" volatile="true" transient="true" derived="true"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Chapter" eSuperTypes="#//IBase">
<eStructuralFeatures xsi:type="ecore:EReference" name="book" eType="#//Book" transient="true"
eOpposite="#//Book/chapter"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="actor" upperBound="-1"
eType="#//Actor" containment="true" resolveProxies="false"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="scene" upperBound="-1"
eType="#//Scene" containment="true" resolveProxies="false" eOpposite="#//Scene/chapter"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="sectionStart" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="wordCount" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"
changeable="false" volatile="true" transient="true" derived="true"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="IBase">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="title" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="unused" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"
defaultValueLiteral="false"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="desc" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"
unsettable="true"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="content" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="timeline" lowerBound="1"
eType="#//Timeline" containment="true" resolveProxies="false" eOpposite="#//Timeline/parent"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="image" eType="#//Image"
unsettable="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="actors" upperBound="-1"
eType="#//Actor" changeable="false" volatile="true" transient="true" derived="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="locations" upperBound="-1"
eType="#//Location" changeable="false" volatile="true" transient="true" derived="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="items" upperBound="-1"
eType="#//Item" changeable="false" volatile="true" transient="true" derived="true"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Item" eSuperTypes="#//IBase">
<eStructuralFeatures xsi:type="ecore:EReference" name="owner" eType="#//Actor"
unsettable="true"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Location" eSuperTypes="#//IBase">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="coord" eType="#//Point"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Project">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="lastBackupDate" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EDate"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="lastBackupArchive" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Scene" eSuperTypes="#//IBase">
<eStructuralFeatures xsi:type="ecore:EReference" name="chapter" eType="#//Chapter"
eOpposite="#//Chapter/scene"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="type" eType="#//ScType"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="plot" eType="#//ScPlot"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="tags" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="status" eType="#//ScStatus"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="relevance" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="tension" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="humor" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="quality" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="goal" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="conflict" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="outcome" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="actor" lowerBound="1" upperBound="-1"
eType="#//Actor"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="location" upperBound="-1"
eType="#//Location"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="item" upperBound="-1" eType="#//Item"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="wordCount" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"
changeable="false" volatile="true" transient="true" derived="true"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Timeline">
<eStructuralFeatures xsi:type="ecore:EReference" name="parent" eType="#//IBase"
changeable="false" transient="true" eOpposite="#//IBase/timeline"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="millis" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//ELong"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="duration" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//ELong"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="caption" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="category" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="prev" eType="#//Timeline"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="next" eType="#//Timeline"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="sync" eType="#//Timeline"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="startDate" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EDate"
volatile="true" transient="true" derived="true"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="endDate" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EDate"
volatile="true" transient="true" derived="true"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="spansDays" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"
volatile="true" transient="true" derived="true"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="spansHours" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"
volatile="true" transient="true" derived="true"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="spansMinutes" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"
volatile="true" transient="true" derived="true"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="World" eSuperTypes="#//IBase">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="author" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="book" upperBound="-1" eType="#//Book"
containment="true" resolveProxies="false" eOpposite="#//Book/world"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="actor" upperBound="-1"
eType="#//Actor" containment="true" resolveProxies="false"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="location" upperBound="-1"
eType="#//Location" containment="true" resolveProxies="false"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EEnum" name="ActorType">
<eLiterals name="Unknown"/>
<eLiterals name="World" value="1"/>
<eLiterals name="Book" value="2"/>
<eLiterals name="Local" value="3"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EEnum" name="ScPlot">
<eLiterals name="Plot"/>
<eLiterals name="Subplot" value="1"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EEnum" name="ScStatus">
<eLiterals name="Outline"/>
<eLiterals name="Draft" value="1"/>
<eLiterals name="FirstEdit" value="2"/>
<eLiterals name="SecondEdit" value="3"/>
<eLiterals name="Done" value="4"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EEnum" name="ScType">
<eLiterals name="Action"/>
<eLiterals name="Reaction" value="1"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EDataType" name="Image" instanceClassName="org.eclipse.swt.graphics.Image"/>
<eClassifiers xsi:type="ecore:EDataType" name="Point" instanceClassName="org.eclipse.swt.graphics.Point"/>
<eClassifiers xsi:type="ecore:EDataType" name="ActorArray" instanceClassName="it.condarelli.writer.model.world.Actor[] "/>
<eClassifiers xsi:type="ecore:EDataType" name="LocationArray" instanceClassName="it.condarelli.writer.model.world.Location[] "/>
<eClassifiers xsi:type="ecore:EDataType" name="ItemArray" instanceClassName="it.condarelli.writer.model.world.Item[]"/ >
<eClassifiers xsi:type="ecore:EDataType" name="ActorArray_1" instanceClassName="it.condarelli.writer.model.world.Actor[] "/>
<eClassifiers xsi:type="ecore:EDataType" name="LocationArray_1" instanceClassName="it.condarelli.writer.model.world.Location[] "/>
<eClassifiers xsi:type="ecore:EDataType" name="ItemArray_1" instanceClassName="it.condarelli.writer.model.world.Item[]"/ >
</ecore:EPackage>
Re: Code generation for RCP editor broken? [message #657452 is a reply to message #657439] Wed, 02 March 2011 19:57 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 30543
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------030708060902010507070604
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Mauro,

I can't reproduce the problem you describe from just this Ecore model.
You're package doesn't use XMLType...


Mauro Condarelli wrote:
> Thanks for fast answer, Ed.
>
> Comments below.
>
> Il 02/03/2011 19:49, Ed Merks ha scritto:
>
>> Mauro,
>>
>> Comments below.
>>
>>
>> Mauro Condarelli wrote:
>>
>>> Hi,
>>> I had a working model (World.genmodel) I was using directly with no
>>> edit/editor in my RCP editor.
>>> I wanted to explore "enhanced" EMF capabilities and I generated the
>>> default editor that (unsurprisingly) is able to edit my model.
>>> Then I wanted to generate the RCP code and I changed a single property
>>> in World.genmodel: "Runtime Platform" -> RCP
>>>
>>> After regenerating from scratch Edit and Editor (I removed the
>>> projects from disk) I got the following errors:
>>>
>>> Description Resource Path Location Type
>>> EcoreEditor cannot be resolved to a variable WorldEditorAdvisor.java
>>> /it.condarelli.writer.model.editor/src/it/condarelli/writer/ model/world/presentation
>>> line 85 Java Problem
>>> The import org.eclipse.emf.ecore.presentation cannot be resolved
>>> WorldEditorAdvisor.java
>>> /it.condarelli.writer.model.editor/src/it/condarelli/writer/ model/world/presentation
>>> line 55 Java Problem
>>> The import org.eclipse.emf.ecore.xml.type.presentation cannot be
>>> resolved WorldEditorAdvisor.java
>>> /it.condarelli.writer.model.editor/src/it/condarelli/writer/ model/world/presentation
>>> line 57 Java Problem
>>> XMLTypeEditor cannot be resolved to a variable WorldEditorAdvisor.java
>>> /it.condarelli.writer.model.editor/src/it/condarelli/writer/ model/world/presentation
>>> line 84 Java Problem
>>>
>>> The first import error can be cured adding manually the
>>> org.eclipse.emf.ecore.editor plugin to the required bundles, but even
>>> "Search repositories ..." could not find
>>> org.eclipse.emf.ecore.xml.type.presentation.XMLTypeEditor anywhere.
>>>
>> There is no generated editor for the XMLType model I'm not sure why your
>> model would need/want one. Maybe there's something special about your
>> model that I can't know without seeing it. All schema-based models use
>> that package, so I don't think it's just using it that's a problem...
>>
> I have no problem showing the model; find it at the bottom.
>
> I still do not understand:
> generating for IDE runs like a champ, but generating for RCP does not even compile.
> Nothing else changed.
> I tried several times and I'm quite sure I changed only that property.
>
> TiA
> Mauro
>
>
> <?xml version="1.0" encoding="UTF-8"?>
> <ecore:EPackage xmi:version="2.0"
> xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="world"
> nsURI="http:///it/condarelli/writer/model/world.ecore" nsPrefix="it.condarelli.writer.model.world">
> <eClassifiers xsi:type="ecore:EClass" name="Actor">
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"
> defaultValueLiteral="Nemo"/>
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="type" eType="#//ActorType"
> changeable="false" volatile="true" transient="true" derived="true"/>
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="bio" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="desc" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="fullName" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="goals" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="aka" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="major" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/>
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="notes" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="unused" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/>
> </eClassifiers>
> <eClassifiers xsi:type="ecore:EClass" name="Book" eSuperTypes="#//IBase">
> <eStructuralFeatures xsi:type="ecore:EReference" name="world" eType="#//World"
> transient="true" eOpposite="#//World/book"/>
> <eStructuralFeatures xsi:type="ecore:EReference" name="project" eType="#//Project"/>
> <eStructuralFeatures xsi:type="ecore:EReference" name="actor" upperBound="-1"
> eType="#//Actor" containment="true" resolveProxies="false"/>
> <eStructuralFeatures xsi:type="ecore:EReference" name="chapter" upperBound="-1"
> eType="#//Chapter" containment="true" resolveProxies="false" eOpposite="#//Chapter/book"/>
> <eStructuralFeatures xsi:type="ecore:EReference" name="location" upperBound="-1"
> eType="#//Location" containment="true" resolveProxies="false"/>
> <eStructuralFeatures xsi:type="ecore:EReference" name="item" upperBound="-1" eType="#//Item"
> containment="true" resolveProxies="false"/>
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="wordCount" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"
> changeable="false" volatile="true" transient="true" derived="true"/>
> </eClassifiers>
> <eClassifiers xsi:type="ecore:EClass" name="Chapter" eSuperTypes="#//IBase">
> <eStructuralFeatures xsi:type="ecore:EReference" name="book" eType="#//Book" transient="true"
> eOpposite="#//Book/chapter"/>
> <eStructuralFeatures xsi:type="ecore:EReference" name="actor" upperBound="-1"
> eType="#//Actor" containment="true" resolveProxies="false"/>
> <eStructuralFeatures xsi:type="ecore:EReference" name="scene" upperBound="-1"
> eType="#//Scene" containment="true" resolveProxies="false" eOpposite="#//Scene/chapter"/>
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="sectionStart" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/>
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="wordCount" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"
> changeable="false" volatile="true" transient="true" derived="true"/>
> </eClassifiers>
> <eClassifiers xsi:type="ecore:EClass" name="IBase">
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="title" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="unused" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"
> defaultValueLiteral="false"/>
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="desc" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"
> unsettable="true"/>
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="content" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="element"/>
> </eAnnotations>
> </eStructuralFeatures>
> <eStructuralFeatures xsi:type="ecore:EReference" name="timeline" lowerBound="1"
> eType="#//Timeline" containment="true" resolveProxies="false" eOpposite="#//Timeline/parent"/>
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="image" eType="#//Image"
> unsettable="true"/>
> <eStructuralFeatures xsi:type="ecore:EReference" name="actors" upperBound="-1"
> eType="#//Actor" changeable="false" volatile="true" transient="true" derived="true"/>
> <eStructuralFeatures xsi:type="ecore:EReference" name="locations" upperBound="-1"
> eType="#//Location" changeable="false" volatile="true" transient="true" derived="true"/>
> <eStructuralFeatures xsi:type="ecore:EReference" name="items" upperBound="-1"
> eType="#//Item" changeable="false" volatile="true" transient="true" derived="true"/>
> </eClassifiers>
> <eClassifiers xsi:type="ecore:EClass" name="Item" eSuperTypes="#//IBase">
> <eStructuralFeatures xsi:type="ecore:EReference" name="owner" eType="#//Actor"
> unsettable="true"/>
> </eClassifiers>
> <eClassifiers xsi:type="ecore:EClass" name="Location" eSuperTypes="#//IBase">
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="coord" eType="#//Point"/>
> </eClassifiers>
> <eClassifiers xsi:type="ecore:EClass" name="Project">
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="lastBackupDate" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EDate"/>
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="lastBackupArchive" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
> </eClassifiers>
> <eClassifiers xsi:type="ecore:EClass" name="Scene" eSuperTypes="#//IBase">
> <eStructuralFeatures xsi:type="ecore:EReference" name="chapter" eType="#//Chapter"
> eOpposite="#//Chapter/scene"/>
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="type" eType="#//ScType"/>
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="plot" eType="#//ScPlot"/>
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="tags" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="status" eType="#//ScStatus"/>
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="relevance" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="tension" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="humor" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="quality" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="goal" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="conflict" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="outcome" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
> <eStructuralFeatures xsi:type="ecore:EReference" name="actor" lowerBound="1" upperBound="-1"
> eType="#//Actor"/>
> <eStructuralFeatures xsi:type="ecore:EReference" name="location" upperBound="-1"
> eType="#//Location"/>
> <eStructuralFeatures xsi:type="ecore:EReference" name="item" upperBound="-1" eType="#//Item"/>
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="wordCount" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"
> changeable="false" volatile="true" transient="true" derived="true"/>
> </eClassifiers>
> <eClassifiers xsi:type="ecore:EClass" name="Timeline">
> <eStructuralFeatures xsi:type="ecore:EReference" name="parent" eType="#//IBase"
> changeable="false" transient="true" eOpposite="#//IBase/timeline"/>
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="millis" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//ELong"/>
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="duration" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//ELong"/>
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="caption" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="category" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
> <eStructuralFeatures xsi:type="ecore:EReference" name="prev" eType="#//Timeline"/>
> <eStructuralFeatures xsi:type="ecore:EReference" name="next" eType="#//Timeline"/>
> <eStructuralFeatures xsi:type="ecore:EReference" name="sync" eType="#//Timeline"/>
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="startDate" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EDate"
> volatile="true" transient="true" derived="true"/>
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="endDate" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EDate"
> volatile="true" transient="true" derived="true"/>
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="spansDays" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"
> volatile="true" transient="true" derived="true"/>
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="spansHours" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"
> volatile="true" transient="true" derived="true"/>
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="spansMinutes" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"
> volatile="true" transient="true" derived="true"/>
> </eClassifiers>
> <eClassifiers xsi:type="ecore:EClass" name="World" eSuperTypes="#//IBase">
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="author" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
> <eStructuralFeatures xsi:type="ecore:EReference" name="book" upperBound="-1" eType="#//Book"
> containment="true" resolveProxies="false" eOpposite="#//Book/world"/>
> <eStructuralFeatures xsi:type="ecore:EReference" name="actor" upperBound="-1"
> eType="#//Actor" containment="true" resolveProxies="false"/>
> <eStructuralFeatures xsi:type="ecore:EReference" name="location" upperBound="-1"
> eType="#//Location" containment="true" resolveProxies="false"/>
> </eClassifiers>
> <eClassifiers xsi:type="ecore:EEnum" name="ActorType">
> <eLiterals name="Unknown"/>
> <eLiterals name="World" value="1"/>
> <eLiterals name="Book" value="2"/>
> <eLiterals name="Local" value="3"/>
> </eClassifiers>
> <eClassifiers xsi:type="ecore:EEnum" name="ScPlot">
> <eLiterals name="Plot"/>
> <eLiterals name="Subplot" value="1"/>
> </eClassifiers>
> <eClassifiers xsi:type="ecore:EEnum" name="ScStatus">
> <eLiterals name="Outline"/>
> <eLiterals name="Draft" value="1"/>
> <eLiterals name="FirstEdit" value="2"/>
> <eLiterals name="SecondEdit" value="3"/>
> <eLiterals name="Done" value="4"/>
> </eClassifiers>
> <eClassifiers xsi:type="ecore:EEnum" name="ScType">
> <eLiterals name="Action"/>
> <eLiterals name="Reaction" value="1"/>
> </eClassifiers>
> <eClassifiers xsi:type="ecore:EDataType" name="Image" instanceClassName="org.eclipse.swt.graphics.Image"/>
> <eClassifiers xsi:type="ecore:EDataType" name="Point" instanceClassName="org.eclipse.swt.graphics.Point"/>
> <eClassifiers xsi:type="ecore:EDataType" name="ActorArray" instanceClassName="it.condarelli.writer.model.world.Actor[] "/>
> <eClassifiers xsi:type="ecore:EDataType" name="LocationArray" instanceClassName="it.condarelli.writer.model.world.Location[] "/>
> <eClassifiers xsi:type="ecore:EDataType" name="ItemArray" instanceClassName="it.condarelli.writer.model.world.Item[]"/ >
> <eClassifiers xsi:type="ecore:EDataType" name="ActorArray_1" instanceClassName="it.condarelli.writer.model.world.Actor[] "/>
> <eClassifiers xsi:type="ecore:EDataType" name="LocationArray_1" instanceClassName="it.condarelli.writer.model.world.Location[] "/>
> <eClassifiers xsi:type="ecore:EDataType" name="ItemArray_1" instanceClassName="it.condarelli.writer.model.world.Item[]"/ >
> </ecore:EPackage>
>

--------------030708060902010507070604
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">
Mauro,<br>
<br>
I can't reproduce the problem you describe from just this Ecore
model.
Re: Code generation for RCP editor broken? [message #657470 is a reply to message #657452] Wed, 02 March 2011 20:42 Go to previous messageGo to next message
Mauro Condarelli is currently offline Mauro CondarelliFriend
Messages: 428
Registered: September 2009
Senior Member
Il 02/03/2011 20:57, Ed Merks ha scritto:
> Mauro,
>
> I can't reproduce the problem you describe from just this Ecore model.
> You're package doesn't use XMLType...
I can zip & send the whole project, If You want.
Where should I put it?
The project holds just three EMF models, all built from annotated java.
One (World) has been modified to include some computed fields and stuff.

The string "XMLType" appears in two places:

World.genmodel:
<?xml version="1.0" encoding="UTF-8"?>
<genmodel:GenModel xmi:version="2.0"
xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" modelDirectory="/it.condarelli.writer.model/src"
modelPluginID="it.condarelli.writer.model" modelName="World" importerID="org.eclipse.emf.importer.java"
complianceLevel="6.0" copyrightFields="false" language="" usedGenPackages=" platform:/plugin/org.eclipse.emf.ecore/model/XMLType.genmode l#//type platform:/plugin/org.eclipse.emf.ecore/model/Ecore.genmodel# //ecore "
runtimePlatform="RCP">
<foreignModel>@model</foreignModel>
<genPackages prefix="World" basePackage="it.condarelli.writer.model" resource="XML"
disposableProviderFactory="true" ecorePackage="world.ecore#/">
<genEnums typeSafeEnumCompatible="false" ecoreEnum="world.ecore#//ActorType">
....

And is actually used in (generated) WorldPackageImpl.java (this compiles without any warning):

....
import org.eclipse.emf.ecore.xml.type.XMLTypePackage;
....

/**
* Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends.
*
* <p>This method is used to initialize {@link WorldPackage#eINSTANCE} when that field is accessed.
* Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #eNS_URI
* @see #createPackageContents()
* @see #initializePackageContents()
* @generated
*/
public static WorldPackage init() {
if (isInited) return (WorldPackage)EPackage.Registry.INSTANCE.getEPackage(WorldPa ckage.eNS_URI);
....
// Initialize simple dependencies
XMLTypePackage.eINSTANCE.eClass();
EcorePackage.eINSTANCE.eClass();


The other two models have the same pattern, but I'm not trying to generare edit/editor for them, at the moment.

Thanks a lot for Your time
Mauro
Re: Code generation for RCP editor broken? [message #657482 is a reply to message #657470] Wed, 02 March 2011 22:58 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 30543
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------060606040409090600080307
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Mauro,

If you delete this line from the *.genmodel:

usedGenPackages=" platform:/plugin/org.eclipse.emf.ecore/model/XMLType.genmode l#//type platform:/plugin/org.eclipse.emf.ecore/model/Ecore.genmodel# //ecore "

Does the generator still open properly (without errors)? If you
"Reload..." the model after that, do these used packages come back. The
don't appear to be needed. Maybe they're remnants of some earlier
experimentation on your part?

Cheers,
Ed


Mauro Condarelli wrote:
> Il 02/03/2011 20:57, Ed Merks ha scritto:
>
>> Mauro,
>>
>> I can't reproduce the problem you describe from just this Ecore model.
>> You're package doesn't use XMLType...
>>
> I can zip & send the whole project, If You want.
> Where should I put it?
> The project holds just three EMF models, all built from annotated java.
> One (World) has been modified to include some computed fields and stuff.
>
> The string "XMLType" appears in two places:
>
> World.genmodel:
> <?xml version="1.0" encoding="UTF-8"?>
> <genmodel:GenModel xmi:version="2.0"
> xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
> xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" modelDirectory="/it.condarelli.writer.model/src"
> modelPluginID="it.condarelli.writer.model" modelName="World" importerID="org.eclipse.emf.importer.java"
> complianceLevel="6.0" copyrightFields="false" language="" usedGenPackages=" platform:/plugin/org.eclipse.emf.ecore/model/XMLType.genmode l#//type platform:/plugin/org.eclipse.emf.ecore/model/Ecore.genmodel# //ecore "
> runtimePlatform="RCP">
> <foreignModel>@model</foreignModel>
> <genPackages prefix="World" basePackage="it.condarelli.writer.model" resource="XML"
> disposableProviderFactory="true" ecorePackage="world.ecore#/">
> <genEnums typeSafeEnumCompatible="false" ecoreEnum="world.ecore#//ActorType">
> ...
>
> And is actually used in (generated) WorldPackageImpl.java (this compiles without any warning):
>
> ...
> import org.eclipse.emf.ecore.xml.type.XMLTypePackage;
> ...
>
> /**
> * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends.
> *
> * <p>This method is used to initialize {@link WorldPackage#eINSTANCE} when that field is accessed.
> * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
> * <!-- begin-user-doc -->
> * <!-- end-user-doc -->
> * @see #eNS_URI
> * @see #createPackageContents()
> * @see #initializePackageContents()
> * @generated
> */
> public static WorldPackage init() {
> if (isInited) return (WorldPackage)EPackage.Registry.INSTANCE.getEPackage(WorldPa ckage.eNS_URI);
> ...
> // Initialize simple dependencies
> XMLTypePackage.eINSTANCE.eClass();
> EcorePackage.eINSTANCE.eClass();
>
>
> The other two models have the same pattern, but I'm not trying to generare edit/editor for them, at the moment.
>
> Thanks a lot for Your time
> Mauro
>

--------------060606040409090600080307
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">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Mauro,<br>
<br>
If you delete this line from the *.genmodel:<br>
<pre wrap="">usedGenPackages=" platform:/plugin/org.eclipse.emf.ecore/model/XMLType.genmode l#//type platform:/plugin/org.eclipse.emf.ecore/model/Ecore.genmodel# //ecore "
</pre>
Does the generator still open properly (without errors)?
Re: Code generation for RCP editor broken? [message #657543 is a reply to message #657482] Thu, 03 March 2011 08:57 Go to previous messageGo to next message
Mauro Condarelli is currently offline Mauro CondarelliFriend
Messages: 428
Registered: September 2009
Senior Member
Thanks Ed,
comments below.

Il 02/03/2011 23:58, Ed Merks ha scritto:
> Mauro,
>
> If you delete this line from the *.genmodel:
>
> usedGenPackages=" platform:/plugin/org.eclipse.emf.ecore/model/XMLType.genmode l#//type platform:/plugin/org.eclipse.emf.ecore/model/Ecore.genmodel# //ecore "
Done.
>
> Does the generator still open properly (without errors)? If you
Yes, it does.
It also produce a "WorldEditor" able to open my serialized data (I di not try to modify and save).
I should mention I had an exception on shutdown:

org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.NullPointerException)
at org.eclipse.swt.SWT.error(SWT.java:4083)
at org.eclipse.swt.SWT.error(SWT.java:3998)
....
Caused by: java.lang.NullPointerException
at it.condarelli.writer.model.world.presentation.WorldEditor.se tSelectionToViewer(WorldEditor.java:668)
at it.condarelli.writer.model.world.presentation.WorldEditor$3$ 1.run(WorldEditor.java:621)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:3 5)
....

/**
* This sets the selection into whichever viewer is active.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setSelectionToViewer(Collection<?> collection) {
final Collection<?> theSelection = collection;
// Make sure it's okay.
//
if (theSelection != null && !theSelection.isEmpty()) {
Runnable runnable =
new Runnable() {
public void run() {
// Try to select the items in the current content viewer of the editor.
//
if (currentViewer != null) {
currentViewer.setSelection(new StructuredSelection(theSelection.toArray()), true);
}
}
};
getSite().getShell().getDisplay().asyncExec(runnable); <-- THIS IS LINE 668
}
}


> "Reload..." the model after that, do these used packages come back. The
Yes, they do.
If I "Reload..." the model (World.genmodel) gets back exactly as before (with the same attribute I just deleted).
There must be something in my annotated java that forces this generation, but I don't understand what.
The string "XMLType" appears just in the places I already said (see below); what else should I check?

> don't appear to be needed. Maybe they're remnants of some earlier
> experimentation on your part?
That may well be since this model was where I did a lot of trial&error learning, but I cannot understand where it comes from.

I should also not the other two models I have (one is very trivial) show the same behavior (include XMLType).

Regards
Mauro

>
> Cheers,
> Ed
>
>
> Mauro Condarelli wrote:
>> Il 02/03/2011 20:57, Ed Merks ha scritto:
>>
>>> Mauro,
>>>
>>> I can't reproduce the problem you describe from just this Ecore model.
>>> You're package doesn't use XMLType...
>>>
>> I can zip& send the whole project, If You want.
>> Where should I put it?
>> The project holds just three EMF models, all built from annotated java.
>> One (World) has been modified to include some computed fields and stuff.
>>
>> The string "XMLType" appears in two places:
>>
>> World.genmodel:
>> <?xml version="1.0" encoding="UTF-8"?>
>> <genmodel:GenModel xmi:version="2.0"
>> xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
>> xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" modelDirectory="/it.condarelli.writer.model/src"
>> modelPluginID="it.condarelli.writer.model" modelName="World" importerID="org.eclipse.emf.importer.java"
>> complianceLevel="6.0" copyrightFields="false" language="" usedGenPackages=" platform:/plugin/org.eclipse.emf.ecore/model/XMLType.genmode l#//type platform:/plugin/org.eclipse.emf.ecore/model/Ecore.genmodel# //ecore "
>> runtimePlatform="RCP">
>> <foreignModel>@model</foreignModel>
>> <genPackages prefix="World" basePackage="it.condarelli.writer.model" resource="XML"
>> disposableProviderFactory="true" ecorePackage="world.ecore#/">
>> <genEnums typeSafeEnumCompatible="false" ecoreEnum="world.ecore#//ActorType">
>> ...
>>
>> And is actually used in (generated) WorldPackageImpl.java (this compiles without any warning):
>>
>> ...
>> import org.eclipse.emf.ecore.xml.type.XMLTypePackage;
>> ...
>>
>> /**
>> * Creates, registers, and initializes the<b>Package</b> for this model, and for any others upon which it depends.
>> *
>> *<p>This method is used to initialize {@link WorldPackage#eINSTANCE} when that field is accessed.
>> * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
>> *<!-- begin-user-doc -->
>> *<!-- end-user-doc -->
>> * @see #eNS_URI
>> * @see #createPackageContents()
>> * @see #initializePackageContents()
>> * @generated
>> */
>> public static WorldPackage init() {
>> if (isInited) return (WorldPackage)EPackage.Registry.INSTANCE.getEPackage(WorldPa ckage.eNS_URI);
>> ...
>> // Initialize simple dependencies
>> XMLTypePackage.eINSTANCE.eClass();
>> EcorePackage.eINSTANCE.eClass();
>>
>>
>> The other two models have the same pattern, but I'm not trying to generare edit/editor for them, at the moment.
>>
>> Thanks a lot for Your time
>> Mauro
>>
Re: Code generation for RCP editor broken? [message #657647 is a reply to message #657543] Thu, 03 March 2011 14:52 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 30543
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------040708080207000202080600
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Mauro,

Comments below.

Mauro Condarelli wrote:
> Thanks Ed,
> comments below.
>
> Il 02/03/2011 23:58, Ed Merks ha scritto:
>
>> Mauro,
>>
>> If you delete this line from the *.genmodel:
>>
>> usedGenPackages=" platform:/plugin/org.eclipse.emf.ecore/model/XMLType.genmode l#//type platform:/plugin/org.eclipse.emf.ecore/model/Ecore.genmodel# //ecore "
>>
> Done.
>
>> Does the generator still open properly (without errors)? If you
>>
> Yes, it does.
> It also produce a "WorldEditor" able to open my serialized data (I di not try to modify and save).
>
I figured they looked redundant. The odd thing is that when I extract a
model from the annotated Java generated from the Ecore you provided,
they don't show up in mine. So there must be stuff in your projects
that have an impact on the annotation analysis, but aren't really part
of your model. I'd need to be able to reproduce that...
> I should mention I had an exception on shutdown:
>
> org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.NullPointerException)
> at org.eclipse.swt.SWT.error(SWT.java:4083)
> at org.eclipse.swt.SWT.error(SWT.java:3998)
> ...
> Caused by: java.lang.NullPointerException
> at it.condarelli.writer.model.world.presentation.WorldEditor.se tSelectionToViewer(WorldEditor.java:668)
> at it.condarelli.writer.model.world.presentation.WorldEditor$3$ 1.run(WorldEditor.java:621)
>
Is this in the middle of processing an event from the command stack?
What just happened with the stack?
> at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:3 5)
> ...
>
> /**
> * This sets the selection into whichever viewer is active.
> * <!-- begin-user-doc -->
> * <!-- end-user-doc -->
> * @generated
> */
> public void setSelectionToViewer(Collection<?> collection) {
> final Collection<?> theSelection = collection;
> // Make sure it's okay.
> //
> if (theSelection != null && !theSelection.isEmpty()) {
> Runnable runnable =
> new Runnable() {
> public void run() {
> // Try to select the items in the current content viewer of the editor.
> //
> if (currentViewer != null) {
> currentViewer.setSelection(new StructuredSelection(theSelection.toArray()), true);
> }
> }
> };
> getSite().getShell().getDisplay().asyncExec(runnable); <-- THIS IS LINE 668
> }
> }
>
>
>
>> "Reload..." the model after that, do these used packages come back. The
>>
> Yes, they do.
> If I "Reload..." the model (World.genmodel) gets back exactly as before (with the same attribute I just deleted).
> There must be something in my annotated java that forces this generation, but I don't understand what.
>
Me neither; I'd have to see it happen.
> The string "XMLType" appears just in the places I already said (see below); what else should I check?
>
>
>> don't appear to be needed. Maybe they're remnants of some earlier
>> experimentation on your part?
>>
> That may well be since this model was where I did a lot of trial&error learning, but I cannot understand where it comes from.
>
You could delete all the files with @model annotations in them and
regenerate them all to clean out any cruft...
> I should also not the other two models I have (one is very trivial) show the same behavior (include XMLType).
>
Perhaps you could share them? I.e., attach them to a bugzilla so I can
have a look...
> Regards
> Mauro
>
>
>> Cheers,
>> Ed
>>
>>
>> Mauro Condarelli wrote:
>>
>>> Il 02/03/2011 20:57, Ed Merks ha scritto:
>>>
>>>
>>>> Mauro,
>>>>
>>>> I can't reproduce the problem you describe from just this Ecore model.
>>>> You're package doesn't use XMLType...
>>>>
>>>>
>>> I can zip& send the whole project, If You want.
>>> Where should I put it?
>>> The project holds just three EMF models, all built from annotated java.
>>> One (World) has been modified to include some computed fields and stuff.
>>>
>>> The string "XMLType" appears in two places:
>>>
>>> World.genmodel:
>>> <?xml version="1.0" encoding="UTF-8"?>
>>> <genmodel:GenModel xmi:version="2.0"
>>> xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
>>> xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" modelDirectory="/it.condarelli.writer.model/src"
>>> modelPluginID="it.condarelli.writer.model" modelName="World" importerID="org.eclipse.emf.importer.java"
>>> complianceLevel="6.0" copyrightFields="false" language="" usedGenPackages=" platform:/plugin/org.eclipse.emf.ecore/model/XMLType.genmode l#//type platform:/plugin/org.eclipse.emf.ecore/model/Ecore.genmodel# //ecore "
>>> runtimePlatform="RCP">
>>> <foreignModel>@model</foreignModel>
>>> <genPackages prefix="World" basePackage="it.condarelli.writer.model" resource="XML"
>>> disposableProviderFactory="true" ecorePackage="world.ecore#/">
>>> <genEnums typeSafeEnumCompatible="false" ecoreEnum="world.ecore#//ActorType">
>>> ...
>>>
>>> And is actually used in (generated) WorldPackageImpl.java (this compiles without any warning):
>>>
>>> ...
>>> import org.eclipse.emf.ecore.xml.type.XMLTypePackage;
>>> ...
>>>
>>> /**
>>> * Creates, registers, and initializes the<b>Package</b> for this model, and for any others upon which it depends.
>>> *
>>> *<p>This method is used to initialize {@link WorldPackage#eINSTANCE} when that field is accessed.
>>> * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
>>> *<!-- begin-user-doc -->
>>> *<!-- end-user-doc -->
>>> * @see #eNS_URI
>>> * @see #createPackageContents()
>>> * @see #initializePackageContents()
>>> * @generated
>>> */
>>> public static WorldPackage init() {
>>> if (isInited) return (WorldPackage)EPackage.Registry.INSTANCE.getEPackage(WorldPa ckage.eNS_URI);
>>> ...
>>> // Initialize simple dependencies
>>> XMLTypePackage.eINSTANCE.eClass();
>>> EcorePackage.eINSTANCE.eClass();
>>>
>>>
>>> The other two models have the same pattern, but I'm not trying to generare edit/editor for them, at the moment.
>>>
>>> Thanks a lot for Your time
>>> Mauro
>>>
>>>
>
>

--------------040708080207000202080600
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">
Mauro,<br>
<br>
Comments below.<br>
<br>
Mauro Condarelli wrote:
<blockquote cite="mid:iknkoq$q8e$1@news.eclipse.org" type="cite">
<pre wrap="">Thanks Ed,
comments below.

Il 02/03/2011 23:58, Ed Merks ha scritto:
</pre>
<blockquote type="cite">
<pre wrap="">Mauro,

If you delete this line from the *.genmodel:

usedGenPackages=" platform:/plugin/org.eclipse.emf.ecore/model/XMLType.genmode l#//type platform:/plugin/org.eclipse.emf.ecore/model/Ecore.genmodel# //ecore "
</pre>
</blockquote>
<pre wrap=""><!---->Done.
</pre>
<blockquote type="cite">
<pre wrap="">Does the generator still open properly (without errors)? If you
</pre>
</blockquote>
<pre wrap=""><!---->Yes, it does.
It also produce a "WorldEditor" able to open my serialized data (I di not try to modify and save).
</pre>
</blockquote>
I figured they looked redundant.
Re: Code generation for RCP editor broken? [message #657711 is a reply to message #657647] Thu, 03 March 2011 16:23 Go to previous messageGo to next message
Mauro Condarelli is currently offline Mauro CondarelliFriend
Messages: 428
Registered: September 2009
Senior Member
Thanks Ed,
comments below.

Il 03/03/2011 15:52, Ed Merks ha scritto:
> Mauro,
>
> Comments below.
>
> Mauro Condarelli wrote:
>> Thanks Ed,
>> comments below.
>>
>> Il 02/03/2011 23:58, Ed Merks ha scritto:
>>
>>> Mauro,
>>>
>>> If you delete this line from the *.genmodel:
>>>
>>> usedGenPackages=" platform:/plugin/org.eclipse.emf.ecore/model/XMLType.genmode l#//type platform:/plugin/org.eclipse.emf.ecore/model/Ecore.genmodel# //ecore "
>>>
>> Done.
>>
>>> Does the generator still open properly (without errors)? If you
>>>
>> Yes, it does.
>> It also produce a "WorldEditor" able to open my serialized data (I di not try to modify and save).
>>
> I figured they looked redundant. The odd thing is that when I extract a
> model from the annotated Java generated from the Ecore you provided,
> they don't show up in mine. So there must be stuff in your projects
> that have an impact on the annotation analysis, but aren't really part
> of your model. I'd need to be able to reproduce that...
As said I have no problem sharing whatever.
This is a personal project and I plan to release it as Open Source if
and when it comes to a shape where it could be useful to someone else.
I think the best would be to share just the "models" project, as I do
not think this comes from somewhere else.

>> I should mention I had an exception on shutdown:
>>
>> org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.NullPointerException)
>> at org.eclipse.swt.SWT.error(SWT.java:4083)
>> at org.eclipse.swt.SWT.error(SWT.java:3998)
>> ...
>> Caused by: java.lang.NullPointerException
>> at it.condarelli.writer.model.world.presentation.WorldEditor.se tSelectionToViewer(WorldEditor.java:668)
>> at it.condarelli.writer.model.world.presentation.WorldEditor$3$ 1.run(WorldEditor.java:621)
>>
> Is this in the middle of processing an event from the command stack?
> What just happened with the stack?
I do not know.
It happened when I shut down the eclipse instance hitting the cross
decoration top right of the window.
It was the plain generated RCP editor. No customization whatsoever.

>> at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:3 5)
>> ...
>>
>> /**
>> * This sets the selection into whichever viewer is active.
>> *<!-- begin-user-doc -->
>> *<!-- end-user-doc -->
>> * @generated
>> */
>> public void setSelectionToViewer(Collection<?> collection) {
>> final Collection<?> theSelection = collection;
>> // Make sure it's okay.
>> //
>> if (theSelection != null&& !theSelection.isEmpty()) {
>> Runnable runnable =
>> new Runnable() {
>> public void run() {
>> // Try to select the items in the current content viewer of the editor.
>> //
>> if (currentViewer != null) {
>> currentViewer.setSelection(new StructuredSelection(theSelection.toArray()), true);
>> }
>> }
>> };
>> getSite().getShell().getDisplay().asyncExec(runnable);<-- THIS IS LINE 668
>> }
>> }
>>
>>
>>
>>> "Reload..." the model after that, do these used packages come back. The
>>>
>> Yes, they do.
>> If I "Reload..." the model (World.genmodel) gets back exactly as before (with the same attribute I just deleted).
>> There must be something in my annotated java that forces this generation, but I don't understand what.
>>
> Me neither; I'd have to see it happen.
You are more than welcome... after that please explain to me just *how*
I made a fool of myself.

>> The string "XMLType" appears just in the places I already said (see below); what else should I check?
>>
>>
>>> don't appear to be needed. Maybe they're remnants of some earlier
>>> experimentation on your part?
>>>
>> That may well be since this model was where I did a lot of trial&error learning, but I cannot understand where it comes from.
>>
> You could delete all the files with @model annotations in them and
> regenerate them all to clean out any cruft...
That is not really an option.
I can do it just to test, but I already modified the model a lot adding
methods and stuff that I would lose if I regenerate the java classes
really from scratch.

>> I should also not the other two models I have (one is very trivial) show the same behavior (include XMLType).
>>
> Perhaps you could share them? I.e., attach them to a bugzilla so I can
> have a look...
I have been asking just how I can send You the whole project.
If You feel opening a bugzilla is the right way I will do it immediately.
I didn't do it before because I do not think this is an EMF bug.

Regards
Mauro


>>> Cheers,
>>> Ed
>>>
>>>
>>> Mauro Condarelli wrote:
>>>
>>>> Il 02/03/2011 20:57, Ed Merks ha scritto:
>>>>
>>>>
>>>>> Mauro,
>>>>>
>>>>> I can't reproduce the problem you describe from just this Ecore model.
>>>>> You're package doesn't use XMLType...
>>>>>
>>>>>
>>>> I can zip& send the whole project, If You want.
>>>> Where should I put it?
>>>> The project holds just three EMF models, all built from annotated java.
>>>> One (World) has been modified to include some computed fields and stuff.
>>>>
>>>> The string "XMLType" appears in two places:
>>>>
>>>> World.genmodel:
>>>> <?xml version="1.0" encoding="UTF-8"?>
>>>> <genmodel:GenModel xmi:version="2.0"
>>>> xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
>>>> xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" modelDirectory="/it.condarelli.writer.model/src"
>>>> modelPluginID="it.condarelli.writer.model" modelName="World" importerID="org.eclipse.emf.importer.java"
>>>> complianceLevel="6.0" copyrightFields="false" language="" usedGenPackages=" platform:/plugin/org.eclipse.emf.ecore/model/XMLType.genmode l#//type platform:/plugin/org.eclipse.emf.ecore/model/Ecore.genmodel# //ecore "
>>>> runtimePlatform="RCP">
>>>> <foreignModel>@model</foreignModel>
>>>> <genPackages prefix="World" basePackage="it.condarelli.writer.model" resource="XML"
>>>> disposableProviderFactory="true" ecorePackage="world.ecore#/">
>>>> <genEnums typeSafeEnumCompatible="false" ecoreEnum="world.ecore#//ActorType">
>>>> ...
>>>>
>>>> And is actually used in (generated) WorldPackageImpl.java (this compiles without any warning):
>>>>
>>>> ...
>>>> import org.eclipse.emf.ecore.xml.type.XMLTypePackage;
>>>> ...
>>>>
>>>> /**
>>>> * Creates, registers, and initializes the<b>Package</b> for this model, and for any others upon which it depends.
>>>> *
>>>> *<p>This method is used to initialize {@link WorldPackage#eINSTANCE} when that field is accessed.
>>>> * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
>>>> *<!-- begin-user-doc -->
>>>> *<!-- end-user-doc -->
>>>> * @see #eNS_URI
>>>> * @see #createPackageContents()
>>>> * @see #initializePackageContents()
>>>> * @generated
>>>> */
>>>> public static WorldPackage init() {
>>>> if (isInited) return (WorldPackage)EPackage.Registry.INSTANCE.getEPackage(WorldPa ckage.eNS_URI);
>>>> ...
>>>> // Initialize simple dependencies
>>>> XMLTypePackage.eINSTANCE.eClass();
>>>> EcorePackage.eINSTANCE.eClass();
>>>>
>>>>
>>>> The other two models have the same pattern, but I'm not trying to generare edit/editor for them, at the moment.
>>>>
>>>> Thanks a lot for Your time
>>>> Mauro
>>>>
>>>>
>>
>>
Re: Code generation for RCP editor broken? [message #657712 is a reply to message #657711] Thu, 03 March 2011 16:33 Go to previous messageGo to next message
Mauro Condarelli is currently offline Mauro CondarelliFriend
Messages: 428
Registered: September 2009
Senior Member
In the process of submitting the bugzilla I found out I have

EMF Code Generation
Version: 2.6.0.v20100914-1218
Build id: R201009141218

while bugzilla suggests revisions up to 4.0

Should I try to upgrade before submitting?

Regards
Mauro

Il 03/03/2011 17:23, Mauro Condarelli ha scritto:
> Thanks Ed,
> comments below.
>
> Il 03/03/2011 15:52, Ed Merks ha scritto:
>> Mauro,
>>
>> Comments below.
>>
>> Mauro Condarelli wrote:
>>> Thanks Ed,
>>> comments below.
>>>
>>> Il 02/03/2011 23:58, Ed Merks ha scritto:
>>>
>>>> Mauro,
>>>>
>>>> If you delete this line from the *.genmodel:
>>>>
>>>> usedGenPackages=" platform:/plugin/org.eclipse.emf.ecore/model/XMLType.genmode l#//type
>>>> platform:/plugin/org.eclipse.emf.ecore/model/Ecore.genmodel# //ecore "
>>>>
>>> Done.
>>>
>>>> Does the generator still open properly (without errors)? If you
>>>>
>>> Yes, it does.
>>> It also produce a "WorldEditor" able to open my serialized data (I di
>>> not try to modify and save).
>>>
>> I figured they looked redundant. The odd thing is that when I extract a
>> model from the annotated Java generated from the Ecore you provided,
>> they don't show up in mine. So there must be stuff in your projects
>> that have an impact on the annotation analysis, but aren't really part
>> of your model. I'd need to be able to reproduce that...
> As said I have no problem sharing whatever.
> This is a personal project and I plan to release it as Open Source if
> and when it comes to a shape where it could be useful to someone else.
> I think the best would be to share just the "models" project, as I do
> not think this comes from somewhere else.
>
>>> I should mention I had an exception on shutdown:
>>>
>>> org.eclipse.swt.SWTException: Failed to execute runnable
>>> (java.lang.NullPointerException)
>>> at org.eclipse.swt.SWT.error(SWT.java:4083)
>>> at org.eclipse.swt.SWT.error(SWT.java:3998)
>>> ...
>>> Caused by: java.lang.NullPointerException
>>> at
>>> it.condarelli.writer.model.world.presentation.WorldEditor.se tSelectionToViewer(WorldEditor.java:668)
>>>
>>> at
>>> it.condarelli.writer.model.world.presentation.WorldEditor$3$ 1.run(WorldEditor.java:621)
>>>
>>>
>> Is this in the middle of processing an event from the command stack?
>> What just happened with the stack?
> I do not know.
> It happened when I shut down the eclipse instance hitting the cross
> decoration top right of the window.
> It was the plain generated RCP editor. No customization whatsoever.
>
>>> at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:3 5)
>>> ...
>>>
>>> /**
>>> * This sets the selection into whichever viewer is active.
>>> *<!-- begin-user-doc -->
>>> *<!-- end-user-doc -->
>>> * @generated
>>> */
>>> public void setSelectionToViewer(Collection<?> collection) {
>>> final Collection<?> theSelection = collection;
>>> // Make sure it's okay.
>>> //
>>> if (theSelection != null&& !theSelection.isEmpty()) {
>>> Runnable runnable =
>>> new Runnable() {
>>> public void run() {
>>> // Try to select the items in the current content viewer of the editor.
>>> //
>>> if (currentViewer != null) {
>>> currentViewer.setSelection(new
>>> StructuredSelection(theSelection.toArray()), true);
>>> }
>>> }
>>> };
>>> getSite().getShell().getDisplay().asyncExec(runnable);<-- THIS IS
>>> LINE 668
>>> }
>>> }
>>>
>>>
>>>
>>>> "Reload..." the model after that, do these used packages come back. The
>>>>
>>> Yes, they do.
>>> If I "Reload..." the model (World.genmodel) gets back exactly as
>>> before (with the same attribute I just deleted).
>>> There must be something in my annotated java that forces this
>>> generation, but I don't understand what.
>>>
>> Me neither; I'd have to see it happen.
> You are more than welcome... after that please explain to me just *how*
> I made a fool of myself.
>
>>> The string "XMLType" appears just in the places I already said (see
>>> below); what else should I check?
>>>
>>>
>>>> don't appear to be needed. Maybe they're remnants of some earlier
>>>> experimentation on your part?
>>>>
>>> That may well be since this model was where I did a lot of
>>> trial&error learning, but I cannot understand where it comes from.
>>>
>> You could delete all the files with @model annotations in them and
>> regenerate them all to clean out any cruft...
> That is not really an option.
> I can do it just to test, but I already modified the model a lot adding
> methods and stuff that I would lose if I regenerate the java classes
> really from scratch.
>
>>> I should also not the other two models I have (one is very trivial)
>>> show the same behavior (include XMLType).
>>>
>> Perhaps you could share them? I.e., attach them to a bugzilla so I can
>> have a look...
> I have been asking just how I can send You the whole project.
> If You feel opening a bugzilla is the right way I will do it immediately.
> I didn't do it before because I do not think this is an EMF bug.
>
> Regards
> Mauro
>
>
>>>> Cheers,
>>>> Ed
>>>>
>>>>
>>>> Mauro Condarelli wrote:
>>>>
>>>>> Il 02/03/2011 20:57, Ed Merks ha scritto:
>>>>>
>>>>>
>>>>>> Mauro,
>>>>>>
>>>>>> I can't reproduce the problem you describe from just this Ecore
>>>>>> model.
>>>>>> You're package doesn't use XMLType...
>>>>>>
>>>>>>
>>>>> I can zip& send the whole project, If You want.
>>>>> Where should I put it?
>>>>> The project holds just three EMF models, all built from annotated
>>>>> java.
>>>>> One (World) has been modified to include some computed fields and
>>>>> stuff.
>>>>>
>>>>> The string "XMLType" appears in two places:
>>>>>
>>>>> World.genmodel:
>>>>> <?xml version="1.0" encoding="UTF-8"?>
>>>>> <genmodel:GenModel xmi:version="2.0"
>>>>> xmlns:xmi="http://www.omg.org/XMI"
>>>>> xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
>>>>> xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel"
>>>>> modelDirectory="/it.condarelli.writer.model/src"
>>>>> modelPluginID="it.condarelli.writer.model" modelName="World"
>>>>> importerID="org.eclipse.emf.importer.java"
>>>>> complianceLevel="6.0" copyrightFields="false" language=""
>>>>> usedGenPackages=" platform:/plugin/org.eclipse.emf.ecore/model/XMLType.genmode l#//type
>>>>> platform:/plugin/org.eclipse.emf.ecore/model/Ecore.genmodel# //ecore "
>>>>> runtimePlatform="RCP">
>>>>> <foreignModel>@model</foreignModel>
>>>>> <genPackages prefix="World"
>>>>> basePackage="it.condarelli.writer.model" resource="XML"
>>>>> disposableProviderFactory="true" ecorePackage="world.ecore#/">
>>>>> <genEnums typeSafeEnumCompatible="false"
>>>>> ecoreEnum="world.ecore#//ActorType">
>>>>> ...
>>>>>
>>>>> And is actually used in (generated) WorldPackageImpl.java (this
>>>>> compiles without any warning):
>>>>>
>>>>> ...
>>>>> import org.eclipse.emf.ecore.xml.type.XMLTypePackage;
>>>>> ...
>>>>>
>>>>> /**
>>>>> * Creates, registers, and initializes the<b>Package</b> for this
>>>>> model, and for any others upon which it depends.
>>>>> *
>>>>> *<p>This method is used to initialize {@link
>>>>> WorldPackage#eINSTANCE} when that field is accessed.
>>>>> * Clients should not invoke it directly. Instead, they should
>>>>> simply access that field to obtain the package.
>>>>> *<!-- begin-user-doc -->
>>>>> *<!-- end-user-doc -->
>>>>> * @see #eNS_URI
>>>>> * @see #createPackageContents()
>>>>> * @see #initializePackageContents()
>>>>> * @generated
>>>>> */
>>>>> public static WorldPackage init() {
>>>>> if (isInited) return
>>>>> (WorldPackage)EPackage.Registry.INSTANCE.getEPackage(WorldPa ckage.eNS_URI);
>>>>>
>>>>> ...
>>>>> // Initialize simple dependencies
>>>>> XMLTypePackage.eINSTANCE.eClass();
>>>>> EcorePackage.eINSTANCE.eClass();
>>>>>
>>>>>
>>>>> The other two models have the same pattern, but I'm not trying to
>>>>> generare edit/editor for them, at the moment.
>>>>>
>>>>> Thanks a lot for Your time
>>>>> Mauro
>>>>>
>>>>>
>>>
>>>
>
Re: Code generation for RCP editor broken? [message #657713 is a reply to message #657711] Thu, 03 March 2011 16:39 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 30543
Registered: July 2009
Senior Member
Mauro,

Comments below.

Mauro Condarelli wrote:
> Thanks Ed,
> comments below.
>
> Il 03/03/2011 15:52, Ed Merks ha scritto:
>> Mauro,
>>
>> Comments below.
>>
>> Mauro Condarelli wrote:
>>> Thanks Ed,
>>> comments below.
>>>
>>> Il 02/03/2011 23:58, Ed Merks ha scritto:
>>>
>>>> Mauro,
>>>>
>>>> If you delete this line from the *.genmodel:
>>>>
>>>> usedGenPackages=" platform:/plugin/org.eclipse.emf.ecore/model/XMLType.genmode l#//type
>>>> platform:/plugin/org.eclipse.emf.ecore/model/Ecore.genmodel# //ecore "
>>>>
>>> Done.
>>>
>>>> Does the generator still open properly (without errors)? If you
>>>>
>>> Yes, it does.
>>> It also produce a "WorldEditor" able to open my serialized data (I
>>> di not try to modify and save).
>>>
>> I figured they looked redundant. The odd thing is that when I extract a
>> model from the annotated Java generated from the Ecore you provided,
>> they don't show up in mine. So there must be stuff in your projects
>> that have an impact on the annotation analysis, but aren't really part
>> of your model. I'd need to be able to reproduce that...
> As said I have no problem sharing whatever.
> This is a personal project and I plan to release it as Open Source if
> and when it comes to a shape where it could be useful to someone else.
> I think the best would be to share just the "models" project, as I do
> not think this comes from somewhere else.
Yep.
>
>>> I should mention I had an exception on shutdown:
>>>
>>> org.eclipse.swt.SWTException: Failed to execute runnable
>>> (java.lang.NullPointerException)
>>> at org.eclipse.swt.SWT.error(SWT.java:4083)
>>> at org.eclipse.swt.SWT.error(SWT.java:3998)
>>> ...
>>> Caused by: java.lang.NullPointerException
>>> at
>>> it.condarelli.writer.model.world.presentation.WorldEditor.se tSelectionToViewer(WorldEditor.java:668)
>>>
>>> at
>>> it.condarelli.writer.model.world.presentation.WorldEditor$3$ 1.run(WorldEditor.java:621)
>>>
>>>
>> Is this in the middle of processing an event from the command stack?
>> What just happened with the stack?
> I do not know.
> It happened when I shut down the eclipse instance hitting the cross
> decoration top right of the window.
> It was the plain generated RCP editor. No customization whatsoever.
Does it happen each time. You could set a breakpoint to find out...
>
>>> at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:3 5)
>>> ...
>>>
>>> /**
>>> * This sets the selection into whichever viewer is active.
>>> *<!-- begin-user-doc -->
>>> *<!-- end-user-doc -->
>>> * @generated
>>> */
>>> public void setSelectionToViewer(Collection<?> collection) {
>>> final Collection<?> theSelection = collection;
>>> // Make sure it's okay.
>>> //
>>> if (theSelection != null&& !theSelection.isEmpty()) {
>>> Runnable runnable =
>>> new Runnable() {
>>> public void run() {
>>> // Try to select the items in the current content
>>> viewer of the editor.
>>> //
>>> if (currentViewer != null) {
>>> currentViewer.setSelection(new
>>> StructuredSelection(theSelection.toArray()), true);
>>> }
>>> }
>>> };
>>> getSite().getShell().getDisplay().asyncExec(runnable);<--
>>> THIS IS LINE 668
>>> }
>>> }
>>>
>>>
>>>
>>>> "Reload..." the model after that, do these used packages come
>>>> back. The
>>>>
>>> Yes, they do.
>>> If I "Reload..." the model (World.genmodel) gets back exactly as
>>> before (with the same attribute I just deleted).
>>> There must be something in my annotated java that forces this
>>> generation, but I don't understand what.
>>>
>> Me neither; I'd have to see it happen.
> You are more than welcome... after that please explain to me just
> *how* I made a fool of myself.
I've not see you do anything foolish.
>
>>> The string "XMLType" appears just in the places I already said (see
>>> below); what else should I check?
>>>
>>>
>>>> don't appear to be needed. Maybe they're remnants of some earlier
>>>> experimentation on your part?
>>>>
>>> That may well be since this model was where I did a lot of
>>> trial&error learning, but I cannot understand where it comes from.
>>>
>> You could delete all the files with @model annotations in them and
>> regenerate them all to clean out any cruft...
> That is not really an option.
Why?
> I can do it just to test, but I already modified the model a lot
You mean the interfaces too? I wasn't suggesting to delete the
implementation classes.
> adding methods and stuff that I would lose if I regenerate the java
> classes really from scratch.
>
>>> I should also not the other two models I have (one is very trivial)
>>> show the same behavior (include XMLType).
>>>
>> Perhaps you could share them? I.e., attach them to a bugzilla so I can
>> have a look...
> I have been asking just how I can send You the whole project.
> If You feel opening a bugzilla is the right way I will do it immediately.
Yep.
> I didn't do it before because I do not think this is an EMF bug.
If it turns out not to be a bug, I'll just close it again. No harm done.
>
> Regards
> Mauro
>
>
>>>> Cheers,
>>>> Ed
>>>>
>>>>
>>>> Mauro Condarelli wrote:
>>>>
>>>>> Il 02/03/2011 20:57, Ed Merks ha scritto:
>>>>>
>>>>>
>>>>>> Mauro,
>>>>>>
>>>>>> I can't reproduce the problem you describe from just this Ecore
>>>>>> model.
>>>>>> You're package doesn't use XMLType...
>>>>>>
>>>>>>
>>>>> I can zip& send the whole project, If You want.
>>>>> Where should I put it?
>>>>> The project holds just three EMF models, all built from annotated
>>>>> java.
>>>>> One (World) has been modified to include some computed fields and
>>>>> stuff.
>>>>>
>>>>> The string "XMLType" appears in two places:
>>>>>
>>>>> World.genmodel:
>>>>> <?xml version="1.0" encoding="UTF-8"?>
>>>>> <genmodel:GenModel xmi:version="2.0"
>>>>> xmlns:xmi="http://www.omg.org/XMI"
>>>>> xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
>>>>> xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel"
>>>>> modelDirectory="/it.condarelli.writer.model/src"
>>>>> modelPluginID="it.condarelli.writer.model" modelName="World"
>>>>> importerID="org.eclipse.emf.importer.java"
>>>>> complianceLevel="6.0" copyrightFields="false" language=""
>>>>> usedGenPackages=" platform:/plugin/org.eclipse.emf.ecore/model/XMLType.genmode l#//type
>>>>> platform:/plugin/org.eclipse.emf.ecore/model/Ecore.genmodel# //ecore "
>>>>> runtimePlatform="RCP">
>>>>> <foreignModel>@model</foreignModel>
>>>>> <genPackages prefix="World"
>>>>> basePackage="it.condarelli.writer.model" resource="XML"
>>>>> disposableProviderFactory="true"
>>>>> ecorePackage="world.ecore#/">
>>>>> <genEnums typeSafeEnumCompatible="false"
>>>>> ecoreEnum="world.ecore#//ActorType">
>>>>> ...
>>>>>
>>>>> And is actually used in (generated) WorldPackageImpl.java (this
>>>>> compiles without any warning):
>>>>>
>>>>> ...
>>>>> import org.eclipse.emf.ecore.xml.type.XMLTypePackage;
>>>>> ...
>>>>>
>>>>> /**
>>>>> * Creates, registers, and initializes the<b>Package</b>
>>>>> for this model, and for any others upon which it depends.
>>>>> *
>>>>> *<p>This method is used to initialize {@link
>>>>> WorldPackage#eINSTANCE} when that field is accessed.
>>>>> * Clients should not invoke it directly. Instead, they
>>>>> should simply access that field to obtain the package.
>>>>> *<!-- begin-user-doc -->
>>>>> *<!-- end-user-doc -->
>>>>> * @see #eNS_URI
>>>>> * @see #createPackageContents()
>>>>> * @see #initializePackageContents()
>>>>> * @generated
>>>>> */
>>>>> public static WorldPackage init() {
>>>>> if (isInited) return
>>>>> (WorldPackage)EPackage.Registry.INSTANCE.getEPackage(WorldPa ckage.eNS_URI);
>>>>>
>>>>> ...
>>>>> // Initialize simple dependencies
>>>>> XMLTypePackage.eINSTANCE.eClass();
>>>>> EcorePackage.eINSTANCE.eClass();
>>>>>
>>>>>
>>>>> The other two models have the same pattern, but I'm not trying to
>>>>> generare edit/editor for them, at the moment.
>>>>>
>>>>> Thanks a lot for Your time
>>>>> Mauro
>>>>>
>>>>>
>>>
>>>
>
Re: Code generation for RCP editor broken? [message #657714 is a reply to message #657712] Thu, 03 March 2011 16:41 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 30543
Registered: July 2009
Senior Member
Mauro,

When I test the problem, I'll test it first with my 2.7 (current)
installation. If it's working well there, it's likely working well in
2.6. Which version are you using?


Mauro Condarelli wrote:
> In the process of submitting the bugzilla I found out I have
>
> EMF Code Generation
> Version: 2.6.0.v20100914-1218
> Build id: R201009141218
>
> while bugzilla suggests revisions up to 4.0
>
> Should I try to upgrade before submitting?
>
> Regards
> Mauro
>
> Il 03/03/2011 17:23, Mauro Condarelli ha scritto:
>> Thanks Ed,
>> comments below.
>>
>> Il 03/03/2011 15:52, Ed Merks ha scritto:
>>> Mauro,
>>>
>>> Comments below.
>>>
>>> Mauro Condarelli wrote:
>>>> Thanks Ed,
>>>> comments below.
>>>>
>>>> Il 02/03/2011 23:58, Ed Merks ha scritto:
>>>>
>>>>> Mauro,
>>>>>
>>>>> If you delete this line from the *.genmodel:
>>>>>
>>>>> usedGenPackages=" platform:/plugin/org.eclipse.emf.ecore/model/XMLType.genmode l#//type
>>>>>
>>>>> platform:/plugin/org.eclipse.emf.ecore/model/Ecore.genmodel# //ecore "
>>>>>
>>>> Done.
>>>>
>>>>> Does the generator still open properly (without errors)? If you
>>>>>
>>>> Yes, it does.
>>>> It also produce a "WorldEditor" able to open my serialized data (I di
>>>> not try to modify and save).
>>>>
>>> I figured they looked redundant. The odd thing is that when I extract a
>>> model from the annotated Java generated from the Ecore you provided,
>>> they don't show up in mine. So there must be stuff in your projects
>>> that have an impact on the annotation analysis, but aren't really part
>>> of your model. I'd need to be able to reproduce that...
>> As said I have no problem sharing whatever.
>> This is a personal project and I plan to release it as Open Source if
>> and when it comes to a shape where it could be useful to someone else.
>> I think the best would be to share just the "models" project, as I do
>> not think this comes from somewhere else.
>>
>>>> I should mention I had an exception on shutdown:
>>>>
>>>> org.eclipse.swt.SWTException: Failed to execute runnable
>>>> (java.lang.NullPointerException)
>>>> at org.eclipse.swt.SWT.error(SWT.java:4083)
>>>> at org.eclipse.swt.SWT.error(SWT.java:3998)
>>>> ...
>>>> Caused by: java.lang.NullPointerException
>>>> at
>>>> it.condarelli.writer.model.world.presentation.WorldEditor.se tSelectionToViewer(WorldEditor.java:668)
>>>>
>>>>
>>>> at
>>>> it.condarelli.writer.model.world.presentation.WorldEditor$3$ 1.run(WorldEditor.java:621)
>>>>
>>>>
>>>>
>>> Is this in the middle of processing an event from the command stack?
>>> What just happened with the stack?
>> I do not know.
>> It happened when I shut down the eclipse instance hitting the cross
>> decoration top right of the window.
>> It was the plain generated RCP editor. No customization whatsoever.
>>
>>>> at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:3 5)
>>>> ...
>>>>
>>>> /**
>>>> * This sets the selection into whichever viewer is active.
>>>> *<!-- begin-user-doc -->
>>>> *<!-- end-user-doc -->
>>>> * @generated
>>>> */
>>>> public void setSelectionToViewer(Collection<?> collection) {
>>>> final Collection<?> theSelection = collection;
>>>> // Make sure it's okay.
>>>> //
>>>> if (theSelection != null&& !theSelection.isEmpty()) {
>>>> Runnable runnable =
>>>> new Runnable() {
>>>> public void run() {
>>>> // Try to select the items in the current content viewer of the
>>>> editor.
>>>> //
>>>> if (currentViewer != null) {
>>>> currentViewer.setSelection(new
>>>> StructuredSelection(theSelection.toArray()), true);
>>>> }
>>>> }
>>>> };
>>>> getSite().getShell().getDisplay().asyncExec(runnable);<-- THIS IS
>>>> LINE 668
>>>> }
>>>> }
>>>>
>>>>
>>>>
>>>>> "Reload..." the model after that, do these used packages come
>>>>> back. The
>>>>>
>>>> Yes, they do.
>>>> If I "Reload..." the model (World.genmodel) gets back exactly as
>>>> before (with the same attribute I just deleted).
>>>> There must be something in my annotated java that forces this
>>>> generation, but I don't understand what.
>>>>
>>> Me neither; I'd have to see it happen.
>> You are more than welcome... after that please explain to me just *how*
>> I made a fool of myself.
>>
>>>> The string "XMLType" appears just in the places I already said (see
>>>> below); what else should I check?
>>>>
>>>>
>>>>> don't appear to be needed. Maybe they're remnants of some earlier
>>>>> experimentation on your part?
>>>>>
>>>> That may well be since this model was where I did a lot of
>>>> trial&error learning, but I cannot understand where it comes from.
>>>>
>>> You could delete all the files with @model annotations in them and
>>> regenerate them all to clean out any cruft...
>> That is not really an option.
>> I can do it just to test, but I already modified the model a lot adding
>> methods and stuff that I would lose if I regenerate the java classes
>> really from scratch.
>>
>>>> I should also not the other two models I have (one is very trivial)
>>>> show the same behavior (include XMLType).
>>>>
>>> Perhaps you could share them? I.e., attach them to a bugzilla so I can
>>> have a look...
>> I have been asking just how I can send You the whole project.
>> If You feel opening a bugzilla is the right way I will do it
>> immediately.
>> I didn't do it before because I do not think this is an EMF bug.
>>
>> Regards
>> Mauro
>>
>>
>>>>> Cheers,
>>>>> Ed
>>>>>
>>>>>
>>>>> Mauro Condarelli wrote:
>>>>>
>>>>>> Il 02/03/2011 20:57, Ed Merks ha scritto:
>>>>>>
>>>>>>
>>>>>>> Mauro,
>>>>>>>
>>>>>>> I can't reproduce the problem you describe from just this Ecore
>>>>>>> model.
>>>>>>> You're package doesn't use XMLType...
>>>>>>>
>>>>>>>
>>>>>> I can zip& send the whole project, If You want.
>>>>>> Where should I put it?
>>>>>> The project holds just three EMF models, all built from annotated
>>>>>> java.
>>>>>> One (World) has been modified to include some computed fields and
>>>>>> stuff.
>>>>>>
>>>>>> The string "XMLType" appears in two places:
>>>>>>
>>>>>> World.genmodel:
>>>>>> <?xml version="1.0" encoding="UTF-8"?>
>>>>>> <genmodel:GenModel xmi:version="2.0"
>>>>>> xmlns:xmi="http://www.omg.org/XMI"
>>>>>> xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
>>>>>> xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel"
>>>>>> modelDirectory="/it.condarelli.writer.model/src"
>>>>>> modelPluginID="it.condarelli.writer.model" modelName="World"
>>>>>> importerID="org.eclipse.emf.importer.java"
>>>>>> complianceLevel="6.0" copyrightFields="false" language=""
>>>>>> usedGenPackages=" platform:/plugin/org.eclipse.emf.ecore/model/XMLType.genmode l#//type
>>>>>>
>>>>>> platform:/plugin/org.eclipse.emf.ecore/model/Ecore.genmodel# //ecore "
>>>>>> runtimePlatform="RCP">
>>>>>> <foreignModel>@model</foreignModel>
>>>>>> <genPackages prefix="World"
>>>>>> basePackage="it.condarelli.writer.model" resource="XML"
>>>>>> disposableProviderFactory="true" ecorePackage="world.ecore#/">
>>>>>> <genEnums typeSafeEnumCompatible="false"
>>>>>> ecoreEnum="world.ecore#//ActorType">
>>>>>> ...
>>>>>>
>>>>>> And is actually used in (generated) WorldPackageImpl.java (this
>>>>>> compiles without any warning):
>>>>>>
>>>>>> ...
>>>>>> import org.eclipse.emf.ecore.xml.type.XMLTypePackage;
>>>>>> ...
>>>>>>
>>>>>> /**
>>>>>> * Creates, registers, and initializes the<b>Package</b> for this
>>>>>> model, and for any others upon which it depends.
>>>>>> *
>>>>>> *<p>This method is used to initialize {@link
>>>>>> WorldPackage#eINSTANCE} when that field is accessed.
>>>>>> * Clients should not invoke it directly. Instead, they should
>>>>>> simply access that field to obtain the package.
>>>>>> *<!-- begin-user-doc -->
>>>>>> *<!-- end-user-doc -->
>>>>>> * @see #eNS_URI
>>>>>> * @see #createPackageContents()
>>>>>> * @see #initializePackageContents()
>>>>>> * @generated
>>>>>> */
>>>>>> public static WorldPackage init() {
>>>>>> if (isInited) return
>>>>>> (WorldPackage)EPackage.Registry.INSTANCE.getEPackage(WorldPa ckage.eNS_URI);
>>>>>>
>>>>>>
>>>>>> ...
>>>>>> // Initialize simple dependencies
>>>>>> XMLTypePackage.eINSTANCE.eClass();
>>>>>> EcorePackage.eINSTANCE.eClass();
>>>>>>
>>>>>>
>>>>>> The other two models have the same pattern, but I'm not trying to
>>>>>> generare edit/editor for them, at the moment.
>>>>>>
>>>>>> Thanks a lot for Your time
>>>>>> Mauro
>>>>>>
>>>>>>
>>>>
>>>>
>>
>
Re: Code generation for RCP editor broken? [message #657735 is a reply to message #657714] Thu, 03 March 2011 17:30 Go to previous message
Mauro Condarelli is currently offline Mauro CondarelliFriend
Messages: 428
Registered: September 2009
Senior Member
Il 03/03/2011 17:41, Ed Merks ha scritto:
> Mauro,
>
> When I test the problem, I'll test it first with my 2.7 (current)
> installation. If it's working well there, it's likely working well in
> 2.6. Which version are you using?

I just submitted a bugzilla.

I am using helios, updated fairly recently.
EMF comes from http://download.eclipse.org/modeling/emf/updates/interim/ and was checked for updates together with the main helios release (one week ago, I think).

I did a "Check for updates" right now and it proposed just:

Eclipse for RCP and RAP Developers 1.3.2.20110301-1807 epp.package.rcp

Which I installed, but I do not think it is relevant.

Current list of installed plugin is (a bit long...):

C/C++ Code Analysis Framework (Codan) 1.0.0.201102110609 org.eclipse.cdt.codan.feature.feature.group
C/C++ Debugger Services Framework (DSF) Examples 2.1.0.201102110609 org.eclipse.cdt.examples.dsf.feature.group
C/C++ Development Platform 7.0.2.201102110609 org.eclipse.cdt.platform.feature.group
C/C++ Development Tools 7.0.2.201102110609 org.eclipse.cdt.feature.group
C/C++ Development Tools SDK 7.0.2.201102110609 org.eclipse.cdt.sdk.feature.group
C/C++ DSF GDB Debugger Integration 2.1.0.201102110609 org.eclipse.cdt.gnu.dsf.feature.group
C/C++ GCC Cross Compiler Support 1.0.0.201102110609 org.eclipse.cdt.build.crossgcc.feature.group
C/C++ GDB Hardware Debugging 7.0.0.201102110609 org.eclipse.cdt.debug.gdbjtag.feature.group
C/C++ GNU Toolchain Build Support 7.0.0.201102110609 org.eclipse.cdt.gnu.build.feature.group
C/C++ GNU Toolchain Debug Support 7.0.1.201102110609 org.eclipse.cdt.gnu.debug.feature.group
C/C++ Memory View Enhancements 2.1.0.201102110609 org.eclipse.cdt.debug.ui.memory.feature.group
C/C++ Remote Launch 6.0.0.201102110609 org.eclipse.cdt.launch.remote.feature.group
C99 LR Parser 5.1.1.201102110609 org.eclipse.cdt.core.lrparser.feature.feature.group
C99 LR Parser SDK 5.1.1.201102110609 org.eclipse.cdt.core.lrparser.sdk.feature.group
CDT Tests 7.0.0.201102110609 org.eclipse.cdt.testing.feature.group
CSS Editor 8.1.0.r36x201010211334 com.instantiations.css.feature.feature.group
Eclipse Debugger for C/C++ 1.0.0.201102110609 org.eclipse.cdt.debug.edc.feature.group
Eclipse for RCP and RAP Developers 1.3.2.20110301-1807 epp.package.rcp
Eclipse Modeling Tools 1.3.2.20110301-1807 epp.package.modeling
Eclipse PDE Plug-in Developer Resources 3.6.2.r362_v20110203-7b7mFL2FET3dhHalh1iNZtL org.eclipse.pde.source.feature.group
Eclipse SDK Examples 3.3.1.r362_v20101014-817fFcgFE_daeVKiesDUeYc org.eclipse.sdk.examples.feature.group
Eclipse SDK Examples Source 3.3.1.r362_v20101014 org.eclipse.sdk.examples.source.feature.group
EMF - Eclipse Modeling Framework SDK 2.6.1.v20100914-1218 org.eclipse.emf.sdk.feature.group
EMF Compare SDK 1.1.2.v20110202-0936 org.eclipse.emf.compare.sdk.feature.group
EPP Modeling Feature 1.3.2.20110301-1807 org.eclipse.epp.package.modeling.feature.feature.group
GroupLayout Support 8.1.0.r36x201010220713 com.instantiations.designer.layout.group.feature.feature.gro up
GWT Designer 8.1.0.r36x201010220728 com.instantiations.designer.gwt.feature.feature.group
GWT Designer Core 8.1.0.r36x201010220326 com.instantiations.designer.gwtcore.feature.feature.group
JavaHL 1.6.12 Win32 Binaries (Optional) 2.2.2.I20101203-1700 org.polarion.eclipse.team.svn.connector.javahl16.win32.featu re.group
MDT Papyrus - Runtime and Tools (Incubation) 0.7.2.v201101191114 org.eclipse.papyrus.feature.group
Miscellaneous C/C++ Utilities 5.1.0.201102110609 org.eclipse.cdt.util.feature.group
Native JavaHL 1.6 Implementation (Optional) 2.2.2.I20110124-1700 org.polarion.eclipse.team.svn.connector.javahl16.feature.gro up
P2 C/C++ Toolchain Installer 1.0.0.201102110609 org.eclipse.cdt.p2.feature.group
PDE/API Tools Environment Descriptions 1.0.0.v20100427-7C-7BF9JgLWLMBMMAMsLL org.eclipse.pde.api.tools.ee.fragments.feature.group
Shared 6.0.0.r36x201010211311 com.instantiations.eclipse.shared.feature.group
Source for XSD - XML Schema Definition Model 2.6.0.v20100914-1218 org.eclipse.xsd.source.feature.group
Subversive SVN Connectors 2.2.2.I20110124-1700 org.polarion.eclipse.team.svn.connector.feature.group
Subversive SVN JDT Ignore Extensions (Optional) (Incubation) 0.7.9.I20101203-1700 org.eclipse.team.svn.resource.ignore.rules.jdt.feature.group
Subversive SVN Team Provider (Incubation) 0.7.9.I20110207-1700 org.eclipse.team.svn.feature.group
Swing Designer 8.1.0.r36x201010220722 com.instantiations.designer.swing.feature.feature.group
SWT Designer 8.1.0.r36x201010220731 com.instantiations.designer.rcp.feature.feature.group
SWT Designer Core 8.1.0.r36x201010220720 com.instantiations.designer.swt.feature.feature.group
SWT Designer XWT Support 8.1.0.r36x201010220718 com.instantiations.designer.xwt.feature.feature.group
TPTP Platform Integration PDE 4.5.2.v201101261720-5417w312212322161 org.eclipse.tptp.platform.integration.pde.feature.group
UML2 Extender SDK 3.1.2.v201010261927 org.eclipse.uml2.sdk.feature.group
Unified Parallel C Berkeley UPC Toolchain Support 1.0.3.201102110609 org.eclipse.cdt.bupc.feature.group
Unified Parallel C Support 5.1.0.201102110609 org.eclipse.cdt.core.parser.upc.feature.feature.group
Unified Parallel C Support SDK 5.1.0.201102110609 org.eclipse.cdt.core.parser.upc.sdk.feature.group
WindowBuilder Common UI Support 8.1.0.r36x201010211320 com.instantiations.eclipse.ui.feature.group
WindowBuilder Core 8.1.0.r36x201010220706 com.instantiations.designer.core.feature.feature.group
WindowBuilder SWT_AWT Support 8.1.0.r36x201010220734 com.instantiations.designer.rcp.SWT_AWT_support.feature.grou p
WindowBuilder XML Core 8.1.0.r36x201010220713 com.instantiations.designer.core.xml.feature.feature.group
XL C/C++ Compiler Support 6.1.0.201102110609 org.eclipse.cdt.xlc.feature.feature.group
XL C/C++ Compiler Support SDK 6.1.0.201102110609 org.eclipse.cdt.xlc.sdk.feature.group
XSD - XML Schema Definition Model 2.6.0.v20100914-1218 org.eclipse.xsd.feature.group
XSD - XML Schema Definition SDK 2.6.0.v20100914-1218 org.eclipse.xsd.sdk.feature.group
XSD Documentation 2.6.0.v20100914-1218 org.eclipse.xsd.doc.feature.group
XSD Ecore Converter 2.6.0.v20100914-1218 org.eclipse.xsd.ecore.converter.feature.group
XSD Edit 2.6.0.v20100914-1218 org.eclipse.xsd.edit.feature.group
XSD Mapping 2.6.0.v20100914-1218 org.eclipse.xsd.mapping.feature.group
XSD Mapping Editor 2.6.0.v20100914-1218 org.eclipse.xsd.mapping.editor.feature.group
XSD Sample Editor 2.6.0.v20100914-1218 org.eclipse.xsd.editor.feature.group

>
>
> Mauro Condarelli wrote:
>> In the process of submitting the bugzilla I found out I have
>>
>> EMF Code Generation
>> Version: 2.6.0.v20100914-1218
>> Build id: R201009141218
>>
>> while bugzilla suggests revisions up to 4.0
>>
>> Should I try to upgrade before submitting?
>>
>> Regards
>> Mauro
>>
>> Il 03/03/2011 17:23, Mauro Condarelli ha scritto:
>>> Thanks Ed,
>>> comments below.
>>>
>>> Il 03/03/2011 15:52, Ed Merks ha scritto:
>>>> Mauro,
>>>>
>>>> Comments below.
>>>>
>>>> Mauro Condarelli wrote:
>>>>> Thanks Ed,
>>>>> comments below.
>>>>>
>>>>> Il 02/03/2011 23:58, Ed Merks ha scritto:
>>>>>
>>>>>> Mauro,
>>>>>>
>>>>>> If you delete this line from the *.genmodel:
>>>>>>
>>>>>> usedGenPackages=" platform:/plugin/org.eclipse.emf.ecore/model/XMLType.genmode l#//type
>>>>>>
>>>>>> platform:/plugin/org.eclipse.emf.ecore/model/Ecore.genmodel# //ecore "
>>>>>>
>>>>> Done.
>>>>>
>>>>>> Does the generator still open properly (without errors)? If you
>>>>>>
>>>>> Yes, it does.
>>>>> It also produce a "WorldEditor" able to open my serialized data (I di
>>>>> not try to modify and save).
>>>>>
>>>> I figured they looked redundant. The odd thing is that when I extract a
>>>> model from the annotated Java generated from the Ecore you provided,
>>>> they don't show up in mine. So there must be stuff in your projects
>>>> that have an impact on the annotation analysis, but aren't really part
>>>> of your model. I'd need to be able to reproduce that...
>>> As said I have no problem sharing whatever.
>>> This is a personal project and I plan to release it as Open Source if
>>> and when it comes to a shape where it could be useful to someone else.
>>> I think the best would be to share just the "models" project, as I do
>>> not think this comes from somewhere else.
>>>
>>>>> I should mention I had an exception on shutdown:
>>>>>
>>>>> org.eclipse.swt.SWTException: Failed to execute runnable
>>>>> (java.lang.NullPointerException)
>>>>> at org.eclipse.swt.SWT.error(SWT.java:4083)
>>>>> at org.eclipse.swt.SWT.error(SWT.java:3998)
>>>>> ...
>>>>> Caused by: java.lang.NullPointerException
>>>>> at
>>>>> it.condarelli.writer.model.world.presentation.WorldEditor.se tSelectionToViewer(WorldEditor.java:668)
>>>>>
>>>>>
>>>>> at
>>>>> it.condarelli.writer.model.world.presentation.WorldEditor$3$ 1.run(WorldEditor.java:621)
>>>>>
>>>>>
>>>>>
>>>> Is this in the middle of processing an event from the command stack?
>>>> What just happened with the stack?
>>> I do not know.
>>> It happened when I shut down the eclipse instance hitting the cross
>>> decoration top right of the window.
>>> It was the plain generated RCP editor. No customization whatsoever.
>>>
>>>>> at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:3 5)
>>>>> ...
>>>>>
>>>>> /**
>>>>> * This sets the selection into whichever viewer is active.
>>>>> *<!-- begin-user-doc -->
>>>>> *<!-- end-user-doc -->
>>>>> * @generated
>>>>> */
>>>>> public void setSelectionToViewer(Collection<?> collection) {
>>>>> final Collection<?> theSelection = collection;
>>>>> // Make sure it's okay.
>>>>> //
>>>>> if (theSelection != null&& !theSelection.isEmpty()) {
>>>>> Runnable runnable =
>>>>> new Runnable() {
>>>>> public void run() {
>>>>> // Try to select the items in the current content viewer of the
>>>>> editor.
>>>>> //
>>>>> if (currentViewer != null) {
>>>>> currentViewer.setSelection(new
>>>>> StructuredSelection(theSelection.toArray()), true);
>>>>> }
>>>>> }
>>>>> };
>>>>> getSite().getShell().getDisplay().asyncExec(runnable);<-- THIS IS
>>>>> LINE 668
>>>>> }
>>>>> }
>>>>>
>>>>>
>>>>>
>>>>>> "Reload..." the model after that, do these used packages come
>>>>>> back. The
>>>>>>
>>>>> Yes, they do.
>>>>> If I "Reload..." the model (World.genmodel) gets back exactly as
>>>>> before (with the same attribute I just deleted).
>>>>> There must be something in my annotated java that forces this
>>>>> generation, but I don't understand what.
>>>>>
>>>> Me neither; I'd have to see it happen.
>>> You are more than welcome... after that please explain to me just *how*
>>> I made a fool of myself.
>>>
>>>>> The string "XMLType" appears just in the places I already said (see
>>>>> below); what else should I check?
>>>>>
>>>>>
>>>>>> don't appear to be needed. Maybe they're remnants of some earlier
>>>>>> experimentation on your part?
>>>>>>
>>>>> That may well be since this model was where I did a lot of
>>>>> trial&error learning, but I cannot understand where it comes from.
>>>>>
>>>> You could delete all the files with @model annotations in them and
>>>> regenerate them all to clean out any cruft...
>>> That is not really an option.
>>> I can do it just to test, but I already modified the model a lot adding
>>> methods and stuff that I would lose if I regenerate the java classes
>>> really from scratch.
>>>
>>>>> I should also not the other two models I have (one is very trivial)
>>>>> show the same behavior (include XMLType).
>>>>>
>>>> Perhaps you could share them? I.e., attach them to a bugzilla so I can
>>>> have a look...
>>> I have been asking just how I can send You the whole project.
>>> If You feel opening a bugzilla is the right way I will do it
>>> immediately.
>>> I didn't do it before because I do not think this is an EMF bug.
>>>
>>> Regards
>>> Mauro
>>>
>>>
>>>>>> Cheers,
>>>>>> Ed
>>>>>>
>>>>>>
>>>>>> Mauro Condarelli wrote:
>>>>>>
>>>>>>> Il 02/03/2011 20:57, Ed Merks ha scritto:
>>>>>>>
>>>>>>>
>>>>>>>> Mauro,
>>>>>>>>
>>>>>>>> I can't reproduce the problem you describe from just this Ecore
>>>>>>>> model.
>>>>>>>> You're package doesn't use XMLType...
>>>>>>>>
>>>>>>>>
>>>>>>> I can zip& send the whole project, If You want.
>>>>>>> Where should I put it?
>>>>>>> The project holds just three EMF models, all built from annotated
>>>>>>> java.
>>>>>>> One (World) has been modified to include some computed fields and
>>>>>>> stuff.
>>>>>>>
>>>>>>> The string "XMLType" appears in two places:
>>>>>>>
>>>>>>> World.genmodel:
>>>>>>> <?xml version="1.0" encoding="UTF-8"?>
>>>>>>> <genmodel:GenModel xmi:version="2.0"
>>>>>>> xmlns:xmi="http://www.omg.org/XMI"
>>>>>>> xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
>>>>>>> xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel"
>>>>>>> modelDirectory="/it.condarelli.writer.model/src"
>>>>>>> modelPluginID="it.condarelli.writer.model" modelName="World"
>>>>>>> importerID="org.eclipse.emf.importer.java"
>>>>>>> complianceLevel="6.0" copyrightFields="false" language=""
>>>>>>> usedGenPackages=" platform:/plugin/org.eclipse.emf.ecore/model/XMLType.genmode l#//type
>>>>>>>
>>>>>>> platform:/plugin/org.eclipse.emf.ecore/model/Ecore.genmodel# //ecore "
>>>>>>> runtimePlatform="RCP">
>>>>>>> <foreignModel>@model</foreignModel>
>>>>>>> <genPackages prefix="World"
>>>>>>> basePackage="it.condarelli.writer.model" resource="XML"
>>>>>>> disposableProviderFactory="true" ecorePackage="world.ecore#/">
>>>>>>> <genEnums typeSafeEnumCompatible="false"
>>>>>>> ecoreEnum="world.ecore#//ActorType">
>>>>>>> ...
>>>>>>>
>>>>>>> And is actually used in (generated) WorldPackageImpl.java (this
>>>>>>> compiles without any warning):
>>>>>>>
>>>>>>> ...
>>>>>>> import org.eclipse.emf.ecore.xml.type.XMLTypePackage;
>>>>>>> ...
>>>>>>>
>>>>>>> /**
>>>>>>> * Creates, registers, and initializes the<b>Package</b> for this
>>>>>>> model, and for any others upon which it depends.
>>>>>>> *
>>>>>>> *<p>This method is used to initialize {@link
>>>>>>> WorldPackage#eINSTANCE} when that field is accessed.
>>>>>>> * Clients should not invoke it directly. Instead, they should
>>>>>>> simply access that field to obtain the package.
>>>>>>> *<!-- begin-user-doc -->
>>>>>>> *<!-- end-user-doc -->
>>>>>>> * @see #eNS_URI
>>>>>>> * @see #createPackageContents()
>>>>>>> * @see #initializePackageContents()
>>>>>>> * @generated
>>>>>>> */
>>>>>>> public static WorldPackage init() {
>>>>>>> if (isInited) return
>>>>>>> (WorldPackage)EPackage.Registry.INSTANCE.getEPackage(WorldPa ckage.eNS_URI);
>>>>>>>
>>>>>>>
>>>>>>> ...
>>>>>>> // Initialize simple dependencies
>>>>>>> XMLTypePackage.eINSTANCE.eClass();
>>>>>>> EcorePackage.eINSTANCE.eClass();
>>>>>>>
>>>>>>>
>>>>>>> The other two models have the same pattern, but I'm not trying to
>>>>>>> generare edit/editor for them, at the moment.
>>>>>>>
>>>>>>> Thanks a lot for Your time
>>>>>>> Mauro
>>>>>>>
>>>>>>>
>>>>>
>>>>>
>>>
>>
Previous Topic:concrete type in xsi:type instead of element name
Next Topic:Emf property sheet problem
Goto Forum:
  


Current Time: Tue Oct 15 08:25:39 GMT 2019

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

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

Back to the top