Bug 114200 - [req] Provide an option to generate RCP application
Summary: [req] Provide an option to generate RCP application
Status: RESOLVED FIXED
Alias: None
Product: GMF-Tooling (ARCHIVED)
Classification: Modeling
Component: Core (show other bugs)
Version: 2.0   Edit
Hardware: All All
: P3 enhancement with 7 votes (vote)
Target Milestone: 2.0   Edit
Assignee: Dmitry Stadnik CLA
QA Contact:
URL:
Whiteboard:
Keywords: plan
Depends on: 158805
Blocks:
  Show dependency tree
 
Reported: 2005-10-28 15:17 EDT by Richard Gronback CLA
Modified: 2010-07-19 22:25 EDT (History)
10 users (show)

See Also:


Attachments
Fixes the subj for the Lite Generator case (239.48 KB, patch)
2006-04-19 07:01 EDT, Boris Blajer CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Gronback CLA 2005-10-28 15:17:13 EDT
A generation option to target RCP application should be provided in the 
generator model, to complement that provided by EMF.
Comment 1 Artem Tikhomirov CLA 2006-04-14 11:00:34 EDT
Updated Version/Milestone.
Comment 2 Boris Blajer CLA 2006-04-19 07:01:29 EDT
Created attachment 38918 [details]
Fixes the subj for the Lite Generator case

The option itself has not been added, instead it is taken from the corresponding .genmodel model (it seems reasonable to align values of this option for the diagram editor and the underlying domain model, anyway)
Comment 3 Artem Tikhomirov CLA 2006-04-20 14:39:26 EDT
Patch for Lite generator reviewed and committed.
Comment 4 Jerome Louvel CLA 2006-04-21 04:38:13 EDT
Sounds great for my project! Could we have details on what this RCP flag generates as an RCP application? Also, when will this be released, 3.2 RC1?
Comment 5 montagner olivier CLA 2006-04-27 05:01:10 EDT
Hello,
Can you explain how to generate an RCP application instead of an eclipse editor for GMF
Comment 6 Boris Blajer CLA 2006-04-27 05:40:26 EDT
Hi,
First, you need to obtain the GMF SDK Experimental (available as a separate download) and use it along with the GMF SDK proper, because the RCP generation is currently available only for the pure-GEF ("Lite") version of the generator.

In the .genmodel for your domain model, check the option to generate RCP application. 
Produce all .gmf* models as you would do for a non-RCP application (while creating the generator model, specify that enhanced figures should NOT be used). 
Finally, as the last generation step, use the action "Generate pure-GEF diagram code" instead of "Generate diagram code". This will activate the "lite" version of the generator and will produce the RCP application.

Of course, being RCP does not mean that it will run with org.eclipse.rcp feature only. You will need at least GEF and EMF features as well. Depending on the complexity of your model (e.g., whether you have feature initializers and/or constraints), you may also have to bundle OCL-related features. 
Comment 7 Jerome Louvel CLA 2006-04-27 10:17:06 EDT
Hi Boris,

Thanks for the detailled steps. I was able to run my GMF application as a RCP product. I had a couple of small issues with the generated editor plugin:
 - Collections used without import (java.util)
 - gmf.runtime.draw2d dependencies not added to the plugin.xml causing compliation errors
 - usage of deprecated API: getSite().getKeyBindingService()
 - import of some unused package generating a warning

