| Summary: | [Model Browser] Allow navigating from the Model Browser to an editor | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [Modeling] MoDisco | Reporter: | Fabien Giquel <fabien.giquel> | ||||||||||||||
| Component: | Infrastructure | Assignee: | Fabien Giquel <fabien.giquel> | ||||||||||||||
| Status: | CLOSED FIXED | QA Contact: | |||||||||||||||
| Severity: | enhancement | ||||||||||||||||
| Priority: | P3 | CC: | hugo.bruneliere, modisco.web-inbox, nicolas.guyomar | ||||||||||||||
| Version: | 0.9.0 | Flags: | fabien.giquel:
indigo+
|
||||||||||||||
| Target Milestone: | 0.9.0 M3 | ||||||||||||||||
| Hardware: | PC | ||||||||||||||||
| OS: | Windows XP | ||||||||||||||||
| Whiteboard: | |||||||||||||||||
| Bug Depends on: | |||||||||||||||||
| Bug Blocks: | 329040, 329045 | ||||||||||||||||
| Attachments: |
|
||||||||||||||||
|
Description
Fabien Giquel
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
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
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
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
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
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" Created attachment 182357 [details]
org.eclipse.modisco.kdm.source.extension.ui project for model to source navigation
Updated project according to previous comments
Created attachment 182358 [details]
org.eclipse.modisco.kdm.source.extension.ui.browser project for model to source navigation
Updated project according to previous comments
Thank you Nicolas. It's all right now. Contributions have been commited into SVN (revisions 3570, 3571, 3572, 3573). 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). Contributions successfully integrated. |