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

Bug 356957

Summary: Select all menu in Variables view only select the visible items
Product: [Eclipse Project] Platform Reporter: Xuan Chen <xuanchen>
Component: DebugAssignee: Platform-Debug-Inbox <platform-debug-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: john, jonah, pawel.1.piech
Version: 3.6.2   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard: stalebug
Bug Depends on: 128561    
Bug Blocks:    

Description Xuan Chen CLA 2011-09-07 11:47:50 EDT
Use the Java Debugger from Eclipse.
When stop, click on a stackframe, and switch to Variables view.  
Expand "this" variable.  You can right click on this variable, and choose Select All.  
I can see only the visible members are selected, not all the members in the "this" variable.

And it is the same behavior for Register View, which extends from Variables View.
Comment 1 Pawel Piech CLA 2011-09-07 12:37:28 EDT
Well, technically speaking select-all does select all elements, such that ctrl-c can copy them all into the clipboard.  However, as soon as user scrolls down in viewer, the TreeViewer.replace() method calls preservingSelection(), which resets the selection to only the materialized items.
Comment 2 John Dallaway CLA 2013-09-30 11:50:09 EDT
Looking at the Kepler 4.3 sources, the behaviours of the "Select All" context menu item and corresponding keyboard shortcut (Ctrl-A) are different for the Variables view (and hence also for the Registers view).

The Ctrl-A keyboard shortcut uses org.eclipse.ui.internal.handlers.SelectAllHandler which simply invokes the selectAll() method on the underlying Tree control. Ctrl-A works correctly. Ctrl-A _immediately_ followed by Ctrl-C copies all variables to the clipboard correctly.

However, the "Select All" context menu item uses org.eclipse.debug.internal.ui.actions.variables.SelectAllVariablesAction which deliberately avoids the selection of non-visible tree items (using SelectAllAction.collectExpandedAndVisible()). This results in unexpected behaviour with tooling such as CDT (especially noticeable within the DSF-GDB Registers view).

I think the menu item and the keyboard shortcut should exhibit identical behaviour.

There appears to be two distinct issues here. Comment #1 describes the de-selection of previously-selected tree items when scrolling. Comment #2 describes the non-selection of non-visible tree items in the first place.

Can anyone explain why SelectAllVariablesAction is implemented in this way?
Comment 3 Eclipse Genie CLA 2020-01-01 12:21:38 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.