Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 313359

Summary: Fields of the model facet in the gmfgen are not editable in the gmfgen editor
Product: [Modeling] GMF-Runtime Reporter: Patrick Tessier <Patrick.Tessier>
Component: NotationAssignee: Lidija Grahek <lgrahek>
Status: RESOLVED FIXED QA Contact:
Severity: critical    
Priority: P3 CC: aboyko, ahunter.eclipse, Ed.Merks, lgrahek, mariot.chauvin
Version: 2.1Flags: Ed.Merks: pmc_approved+
mariot.chauvin: review? (ahunter.eclipse)
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
this file contains the error log + the list of used features
none
patch for notation.genmodel file
none
Full notation.genmodel patch none

Description Patrick Tessier CLA 2010-05-18 10:06:15 EDT
Created attachment 168932 [details]
this file contains the error log + the list of used features

Hi,  I'm commeter in the papyrus project

when I open a gmfgen with the gmfgen editor. Fields that reference eobjects can not be edited.
for example: I can not succeed to edit fields in the model facet or fields in the extension gmfgen. 

The attachement is the log.
Comment 1 Mariot Chauvin CLA 2010-06-02 09:47:02 EDT
Hi Patrick,

This error log generally indicates that the referenced eObject could not be found, it does not resolve. Could you check that the eObject you reference are accessible (have a look to the URI) ? Could you provide the gmfgen file, or at least the URIs which do not resolve ?  

Thanks,

Mariot
Comment 2 Patrick Tessier CLA 2010-06-02 10:13:27 EDT
The gmf gnen model that can be found : 
http://dev.eclipse.org/svnroot/modeling/org.eclipse.mdt.papyrus/trunk/plugins/uml/org.eclipse.papyrus.diagram.clazz/model/classdiagram.gmfgen
in the directory 
http://dev.eclipse.org/svnroot/modeling/org.eclipse.mdt.papyrus/trunk/plugins/uml/org.eclipse.papyrus.diagram.clazz/model/

to open it you need to have the following plugin http://dev.eclipse.org/svnroot/modeling/org.eclipse.mdt.papyrus/trunk/plugins/developer/org.eclipse.papyrus.gmfgenextension , because we use the extension of the gmf gen.

