Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 323647 - Edit actions are disabled when selection contains an artifact and a diagram file
Summary: Edit actions are disabled when selection contains an artifact and a diagram file
Status: CLOSED WONTFIX
Alias: None
Product: Tigerstripe
Classification: Technology
Component: UI (show other bugs)
Version: unspecified   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Daniel Johnson CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-25 15:44 EDT by Navid Mehregani CLA
Modified: 2011-11-29 09:58 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Navid Mehregani CLA 2010-08-25 15:44:20 EDT
Build Identifier: 

When a user's selection contains an artifact and a diagram file (either class or instance), the standard edit actions are disabled.

Reproducible: Always

Steps to Reproduce:
1. In your TS project, select an artifact and a diagram file (either instance or class diagram) 
2. Right click > Notice that the delete, cut, and copy actions are disabled.  These actions will be enabled if you select the files individually or select a bunch of artifacts without selecting any diagram files.
Comment 1 Navid Mehregani CLA 2010-08-26 16:14:44 EDT
Dan, can you please take a look whenever you get a chance? Thanks!
Comment 2 Daniel Johnson CLA 2010-09-20 20:07:35 EDT
Navid, After a lot of experimenting with this I have come to the following conclusion:
Delete:
When deleting a mixed set of files (artifacts and diagrams) we have to override the behavior of how a diagram is deleted. When trying to delete an artifact without our custom behavior eclipse would not recognize the file was selected to delete. I came up with a solution to split the selection into their various types and then delete each type of files as their own selections, but this requires two dialogs asking the user if they are sure they want to delete the items, one in our custom behavior before the delete begins to be processed, and another one when we call the standard delete action to delete things that are supported by eclipse. The other option here is to re-implement the standard eclipse delete action, which seems like a waste to me. But other than this I can't find a good way to allow the deletion of these various file types at the same time.

Copy/Cut:
A similar problem occurs with copy/cut, where when you try to seperate the types of files each one overwrites what the other already placed in the clipboard. There may be a way around this, such as clearing the clipboard, adding contents for one file type, then getting the clipboard contents and appending the other file types and then resetting the clipboard contents. 

I am still trying to work on this, but I am starting to feel a bit stuck, and that it is not going to be easily fixed. I have spent most of my time on Delete, but will try to spend a bit more time with Cut/Copy and see if I make any progress there.
Comment 3 Chris Hartley CLA 2010-09-20 20:24:19 EDT
I'm happy if we put this one on hold for now since it seems harder than expected.
At least we now have a better understanding of what the issue is.

For now perhaps we can document it as a limitation so it doesn't confuse users.
Comment 4 Chris Hartley CLA 2010-09-20 20:27:53 EDT
The special handling for diagrams is there because although there are two files that comprise each diagram we only want to see one entry in the explorer.
Comment 5 Chris Hartley CLA 2010-09-21 00:02:56 EDT
The only suggestion that I can think of, based on the info from Daniel is to convert the logical selection to actual files then pass the whole lot to Eclipse.

e.g. 

(1) User selects class 'Aclass' and class diagram 'Adiagram'

(2) Tigerstripe then converts these to files

Aclass.java
Adiagram.wvm
Adiagram.wvd

and puts the result back on the clipboard or whatever

(3) then passes this list to Eclipse for action (copy , cut , paste , delete)
Comment 6 Navid Mehregani CLA 2010-09-21 09:31:54 EDT
Dan,

Thanks for your analysis!

What Chris has suggested in Comment#5 makes sense, but I don't think this defect is worth the effort.  

As Chris has suggested, let's put this on hold for the time being.  I've changed the status back to NEW from ASSIGNED.  We can come back to it after we've resolved some of the higher priority items.
Comment 7 Navid Mehregani CLA 2011-11-29 09:58:08 EST
Documented as a limitation.  I don't think it's worth risking a fix for this.  Marking as Won't fix.