Also, when trying to run the RCP application, I realized that many dependencies were required. Below is a complete list of the plugins I had to include. Is everything really required?

   <plugins>
      <plugin id="com.ibm.icu"/>
      <plugin id="com.si.designer"/>
      <plugin id="com.si.designer.model"/>
      <plugin id="com.si.designer.model.edit"/>
      <plugin id="com.si.designer.model.editor"/>
      <plugin id="com.si.designer.source.editor"/>
      <plugin id="org.apache.batik"/>
      <plugin id="org.eclipse.ant.core"/>
      <plugin id="org.eclipse.core.commands"/>
      <plugin id="org.eclipse.core.contenttype"/>
      <plugin id="org.eclipse.core.expressions"/>
      <plugin id="org.eclipse.core.filesystem"/>
      <plugin id="org.eclipse.core.filesystem.win32.x86" fragment="true"/>
      <plugin id="org.eclipse.core.jobs"/>
      <plugin id="org.eclipse.core.resources"/>
      <plugin id="org.eclipse.core.resources.compatibility" fragment="true"/>
      <plugin id="org.eclipse.core.resources.win32" fragment="true"/>
      <plugin id="org.eclipse.core.runtime"/>
      <plugin id="org.eclipse.core.runtime.compatibility"/>
      <plugin id="org.eclipse.core.runtime.compatibility.auth"/>
      <plugin id="org.eclipse.core.runtime.compatibility.registry" fragment="true"/>
      <plugin id="org.eclipse.core.variables"/>
      <plugin id="org.eclipse.draw2d"/>
      <plugin id="org.eclipse.emf.common"/>
      <plugin id="org.eclipse.emf.common.ui"/>
      <plugin id="org.eclipse.emf.ecore"/>
      <plugin id="org.eclipse.emf.ecore.change"/>
      <plugin id="org.eclipse.emf.ecore.edit"/>
      <plugin id="org.eclipse.emf.ecore.xmi"/>
      <plugin id="org.eclipse.emf.edit"/>
      <plugin id="org.eclipse.emf.edit.ui"/>
      <plugin id="org.eclipse.equinox.common"/>
      <plugin id="org.eclipse.equinox.preferences"/>
      <plugin id="org.eclipse.equinox.registry"/>
      <plugin id="org.eclipse.gef"/>
      <plugin id="org.eclipse.gmf.runtime.common.core"/>
      <plugin id="org.eclipse.gmf.runtime.common.ui"/>
      <plugin id="org.eclipse.gmf.runtime.draw2d.ui"/>
      <plugin id="org.eclipse.gmf.runtime.draw2d.ui.render"/>
      <plugin id="org.eclipse.gmf.runtime.draw2d.ui.render.awt"/>
      <plugin id="org.eclipse.gmf.runtime.notation"/>
      <plugin id="org.eclipse.gmf.runtime.notation.edit"/>
      <plugin id="org.eclipse.help"/>
      <plugin id="org.eclipse.jface"/>
      <plugin id="org.eclipse.jface.text"/>
      <plugin id="org.eclipse.osgi"/>
      <plugin id="org.eclipse.swt"/>
      <plugin id="org.eclipse.swt.win32.win32.x86" fragment="true"/>
      <plugin id="org.eclipse.team.core"/>
      <plugin id="org.eclipse.text"/>
      <plugin id="org.eclipse.ui"/>
      <plugin id="org.eclipse.ui.console"/>
      <plugin id="org.eclipse.ui.forms"/>
      <plugin id="org.eclipse.ui.views"/>
      <plugin id="org.eclipse.ui.win32" fragment="true"/>
      <plugin id="org.eclipse.ui.workbench"/>
      <plugin id="org.eclipse.ui.workbench.texteditor"/>
      <plugin id="org.eclipse.update.configurator"/>
      <plugin id="org.eclipse.update.core"/>
      <plugin id="org.eclipse.update.core.win32" fragment="true"/>
      <plugin id="org.eclipse.update.ui"/>
   </plugins>
Comment 8 Boris Blajer CLA 2006-04-27 11:23:42 EDT
Hi Jerome,
In recent builds, there is an option not to generate figures that reference gmf.runtime.ui. In this case, only org.eclipse.gmf.runtime.* plugins that are needed are .notation and .notation.edit. This will also eliminate the need for org.apache.batik, org.eclipse.core.resources (and related plugins), org.eclipse.ant.core, org.eclipse.core.filesystem (and the related fragment), org.eclipse.team.core, org.eclipse.ui.console, org.eclipse.ui.forms and org.eclipse.update.* -- unless your plugins require them.

Also, since recently, references to gmf.runtime.draw2d should be added automatically if "use enhanced figures" option is used, so the code should stay compilable (although the very idea of pure-GEF approach does not fit well with using gmf.runtime figures). 

I should note, however, that the use of ocl will add the requirement to have org.eclipse.core.resources and everything it depends on. Also, a planned change to introduce transaction support into the pure-GEF generator will make org.eclipse.core.resources a required plugin, because org.eclipse.emf.transaction requires it.
Comment 9 Jerome Louvel CLA 2006-04-28 09:33:50 EDT
Boris,

After playing a little more with the pure-GEF option, it seems that we are losing many interesting GMF options in this mode, like the layout tools or the contextual links creation...

Personnaly, I'm looking for a mode that would allow me to run a fully-featured GMF diagram as an RCP application with any plugin that makes sense (like core.resources) but without all the IDE related plugins as my application has nothing to do with a fully-feature IDE like Eclipse.

Is something like this on your road-map?

