Bug 281718 - [All Diagrams] Derive default folder structure from root model element
Summary: [All Diagrams] Derive default folder structure from root model element
Status: ASSIGNED
Alias: None
Product: GMF-Tooling (ARCHIVED)
Classification: Modeling
Component: Samples-UML (show other bugs)
Version: unspecified   Edit
Hardware: Macintosh Mac OS X - Carbon (unsup.)
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Tatiana Fesenko CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 282855
Blocks:
  Show dependency tree
 
Reported: 2009-06-26 17:08 EDT by Ian Buchanan CLA
Modified: 2013-05-12 13:55 EDT (History)
1 user (show)

See Also:


Attachments
Proposed patch (2.87 KB, patch)
2009-07-08 10:30 EDT, Tatiana Fesenko CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ian Buchanan CLA 2009-06-26 17:08:03 EDT
Problem: For UML, there are likely to be many diagrams for any reasonable sized model; therefore, there are going to be many folders for storing the diagram files. In order to navigate and edit these diagrams, users (especially users who were not the original authors) will need some clues about the contents and behavior of the diagram.

Suggested solution: During diagram creation, provide a default folder with the fully qualified name of the model element to which the diagram will be bound. For example, a diagram bound to A::B::C should be in A\B\C. This way a modeler knows where new elements on the diagram will be placed before the diagram is opened. This can fall out of sync if the model structure is changed, but building the folder structure during creation would still be a big help.

Similar to Bug #281665 this would require a change in how the root model element is specified.
Comment 1 Tatiana Fesenko CLA 2009-07-08 10:08:50 EDT
Added dependency to bug 282855 'Programmatically set name of  non-existent folder to ResourceAndContainerGroup'
Comment 2 Tatiana Fesenko CLA 2009-07-08 10:20:10 EDT
Now the user can manually type a name of a folder that does not exist yet into
'containerNameField', and the folder will be created later. However, it's not
possible to make it programmatically, because
ResourceAndContainerGroup#setContainerFullPath(IPath) checks if container
actually exists.

What can we do now without hacks or copying of the code?
1) Create a new diagram in a hierarchical folder structure if all the folders do exit already. It's easy and safe.
2) Create corresponding hierarchical folder structure before calling ResourceAndContainerGroup#setContainerFullPath(IPath) method, and then create a new diagram in a 'proper' folder. 
This approach may cause creation of unwanted folders. Even if the user will type another folder structure in containerNameField, or if he press 'Cancel' in the wizard, the folders will be created anyway.
3) Add an option 'Diagram Creation Folder' into preferences page and allow the user to choose an approach.

Alternative approaches:
1) Wait when bug 282855 is fixed =)
2) Copy three classes (WizardNewFileCreationPage, ResourceAndContainerGroup, ContainerSelectionGroup) and make needed changes
Comment 3 Tatiana Fesenko CLA 2009-07-08 10:30:01 EDT
Created attachment 141089 [details]
Proposed patch

> 1) Create a new diagram in a hierarchical folder structure if all the folders
> do exit already. It's easy and safe.
Comment 4 Tatiana Fesenko CLA 2009-07-08 10:45:04 EDT
Also interesting request - 220159
Comment 5 Michael Golubev CLA 2013-05-12 13:55:46 EDT
Batch Update: UML2Tools is sample component for GMF-Tooling after restructuring