Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 329038 - [Model Browser] Allow navigating from the Model Browser to an editor
Summary: [Model Browser] Allow navigating from the Model Browser to an editor
Status: CLOSED FIXED
Alias: None
Product: MoDisco
Classification: Modeling
Component: Infrastructure (show other bugs)
Version: 0.9.0   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: 0.9.0 M3   Edit
Assignee: Fabien Giquel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 329040 329045
  Show dependency tree
 
Reported: 2010-10-29 08:15 EDT by Fabien Giquel CLA
Modified: 2011-01-11 05:11 EST (History)
3 users (show)

See Also:
fabien.giquel: indigo+


Attachments
org.eclipse.gmt.modisco.infra.browser patch for model to source navigation (15.92 KB, patch)
2010-10-29 10:35 EDT, Nicolas Guyomar CLA
fabien.giquel: iplog+
Details | Diff
org.eclipse.gmt.modisco.infra.browser.uicore patch for model to source navigation (4.54 KB, patch)
2010-10-29 10:37 EDT, Nicolas Guyomar CLA
fabien.giquel: iplog+
Details | Diff
org.eclipse.modisco.kdm.source.extension.ui (18.23 KB, application/x-zip-compressed)
2010-10-29 10:38 EDT, Nicolas Guyomar CLA
no flags Details
org.eclipse.modisco.kdm.source.extension.ui.browser (6.49 KB, application/x-zip-compressed)
2010-10-29 10:40 EDT, Nicolas Guyomar CLA
no flags Details
org.eclipse.modisco.kdm.source.extension.ui project for model to source navigation (19.01 KB, application/x-zip-compressed)
2010-11-04 06:39 EDT, Nicolas Guyomar CLA
fabien.giquel: iplog+
Details
org.eclipse.modisco.kdm.source.extension.ui.browser project for model to source navigation (6.94 KB, application/x-zip-compressed)
2010-11-04 06:40 EDT, Nicolas Guyomar CLA
fabien.giquel: iplog+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Fabien Giquel CLA 2010-10-29 08:15:01 EDT
Here is an entry for planned MoDisco enhancement : Allow navigating from the Model Browser to an appropriate editor.
Comment 1 Nicolas Guyomar CLA 2010-10-29 10:32:43 EDT
Hi Fabien,

Please find attached 2 patches for projects:
- org.eclipse.gmt.modisco.infra.browser
- org.eclipse.gmt.modisco.infra.browser.uicore

Those patches give the MoDisco Model Browser the capabilities to navigate from a model element to its source code:
(Right click => "Browse code in text editor" or by enabling source code synchronization in the View Menu ("View Menu/"Synchronize with source code") )

In order to navigate between the model and some source code, strategies are needed, depending on the language you want to browse.

This strategy system is based on MoDisco KDM Source Extension plugins.

I also attached this mechanism implemented in plugin : org.eclipse.modisco.kdm.source.extension.ui

In order not to add dependencies between plugins
org.eclipse.gmt.modisco.infra.browser  and  org.eclipse.modisco.kdm.source.extension.ui
I also provide a bridge plugin which makes the connection beetwen user interaction in the MoDisco Model Browser (DoubleClickListener) and the code
synchronization mechanism in the plugin :  org.eclipse.modisco.kdm.source.extension.ui.browser


(a) I, Nicolas Guyomar, wrote 100% of the code of the contribution
(b) I have the right to contribute the code to Eclipse
(c) I want to contribute this code under EPL


Regards

Nicolas Guyomar
Comment 2 Nicolas Guyomar CLA 2010-10-29 10:35:11 EDT
Created attachment 182041 [details]
org.eclipse.gmt.modisco.infra.browser patch for model to source navigation

This is the patch to add DoubleClickListener extension point for MoDisco Model Browser
Comment 3 Nicolas Guyomar CLA 2010-10-29 10:37:17 EDT
Created attachment 182042 [details]
org.eclipse.gmt.modisco.infra.browser.uicore patch for model to source navigation

This is the patch for code synchronization menu in MoDisco Model Browser
Comment 4 Nicolas Guyomar CLA 2010-10-29 10:38:49 EDT
Created attachment 182044 [details]
org.eclipse.modisco.kdm.source.extension.ui

This is the plugin which implements the code synchronization mechanism for MoDisco Model Browser
Comment 5 Nicolas Guyomar CLA 2010-10-29 10:40:03 EDT
Created attachment 182045 [details]
org.eclipse.modisco.kdm.source.extension.ui.browser

This is the plugin which make the connection between code synchronization mechanism and MoDisco Model Browser in order not to add a dependency
Comment 6 Fabien Giquel CLA 2010-11-02 09:27:28 EDT
Thanks for your contribution.
Reviewing the code (both for 329038 and 329045), here are some notes which, i think, require some attachment update :

- i think Adapter/AdapterFactory pattern is not well applied here :
  * "EObjectAdapter" class name is not appropriate, may be it should name something like "SourceAccessAdapter"
  * The adapter factory would better be called like this ".adapt(eObject, EObjectAdapter.class)" rather than ".adapt(eObject, EObject.class)"
  * StrategySource and StrategyRevealing should be used as singletons and not instantiated one for one EObject.
  * StrategySource.isApplicableTo() should be more straightforward : testing directly if notifier is an EObject conforming to Java metamodel

- a detail : StrategyRevealingJava and StrategySourceJava should not declare a METAMODEL_URI constant but rather use JavaPackage.eINSTANCE.getNsURI() 

- a detail : J2SE5 compliance level is required on projects.

- a detail : use relative .checkstyle reference on new projects, as explained here "http://wiki.eclipse.org/MoDisco/CodingConventions"
Comment 7 Nicolas Guyomar CLA 2010-11-04 06:39:34 EDT
Created attachment 182357 [details]
org.eclipse.modisco.kdm.source.extension.ui project for model to source navigation

Updated project according to previous comments
Comment 8 Nicolas Guyomar CLA 2010-11-04 06:40:02 EDT
Created attachment 182358 [details]
org.eclipse.modisco.kdm.source.extension.ui.browser project for model to source navigation

Updated project according to previous comments
Comment 9 Fabien Giquel CLA 2010-11-04 13:31:39 EDT
Thank you Nicolas. It's all right now.

Contributions have been commited into SVN (revisions 3570, 3571, 3572, 3573).
Comment 10 Fabien Giquel CLA 2010-11-04 13:45:15 EDT
Here is a contribution from an employee of Mia-Software, targeting future
Indigo release. The company has signed a Member Commiter Agreement. The contribution does not need a CQ (see bug 322327).
Comment 11 Hugo Bruneliere CLA 2011-01-11 05:11:23 EST
Contributions successfully integrated.