Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » GMF customization with EEF
GMF customization with EEF [message #1029355] Fri, 29 March 2013 11:02 Go to next message
Valerian Merkling is currently offline Valerian Merkling
Messages: 71
Registered: May 2011
Member
Hello !

I would like to use EEF to custom my GMF Diagram editor, but i'm missing the step where i tell Gmf that it need to use my newly generated classes.

I tried to have a look into the code, and the only result i had was to make the property tab empty ...

Can anyone help me ?

Regards,

Valerian Merkling
Re: GMF customization with EEF [message #1032719 is a reply to message #1029355] Wed, 03 April 2013 06:43 Go to previous messageGo to next message
Michael Golubev is currently offline Michael Golubev
Messages: 373
Registered: July 2009
Senior Member
Hello,

GMF does not know which plugin provides the property tabs for the editor, it just declares the contributor ID for someone who wants to provide its contents here. So there is no code in diagram plugin to change.

Instead, you need to reference this diagram controbutor ID from EEF plugin:
- in the diagram plugin. search for: org.eclipse.ui.views.properties.tabbed.propertyContributor extension, it will be like this:
Quote:

<extension point="org.eclipse.ui.views.properties.tabbed.propertyContributor" id="prop-contrib">
<?gmfgen generated="true"?>
<propertyContributor
contributorId="org.eclipse.gmf.examples.ocldriven.diagram"
labelProvider="org.eclipse.gmf.examples.ocldriven.toe.diagram.sheet.TOESheetLabelProvider">
<propertyCategory category="domain"/>
<propertyCategory category="visual"/>
<propertyCategory category="extra"/>
</propertyContributor>
</extension>

- note the contributorId (in bold)
- note one of the existing categories (in bold)
- copy/paste the "org.eclipse.ui.views.properties.tabbed.propertyTabs" and "org.eclipse.ui.views.properties.tabbed.propertySections" extensions from EEF-generated plugin.xml fragment to the real plugin.xml for edit plugin (if you followed the EEF tutorial, you may already have one copy of these 2 extensions there for EMF tree editor)
- in the BOTH copy/pasted duplicated extensions replace the EEF contributorID to the GMF contributor id (first bold from step1), so in my sample it would be:
   <extension
         point="org.eclipse.ui.views.properties.tabbed.propertySections">
      <propertySections
            contributorId="org.eclipse.gmf.examples.ocldriven.diagram">
       ...

   <extension
         point="org.eclipse.ui.views.properties.tabbed.propertyTabs">
      <propertyTabs
            contributorId="org.eclipse.gmf.examples.ocldriven.diagram">
      ...

- in the copy/pasted "org.eclipse.ui.views.properties.tabbed.propertyTabs" extension replace the category="<whatever>" by the actual category from GMF (second bold from step1 -- e.g "domain"):
      <propertyTabs
            contributorId="org.eclipse.gmf.examples.ocldriven.diagram">
         <propertyTab
               id="Base"
               label="EEF-Base"
               category="domain">
         </propertyTab>
         ....


I just made exactly these steps for GMF-T OCL/driven sample, and that all I needed to get an attached screenshot.
Re: GMF customization with EEF [message #1124477 is a reply to message #1032719] Thu, 03 October 2013 11:22 Go to previous messageGo to next message
luca panebianco is currently offline luca panebianco
Messages: 4
Registered: October 2013
Junior Member
Hi,
I've tried the steps before...but nothing happened...i have the default property view.

I've followed the "EMF tree editor example" and everything went ok..i continued creating a simple GMF diagram but the modification to the plugin.xml file inside the edit project did nothing....

There is any passage i forgot? Or something else that must to be done in order to see the EEF property view?
Re: GMF customization with EEF [message #1128625 is a reply to message #1124477] Mon, 07 October 2013 18:09 Go to previous messageGo to next message
Christian Smietana is currently offline Christian Smietana
Messages: 11
Registered: February 2011
Junior Member
luca panebianco wrote on Thu, 03 October 2013 11:22

There is any passage i forgot? Or something else that must to be done in order to see the EEF property view?


Yes, it's important that you add this to one of the property sections generated by eef:

<input type="org.eclipse.gmf.runtime.notation.View"/>
<input type="org.eclipse.gef.EditPart"/>


Example:
<propertySections
   contributorId="my.contributor.id">
   <propertySection          class="org.eclipse.emf.eef.runtime.ui.properties.sections.PropertiesEditionSection"
      id="section.id"
      tab="Base">
      <input
         type="my.object.class">
      </input>
      <input type="org.eclipse.gmf.runtime.notation.View"/>
      <input type="org.eclipse.gef.EditPart"/>
   </propertySection>



I think this is missing in the eef documentation.

Good luck
Christian
Re: GMF customization with EEF [message #1129112 is a reply to message #1128625] Tue, 08 October 2013 05:46 Go to previous message
luca panebianco is currently offline luca panebianco
Messages: 4
Registered: October 2013
Junior Member
Thanks! You saved me! Very Happy

Now i will try to ask to add this little but important step in the EEF guide!
Previous Topic:Expression Label For Element
Next Topic:How is saving working in GMF?
Goto Forum:
  


Current Time: Thu Aug 21 18:05:53 EDT 2014

Powered by FUDForum. Page generated in 0.02598 seconds