Skip to main content


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 15:02 Go to next message
Valerian Merkling is currently offline Valerian MerklingFriend
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 10:43 Go to previous messageGo to next message
Michael Golubev is currently offline Michael GolubevFriend
Messages: 383
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 15:22 Go to previous messageGo to next message
luca panebianco is currently offline luca panebiancoFriend
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 22:09 Go to previous messageGo to next message
Christian Smietana is currently offline Christian SmietanaFriend
Messages: 14
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 09:46 Go to previous messageGo to next message
luca panebianco is currently offline luca panebiancoFriend
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!
Re: GMF customization with EEF [message #1439083 is a reply to message #1129112] Mon, 06 October 2014 21:34 Go to previous messageGo to next message
Nigel Daniels is currently offline Nigel DanielsFriend
Messages: 40
Registered: May 2011
Member
On 08/10/2013 02:46, luca panebianco wrote:
> Thanks! You saved me! :d
>
> Now i will try to ask to add this little but important step in the EEF
> guide!

On 08/10/2013 02:46, luca panebianco wrote:> Thanks! You saved me! :d
>
> Now i will try to ask to add this little but important step in the EEF
> guide
Hi, I've tried following this advice but I am not having much luck. I
set EEF to generate GMF compatible properties and have made the above
changes to the plugin.xml. When I run the diagram I am developing I see
that the 'Base' property sheet is added bu then get a dialog warning me
of null pointer exceptions. In my debug environment I see:

!ENTRY org.eclipse.ui.views.properties.tabbed 4 2 2014-10-06 14:25:28.491
!MESSAGE Problems occurred when invoking code from plug-in:
"org.eclipse.ui.views.properties.tabbed".
!STACK 0
java.lang.NullPointerException
at
org.eclipse.emf.eef.runtime.context.impl.DomainPropertiesEditionContext.createPropertiesEditingComponent(DomainPropertiesEditionContext.java:86)
at
org.eclipse.emf.eef.runtime.part.impl.SectionPropertiesEditingPart.refreshComponent(SectionPropertiesEditingPart.java:189)
at
org.eclipse.emf.eef.runtime.part.impl.SectionPropertiesEditingPart.setInput(SectionPropertiesEditingPart.java:154)
at
org.eclipse.ui.views.properties.tabbed.TabContents$5.run(TabContents.java:181)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:49)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175)
at
org.eclipse.ui.views.properties.tabbed.TabContents.setInput(TabContents.java:184)
at
org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage$SelectionChangedListener.selectionChanged(TabbedPropertySheetPage.java:212)
at org.eclipse.jface.viewers.Viewer$2.run(Viewer.java:164)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:49)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175)
at org.eclipse.jface.viewers.Viewer.fireSelectionChanged(Viewer.java:162)
at
org.eclipse.jface.viewers.StructuredViewer.updateSelection(StructuredViewer.java:2188)
at
org.eclipse.jface.viewers.StructuredViewer.handleSelect(StructuredViewer.java:1211)
at
org.eclipse.jface.viewers.StructuredViewer$4.widgetSelected(StructuredViewer.java:1241)
at
org.eclipse.jface.util.OpenStrategy.fireSelectionEvent(OpenStrategy.java:239)
at org.eclipse.jface.util.OpenStrategy.access$4(OpenStrategy.java:233)
at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:403)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4166)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1466)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1489)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1474)
at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1279)
at
org.eclipse.ui.internal.views.properties.tabbed.view.TabbedPropertyList.select(TabbedPropertyList.java:864)
at
org.eclipse.ui.internal.views.properties.tabbed.view.TabbedPropertyViewer.setSelectionToWidget(TabbedPropertyViewer.java:122)
at
org.eclipse.jface.viewers.StructuredViewer.setSelectionToWidget(StructuredViewer.java:1767)
at
org.eclipse.jface.viewers.StructuredViewer.setSelection(StructuredViewer.java:1723)
at org.eclipse.jface.viewers.Viewer.setSelection(Viewer.java:394)
at
org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage.setInput(TabbedPropertySheetPage.java:748)
at
org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage.selectionChanged(TabbedPropertySheetPage.java:556)
at
org.eclipse.gmf.runtime.diagram.ui.properties.views.PropertiesBrowserPage.selectionChanged(PropertiesBrowserPage.java:253)
at
org.eclipse.ui.views.properties.PropertySheet.selectionChanged(PropertySheet.java:365)
at
org.eclipse.ui.internal.e4.compatibility.SelectionService.notifyPostSelectionListeners(SelectionService.java:173)
at
org.eclipse.ui.internal.e4.compatibility.SelectionService.access$4(SelectionService.java:170)
at
org.eclipse.ui.internal.e4.compatibility.SelectionService$2.selectionChanged(SelectionService.java:86)
at
org.eclipse.e4.ui.internal.workbench.SelectionAggregator$4.run(SelectionAggregator.java:156)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at
org.eclipse.e4.ui.internal.workbench.SelectionAggregator.notifyPostListeners(SelectionAggregator.java:154)
at
org.eclipse.e4.ui.internal.workbench.SelectionAggregator.access$8(SelectionAggregator.java:151)
at
org.eclipse.e4.ui.internal.workbench.SelectionAggregator$8$1.run(SelectionAggregator.java:253)
at
org.eclipse.e4.core.contexts.RunAndTrack.runExternalCode(RunAndTrack.java:56)
at
org.eclipse.e4.ui.internal.workbench.SelectionAggregator$8.changed(SelectionAggregator.java:251)
at
org.eclipse.e4.core.internal.contexts.TrackableComputationExt.update(TrackableComputationExt.java:110)
at
org.eclipse.e4.core.internal.contexts.EclipseContext.processScheduled(EclipseContext.java:334)
at
org.eclipse.e4.core.internal.contexts.EclipseContext.set(EclipseContext.java:348)
at
org.eclipse.e4.ui.internal.workbench.SelectionServiceImpl.setPostSelection(SelectionServiceImpl.java:34)
at
org.eclipse.ui.internal.e4.compatibility.CompatibilityPart$3.selectionChanged(CompatibilityPart.java:128)
at
org.eclipse.gmf.runtime.diagram.ui.parts.DiagramGraphicalViewer.flushSelectionEvents(DiagramGraphicalViewer.java:256)
at
org.eclipse.gmf.runtime.diagram.ui.parts.DiagramGraphicalViewer$1.run(DiagramGraphicalViewer.java:234)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
at
org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3976)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3653)
at
org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1113)
at
org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at
org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:997)
at
org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:140)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:611)
at
org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:567)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
at com.routestovalue.route.rcp.intro.Application.start(Application.java:20)
at
org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:354)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:181)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:636)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:591)
at org.eclipse.equinox.launcher.Main.run(Main.java:1450)
at org.eclipse.equinox.launcher.Main.main(Main.java:1426)

