Bug 199288 - Expressions view should support paste
Summary: Expressions view should support paste
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows XP
: P3 minor (vote)
Target Milestone: 3.5 M7   Edit
Assignee: Curtis Windatt CLA
QA Contact:
URL:
Whiteboard:
Keywords: bugday
Depends on:
Blocks:
 
Reported: 2007-08-08 12:45 EDT by Curtis Windatt CLA
Modified: 2009-03-17 11:51 EDT (History)
4 users (show)

See Also:


Attachments
Suggested patch (10.73 KB, patch)
2008-06-27 17:22 EDT, Mike Morearty CLA
curtis.windatt.public: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Curtis Windatt CLA 2007-08-08 12:45:52 EDT
The expressions view supports drag and drop (variables and text dropped to create new watch expressions).  The view also supports copying of expressions.

The view should support the paste command so that the drag and drop functionality can be accomplished using the keyboard.
Comment 1 Darin Wright CLA 2008-02-01 11:27:49 EST
Not committed for 3.4
Comment 2 Mike Morearty CLA 2008-05-30 14:29:25 EDT
I'll take a shot at this one for today (Bug Day).
Comment 3 Mike Morearty CLA 2008-06-27 17:22:16 EDT
Created attachment 106047 [details]
Suggested patch

Attached is a suggested patch.  This is the first time I've tried submitting a patch; apologies if I did it wrong (and please let me know so I can learn from my mistakes).

The code is fine as far as it goes, but it has a couple of shortcomings (this is all I had time to do):

- It only pastes text.  If you had, for example, cut/copied an expression to the clipboard, then this code does not recognize it as an IExpression or IWatchExpression or whatever -- it just views it as text.  This isn't terrible -- after all, this handles the most common case, which is copying from an editor -- but it could be better.

- This does not add a "Paste" right-click context menu command.  Doing that would require some plugin.xml work, which was a little tricky to reconcile with the way the code currently works.  I implemented this by starting from the Breakpoints view's "paste" command and modifying it, and that code doesn't do the paste command from plugin.xml, it has it defined in code.
Comment 4 Darin Wright CLA 2008-07-03 10:51:18 EDT
Thanks for the patch, we will consider this in the next cycle.
Comment 5 Curtis Windatt CLA 2009-03-17 11:50:34 EDT
Applied patch to HEAD.  Thanks for the contribution Mike.
Comment 6 Curtis Windatt CLA 2009-03-17 11:51:05 EDT
.