It is strange because, when i open the file all runs, I can generate the code.
the bug comes from when I try to edit the gmfgen file, when the editor looks for all possible values in order to create the combo box.
I have followed with the debugger, it seems that it does not find a super class so the array contains a value null.
Comment 3 Mariot Chauvin CLA 2010-06-02 11:07:13 EDT
(In reply to comment #2)
> The gmf gnen model that can be found : 
> http://dev.eclipse.org/svnroot/modeling/org.eclipse.mdt.papyrus/trunk/plugins/uml/org.eclipse.papyrus.diagram.clazz/model/classdiagram.gmfgen
> in the directory 
> http://dev.eclipse.org/svnroot/modeling/org.eclipse.mdt.papyrus/trunk/plugins/uml/org.eclipse.papyrus.diagram.clazz/model/
> 
> to open it you need to have the following plugin
> http://dev.eclipse.org/svnroot/modeling/org.eclipse.mdt.papyrus/trunk/plugins/developer/org.eclipse.papyrus.gmfgenextension
> , because we use the extension of the gmf gen.
> 
> It is strange because, when i open the file all runs, I can generate the code.
> the bug comes from when I try to edit the gmfgen file, when the editor looks
> for all possible values in order to create the combo box.
> I have followed with the debugger, it seems that it does not find a super class
> so the array contains a value null.

Patrick could you debug on your side, and say which eClasses are in parameters of collectGenClasses which returns a array with a null value ?
Comment 4 Patrick Tessier CLA 2010-06-02 11:41:23 EDT
At each time, this is the  ecore class RoutingStyle that bugs
at debugger it contains as eAllSupertype:
 - Style
 - RoundedCornersStyle

At this line
GenClassImpl.getLabelFeatureCandidates() line: 2043	

 public List<GenFeature> getLabelFeatureCandidates()
  {
    return 
      collectGenFeatures
        (getAllBaseGenClasses(), 
         getGenFeatures(), 
         new GenFeatureFilter() 
         {
           public boolean accept(GenFeature genFeature) 
           {
             return !genFeature.isReferenceType() && !genFeature.isListType() && !genFeature.isMapType();
           }
         });
  }
getAllBaseGenClasses() seems to collect all esuperclass
 see code in GenClassImpl:

public List<GenClass> getAllBaseGenClasses()
  {
    return collectGenClasses(getEcoreClass().getEAllSuperTypes(), null);
  }

Normally we have to obtain this two superclasse: Style  and RoundedCornersStyle
but we obtain a list with the size =2 in which RoundedCornersStyle is absent.

We have only style in the list but the size equal 2.
Comment 5 Mariot Chauvin CLA 2010-06-03 12:54:27 EDT
(In reply to comment #4)
> At each time, this is the  ecore class RoutingStyle that bugs
> at debugger it contains as eAllSupertype:
>  - Style
>  - RoundedCornersStyle
> 
> At this line
> GenClassImpl.getLabelFeatureCandidates() line: 2043    
> 
>  public List<GenFeature> getLabelFeatureCandidates()
>   {
>     return 
>       collectGenFeatures
>         (getAllBaseGenClasses(), 
>          getGenFeatures(), 
>          new GenFeatureFilter() 
>          {
>            public boolean accept(GenFeature genFeature) 
>            {
>              return !genFeature.isReferenceType() && !genFeature.isListType()
> && !genFeature.isMapType();
>            }
>          });
>   }
> getAllBaseGenClasses() seems to collect all esuperclass
>  see code in GenClassImpl:
> 
> public List<GenClass> getAllBaseGenClasses()
>   {
>     return collectGenClasses(getEcoreClass().getEAllSuperTypes(), null);
>   }
> 
> Normally we have to obtain this two superclasse: Style  and RoundedCornersStyle
> but we obtain a list with the size =2 in which RoundedCornersStyle is absent.
> 
> We have only style in the list but the size equal 2.

Did you have an old version of GMF installed in your platform ?


I have checked that "NotationPackage.eINSTANCE.getRoundedCornersStyle();" in RC3 does not return null.
Comment 6 Patrick Tessier CLA 2010-06-08 13:51:13 EDT
I have downloaded the RC3 version an my version GMF is 2.3 20100508.
I have also to remove the extension of the gmfgen, but the bug remains.
Have you succeed to edit a gmfgen?

Several colleagueq have the same problem.
Comment 7 Mariot Chauvin CLA 2010-06-09 06:40:24 EDT
I was able to reproduce.
The notation.genmodel is not up to date, it does not contain the genClass for RoundedCornerStyle !

I assigned myself.
Comment 8 Mariot Chauvin CLA 2010-06-09 06:48:17 EDT
Created attachment 171506 [details]
patch for notation.genmodel file
Comment 9 Mariot Chauvin CLA 2010-06-09 06:50:46 EDT
According to Modeling ramp down policy,  I am asking a review and pmc approval
to commit this fix.
Comment 10 Anthony Hunter CLA 2010-06-09 09:58:53 EDT
Hi Lidija, It looks like we must have forgotten to commit the notation.genmodel changes with Bug 309221 . The notation.ecore file has your changes, but not the notation.genmodel .

I refreshed and more than just Mariot's change is missing. Lidija, can you have a look?

Are we saying that the GMF Tooling requires the notation.genmodel ? I never realized this.
Comment 11 Anthony Hunter CLA 2010-06-09 10:02:55 EDT
The notation.genmodel is not deplyed at runtime. So the patch to notation.genmodel does not actually fix any notation code.

Mariot, what is missing here?
Comment 12 Lidija Grahek CLA 2010-06-09 10:32:04 EDT
Created attachment 171532 [details]
Full notation.genmodel patch

I attached the full patch for notation.genmodel in case it needs to be committed.
Comment 13 Mariot Chauvin CLA 2010-06-09 11:16:45 EDT
(In reply to comment #11)
> The notation.genmodel is not deplyed at runtime. So the patch to
> notation.genmodel does not actually fix any notation code.
> 
> Mariot, what is missing here?

The notation.genmodel is used by EMF which read it with this uri "platform:/plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel" due to the fact that gmfgen models reference it.
Comment 14 Mariot Chauvin CLA 2010-06-09 12:02:49 EDT
(In reply to comment #13)
> (In reply to comment #11)
> > The notation.genmodel is not deplyed at runtime. So the patch to
> > notation.genmodel does not actually fix any notation code.
> > 
> > Mariot, what is missing here?
> 
> The notation.genmodel is used by EMF which read it with this uri
> "platform:/plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel" due
> to the fact that gmfgen models reference it.

Anthony could I commit the full notation.genmodel patch from Lidija ?
Comment 15 Anthony Hunter CLA 2010-06-09 14:50:33 EDT
(In reply to comment #11)
> The notation.genmodel is not deplyed at runtime. So the patch to
> notation.genmodel does not actually fix any notation code.

OK, and the notation.genmodel is deployed at runtime as the models folder is delivered in the org.eclipse.gmf.runtime.notation bundle.

Unfortunately, we are going to have to put this in 1.4.1 SR1. We can update the
interim builds, we can point them at the update site.

Or is this a GMF Tooling will not work for Helios unless we fix this?
Comment 16 Anthony Hunter CLA 2010-07-09 11:57:05 EDT
Hi Lidija, This needs to be committed to R1_4_maintenance and HEAD
Comment 17 Lidija Grahek CLA 2010-07-09 13:02:16 EDT
Committed to both R1_4_maintenance and HEAD.