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

Bug 325174

Summary: [Diagram] Provide a convenient method to convert DataType to Entity and vice versa
Product: [Technology] Tigerstripe Reporter: Navid Mehregani <nmehrega>
Component: UIAssignee: Project Inbox <tigerstripe.ui-inbox>
Status: CLOSED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: chrhartl, valentin
Version: unspecified   
Target Milestone: 0.5M0   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:
Attachments:
Description Flags
TS-325174.patch.txt none

Description Navid Mehregani CLA 2010-09-13 18:06:32 EDT
Build Identifier: 

This enhancement is inspired by Comment#2 in bug#221443 (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=221443#c2).

We should provide an easy way to convert an Entity to a DataType and vice versa.  The backbone for artifact conversion in diagrams has been submitted thru the fix for bug#221443.  We should be able to use that code to provide this functionality.

Reproducible: Always
Comment 1 Chris Hartley CLA 2010-10-12 01:13:43 EDT
When refactoring from an Entity to a Datatype, any associations / association classes to the Entity will need to be removed. User should be warned and needs to confirm to continue.

Also if the artefact has a parent this will need to be removed as Entities can only have an Entity parent an Datatypes only a Datatype parent.
Comment 2 Chris Hartley CLA 2010-10-14 00:18:59 EDT
Activation should be via right click in diagram or explorer.

Please also add option to explorer right click menu for Refactor Association <-> Association Class (do here rather than reopening  Bug 221443)
Comment 3 Navid Mehregani CLA 2011-01-17 10:37:10 EST
Please also see bug#221443 for a similar enhancement that was implemented.
Comment 4 Chris Hartley CLA 2011-05-26 19:02:47 EDT
Also need to consider if the artefact has children.

Rather than make the logic really complex, it may make sense to require the user to first remove :
* parents
* children
* associations
before converting.

A more complex solution would be to :
* if there is a parent, tell user, and remove it on conversion
* if there are children, prompt to either remove them or to convert them as well
* if there are associations then prompt the user then delete them

I'll leave it to you as to what you think is reasonable.
Comment 5 Valentin Yerastov CLA 2011-06-20 08:52:20 EDT
Created attachment 198253 [details]
TS-325174.patch.txt

Done. I made this as undoable workspace operation for all diagrams and artifacts in workspace. I also added a dialog to choose what to do if artifacts have parents, children or association.
Comment 6 Valentin Yerastov CLA 2011-06-26 06:33:19 EDT
I've applied the patch.
Comment 7 Navid Mehregani CLA 2011-06-27 11:49:53 EDT
Verified. Thanks!