Thanks,
Jerome
Comment 10 Artem Tikhomirov CLA 2006-05-29 14:30:14 EDT
Milestone updated. No RCP option in 1.0
Comment 11 Eswar CLA 2006-07-07 05:55:19 EDT
(In reply to comment #9)
> Boris,
> 
> After playing a little more with the pure-GEF option, it seems that we are
> losing many interesting GMF options in this mode, like the layout tools or the
> contextual links creation...
> 
> Personnaly, I'm looking for a mode that would allow me to run a fully-featured
> GMF diagram as an RCP application with any plugin that makes sense (like
> core.resources) but without all the IDE related plugins as my application has
> nothing to do with a fully-feature IDE like Eclipse.
> 
> Is something like this on your road-map?
> 
> Thanks,
> Jerome
> 

Hi Jerome/Boris,

I went thru the exact steps mentioned, and when I run through it, the code throws a class cast exception... I am using the mindmap example...
On a little investigation, I found that 
diagramRoot = (Map) diagram.getElement();
was causing that exception. diagram.getElement() returns DocumentRootImpl where as the casting expects a map object. I am not sure abt how it internally works and whats causing it.

It looks like I am missing something...

Any ideas??

Regards
Eswar


java.lang.ClassCastException: org.eclipse.gmf.examples.mindmap.impl.DocumentRootImpl
	at org.eclipse.gmf.examples.mindmap.diagram.part.MindmapDiagramEditor.load(MindmapDiagramEditor.java:1111)
	at org.eclipse.gmf.examples.mindmap.diagram.part.MindmapDiagramEditor.setInput(MindmapDiagramEditor.java:1013)
	at org.eclipse.gmf.examples.mindmap.diagram.part.MindmapDiagramEditor.init(MindmapDiagramEditor.java:987)
	at org.eclipse.ui.internal.EditorManager.createSite(EditorManager.java:839)
	at org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:583)
	at org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:372)
	at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:566)
	at org.eclipse.ui.internal.EditorAreaHelper.setVisibleEditor(EditorAreaHelper.java:263)
	at org.eclipse.ui.internal.EditorManager.setVisibleEditor(EditorManager.java:1420)
	at org.eclipse.ui.internal.EditorManager$5.run(EditorManager.java:1005)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
	at org.eclipse.core.runtime.Platform.run(Platform.java:843)
	at org.eclipse.ui.internal.EditorManager.restoreState(EditorManager.java:1000)
	at org.eclipse.ui.internal.WorkbenchPage.restoreState(WorkbenchPage.java:2836)
	at org.eclipse.ui.internal.WorkbenchWindow.restoreState(WorkbenchWindow.java:1936)
	at org.eclipse.ui.internal.Workbench.doRestoreState(Workbench.java:2857)
	at org.eclipse.ui.internal.Workbench.access$14(Workbench.java:2805)
	at org.eclipse.ui.internal.Workbench$19.run(Workbench.java:1681)
	at org.eclipse.ui.internal.Workbench.runStartupWithProgress(Workbench.java:1421)
	at org.eclipse.ui.internal.Workbench.restoreState(Workbench.java:1679)
	at org.eclipse.ui.internal.Workbench.access$12(Workbench.java:1650)
	at org.eclipse.ui.internal.Workbench$17.run(Workbench.java:1529)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
	at org.eclipse.ui.internal.Workbench.restoreState(Workbench.java:1473)
	at org.eclipse.ui.internal.WorkbenchConfigurer.restoreState(WorkbenchConfigurer.java:183)
	at org.eclipse.ui.application.WorkbenchAdvisor.openWindows(WorkbenchAdvisor.java:702)
	at org.eclipse.ui.internal.Workbench.init(Workbench.java:1085)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1847)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:419)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:95)
	at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336)
	at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
	at org.eclipse.core.launcher.Main.run(Main.java:977)
	at org.eclipse.core.launcher.Main.main(Main.java:952)

Comment 12 Frederic Plante CLA 2006-07-11 10:06:46 EDT
Please confirm the RCP option will support both the light and the runtime configurations
Comment 13 Richard Gronback CLA 2006-07-11 10:10:22 EDT
Confirmed, for sure.
Comment 14 Dmitry Stadnik CLA 2006-11-28 08:53:20 EST
full runtime is supported
Comment 15 Richard Gronback CLA 2008-08-13 13:10:42 EDT
[target cleanup] 2.0 M4 was the original target milestone for this bug
Comment 16 Eclipse Webmaster CLA 2010-07-19 22:25:09 EDT
[GMF Restructure] Bug 319140 : product GMF and component
Definition was the original product and component for this bug