Any suggestions on what I may be missing are welcome!
Re: GMF customization with EEF [message #1439103 is a reply to message #1439083] Mon, 06 October 2014 22:02 Go to previous messageGo to next message
Nigel Daniels is currently offline Nigel DanielsFriend
Messages: 40
Registered: May 2011
Member
Minor update!

It seems all of the problems I'm seeing are due to this first exception
(below) in which the call to createPropertiesEditingComponent() returns
a null PropertyEditingComponent, yet the ID of the component is "Base"
and the mode is "Live".

Again any suggestions are welcome.

> !ENTRY org.eclipse.ui.views.properties.tabbed 4 2 2014-10-06 14:25:28.491
> !MESSAGE Problems occurred when invoking code from plug-in:
> "org.eclipse.ui.views.properties.tabbed".
> !STACK 0
> java.lang.NullPointerException
> at
> org.eclipse.emf.eef.runtime.context.impl.DomainPropertiesEditionContext.createPropertiesEditingComponent(DomainPropertiesEditionContext.java:86)
>
> at
> org.eclipse.emf.eef.runtime.part.impl.SectionPropertiesEditingPart.refreshComponent(SectionPropertiesEditingPart.java:189)
>
> at
> ...
Re: GMF customization with EEF [message #1441431 is a reply to message #1439103] Thu, 09 October 2014 18:25 Go to previous message
Nigel Daniels is currently offline Nigel DanielsFriend
Messages: 40
Registered: May 2011
Member
On 06/10/2014 15:02, Nigel Daniels wrote:
> Minor update!
>
> It seems all of the problems I'm seeing are due to this first exception
> (below) in which the call to createPropertiesEditingComponent() returns
> a null PropertyEditingComponent, yet the ID of the component is "Base"
> and the mode is "Live".
>
> Again any suggestions are welcome.
>
>> !ENTRY org.eclipse.ui.views.properties.tabbed 4 2 2014-10-06 14:25:28.491
>> !MESSAGE Problems occurred when invoking code from plug-in:
>> "org.eclipse.ui.views.properties.tabbed".
>> !STACK 0
>> java.lang.NullPointerException
>> at
>> org.eclipse.emf.eef.runtime.context.impl.DomainPropertiesEditionContext.createPropertiesEditingComponent(DomainPropertiesEditionContext.java:86)
>>
>>
>> at
>> org.eclipse.emf.eef.runtime.part.impl.SectionPropertiesEditingPart.refreshComponent(SectionPropertiesEditingPart.java:189)
>>
>>
>> at
>> ...
OK finally found the missing step!

You need to set the generate for GMF flag in the EEF model files, this
then generates some extra plugin extensions that need to be added AS
WELL as the items mentioned above.

Please can this extra step make it into the EEF/GMF documentation too?
Previous Topic:GMF SDK ( old version 2.0 ) on newer Eclipse Version ( Kepler 4.3 )
Next Topic:Adding Items to Connection Creation Popup Menu
Goto Forum:
  


Current Time: Wed Apr 24 15:03:59 GMT 2024

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

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

Back to the top