Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 471453

Summary: [Wizard] the name of the model&rootElement should be initialized based on the project or the container
Product: [Modeling] Papyrus Reporter: Quentin Le Menez <quentin.lemenez>
Component: CoreAssignee: Christian Damus <give.a.damus>
Status: VERIFIED FIXED QA Contact: Peter Cigehn <peter.cigehn>
Severity: enhancement    
Priority: P2 CC: charles, papyrus-bugs, peter.cigehn
Version: 1.1.0   
Target Milestone: 3.0.0   
Hardware: All   
OS: All   
See Also: https://git.eclipse.org/r/51199
https://git.eclipse.org/r/97606
https://git.eclipse.org/c/papyrus/org.eclipse.papyrus.git/commit/?id=00b6634c3ec670b97affb24ee0f3c74e4983fe29
Whiteboard: blockingpapyrusrt
Bug Depends on:    
Bug Blocks: 514475    

Description Quentin Le Menez CLA 2015-06-30 11:10:35 EDT
When creating a new project / new model the default names of both model and rootElement should be initialized based on their container.
Comment 1 Eclipse Genie CLA 2015-07-01 10:44:57 EDT
New Gerrit change created: https://git.eclipse.org/r/51199
Comment 2 Charles Rivet CLA 2017-03-30 08:13:56 EDT
My guess is that this kind of renaming is fairly common. I do know that it is a common pattern for Papyrus-RT users to use the same name for the project, model, and root element. Even if a user would want a different name, they would still have to change it, so there is really no impact on the user workflow by adding this initialisation.

Although this is not a common operation, this would be a good usability improvement, especially for newcomers to the Papyrus family tools.

Could this please be considered for Oxygen?
Comment 3 Christian Damus CLA 2017-03-30 08:18:00 EDT
The DSML that contributes to the wizard should be able to plug in a default naming rule for the model resource and the root model element.
Comment 4 Charles Rivet CLA 2017-03-30 08:23:38 EDT
(In reply to Charles Rivet from comment #2)
> My guess is that this kind of renaming is fairly common. I do know that it
> is a common pattern for Papyrus-RT users to use the same name for the
> project, model, and root element. Even if a user would want a different
> name, they would still have to change it, so there is really no impact on
> the user workflow by adding this initialisation.
> 
> Although this is not a common operation, this would be a good usability
> improvement, especially for newcomers to the Papyrus family tools.
> 
> Could this please be considered for Oxygen?

Looking at this a bit more, the Papyrus-RT users typically have the model file and root element match the project name when creating a new project. Having the model file and root element name match the container for a new model in an existing project does not really make sense in that scenario if there already is a model in that project (as they would end up with the same name). So for a new model creation in an existing project, the model file name should be provided by the user and assigned to both the file and root element names, with the possibility for the user to change the latter.

Plus what Christian said!
Comment 5 Eclipse Genie CLA 2017-05-19 16:20:48 EDT
New Gerrit change created: https://git.eclipse.org/r/97606
Comment 7 Christian Damus CLA 2017-05-25 10:02:24 EDT
(In reply to comment #6)
> Gerrit change https://git.eclipse.org/r/97606 was merged to [master].
Comment 8 Peter Cigehn CLA 2017-05-29 03:13:37 EDT
Verified to be fixed in the latest Papyrus Oxygen build (#3777). The name of the model file and the root element of the model is now picked up from the parent container. In case of an already existing model file with the same name as the parent container the model is simply proposed to be named "model" (with an additional number suffix in case of a name clash).