Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 507036 - [Example models] Improve the way of handling example models
Summary: [Example models] Improve the way of handling example models
Status: RESOLVED FIXED
Alias: None
Product: Papyrus
Classification: Modeling
Component: Core (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 3.0.0   Edit
Assignee: Ansgar Radermacher CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-11-04 08:53 EDT by Ansgar Radermacher CLA
Modified: 2017-06-19 06:53 EDT (History)
5 users (show)

See Also:


Attachments
Example wizard page (134.66 KB, image/png)
2016-11-04 09:32 EDT, Ansgar Radermacher CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ansgar Radermacher CLA 2016-11-04 08:53:58 EDT
Currently, Papyrus itself only has a rudimentary way to provide example models. The class ModelCopyWizard (developed originally in the context of Papyrus SW designer) registers a separate new-wizard for each example. This does not scale well with several examples with several categories. This is currently already the case with Papyrus designer, and it is expected that other components (uml-rt, Moka, ucm) will also register examples in the future.
Therefore, it would be good to provide an improved example selection mechanism, in which examples can be grouped according to a category.
Comment 1 Ansgar Radermacher CLA 2016-11-04 08:56:27 EDT
@Jeremie: I've put you on copy to see whether you have specific requirements for an example model wizard (from a Moka viewpoint). I already have a patch and will provide sample screenshots.
Comment 2 Ansgar Radermacher CLA 2016-11-04 09:32:02 EDT
Created attachment 265193 [details]
Example wizard page

Wizard page (step 1 = top-left, step 2 = top-right, step 3 = bottom)
Comment 3 Ansgar Radermacher CLA 2016-11-04 09:58:42 EDT
@Florian: I've put you on copy, since it seems that there is some ongoing work in oxygen on a new model wizard (not sure whether that reduces the need for a specific example model wizard).
Comment 4 Benoit Maggi CLA 2016-11-15 09:10:37 EST
@Ansgar: Did you checked Information Modeling example?
It provides model example without adding new code, reuse eclipse and emf-example
(from what I remember)
Comment 5 Ansgar Radermacher CLA 2016-11-17 04:25:26 EST
(In reply to Benoit Maggi from comment #4)
> @Ansgar: Did you checked Information Modeling example?
> It provides model example without adding new code, reuse eclipse and
> emf-example
> (from what I remember)

I just did - thanks for the hint. The information modeling uses an EMF mechanism I was not aware of: There is a generic class called org.eclipse.emf.common.ui.wizard.ExampleInstallerWizard and an associated extension point "org.eclipse.emf.common.ui.examples" that probably does what I want for designer. I'll check out and will post here.
Comment 6 Ansgar Radermacher CLA 2016-11-17 09:28:17 EST
(In reply to Ansgar Radermacher from comment #5)
> I just did - thanks for the hint. The information modeling uses an EMF
> mechanism I was not aware of: There is a generic class called
> org.eclipse.emf.common.ui.wizard.ExampleInstallerWizard and an associated
> extension point "org.eclipse.emf.common.ui.examples" that probably does what
> I want for designer. I'll check out and will post here.

After some tests (and a look at its source code), the class ExampleInstallerWizard does not support multiple examples. The wizard evaluates only the first extension with a matching ID, i.e. you have to define several (top-level) wizards if you want multiple models which pollutes the list of top-level examples. It is possible to define multiple projects within a single extension point, but this is not very useful, as the wizard will always copy all of the declared projects.

Thus, I propose to use the EMF extension point for Papyrus examples, but sub-class the wizard.
Comment 7 Eclipse Genie CLA 2016-11-21 04:20:14 EST
New Gerrit change created: https://git.eclipse.org/r/85382
Comment 9 Eclipse Genie CLA 2017-01-03 08:59:40 EST
New Gerrit change created: https://git.eclipse.org/r/87942