Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 396356 - [variables] Ctrl-C accelerator doesn't work in Variables view
Summary: [variables] Ctrl-C accelerator doesn't work in Variables view
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 4.3   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 4.3 M5   Edit
Assignee: Pawel Piech CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 398320
  Show dependency tree
 
Reported: 2012-12-11 17:58 EST by Pawel Piech CLA
Modified: 2013-01-25 05:53 EST (History)
3 users (show)

See Also:
Michael_Rennie: review+


Attachments
Patch with fix. (892 bytes, patch)
2012-12-13 15:05 EST, Pawel Piech CLA
no flags Details | Diff
Updated patch. (6.80 KB, patch)
2012-12-13 18:36 EST, Pawel Piech CLA
no flags Details | Diff
Updated (again). (6.83 KB, patch)
2012-12-17 17:42 EST, Pawel Piech CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Pawel Piech CLA 2012-12-11 17:58:33 EST
The Ctrl-C accelerator and main menu's Edit->Copy action doesn't work in Variables, Breakpoints, and Registers view.  

The context menu's Copy Variables action still works as expected.
Comment 1 Pawel Piech CLA 2012-12-11 18:04:54 EST
This bug seems specific to CDT, it works fine with JDT.
Comment 2 Pawel Piech CLA 2012-12-13 15:05:39 EST
Created attachment 224683 [details]
Patch with fix.

It looks like I introduced this bug with the fix to bug 344023.

There is logic in the variables view which saves and restores the copy/paste actions when switching focus between tree viewer and detail pane.  In the refactoring I removed the step which saved the copy and paste actions that were originally set to the view.

This fix covers most of the cases, but I found one instance where it fails.  If the previous detail pane in the view is disposed, the DefaultDetailPane dispose listener clears the actions from the action bars, whether the pane had focus or not.  I think we need to do something more sophisticated in the default detail pane, but it could get messy.
Comment 3 Pawel Piech CLA 2012-12-13 18:36:30 EST
Created attachment 224697 [details]
Updated patch.

When testing I found that my simple fix would overwrite the paste actions from expressions and breakpoints views.  I developed this more comprehensive patch which works, but I had to change how the expressions and breakpoints views use the action DIs when calling AbstractDebugView.setAction().
Comment 4 Pawel Piech CLA 2012-12-13 18:38:42 EST
Mike, could you review my patch.  I'm not 100% that I'm using the action IDs as they were intended.  Also, I know you'd like to replace this whole scheme with command contributions.
Comment 5 Michael Rennie CLA 2012-12-17 12:45:10 EST
-1. The patch breaks copy and select all in the breakpoint condition editor (in the detail pane).

Steps:
1. create line breakpoint
2. enter the condition "return true;"
3. hit Ctrl+A -> looks like it does a save and changes the state of the detail pane
4. redo steps 1 and 2, manually select all
5. Ctrl + C, then delete the condition
6. Ctrl+V -> nothing happens
Comment 6 Michael Rennie CLA 2012-12-17 12:46:03 EST
(In reply to comment #5)
> -1. The patch breaks copy and select all in the breakpoint condition editor
> (in the detail pane).
> 
> Steps:
> 1. create line breakpoint
> 2. enter the condition "return true;"
> 3. hit Ctrl+A -> looks like it does a save and changes the state of the
> detail pane

Its actually doing a select all in the breakpoints viewer above.
Comment 7 Pawel Piech CLA 2012-12-17 17:42:20 EST
Created attachment 224827 [details]
Updated (again).

I made a small adjusted and did more extensive testing.  Mike, please have a look again.
Comment 8 Pawel Piech CLA 2013-01-16 13:16:01 EST
I pushed the fix to master.  I'd like to get this into 4.2.2 as well, but will create a separate bug for that.
Comment 10 Michael Rennie CLA 2013-01-21 11:49:03 EST
+1 works fine
Comment 11 Dani Megert CLA 2013-01-25 05:53:12 EST
Verified in I20130122-0800.