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

Bug 262445

Summary: Ctrl-A does not generate a selection event in the Variables view tree-table control
Product: [Eclipse Project] Platform Reporter: Mohammed Rizvi <mohammed_hussain>
Component: DebugAssignee: Platform-Debug-Inbox <platform-debug-inbox>
Status: RESOLVED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: darin.eclipse
Version: 3.3.1   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Mohammed Rizvi CLA 2009-01-26 17:13:21 EST
Build ID: M20071023-1652

Steps To Reproduce:
In the Variables view, 'Remove selected global variables' is inactive under certain conditions.

Steps to reproduce:
1. Load a project for debug.
2. Add a few (atleast 3) global variables to the variable view (Variable view context menu -> add global variable)
3. Now select one or more global variables (so that atleast two remain unselected), right click and select 'Remove selected global variables'
4. Now select all the remaining global variables (should be atleast 2) using Ctrl+A, and right click on the selection to open the context menu

Notice that 'Remove selected global variables' is inactive

Now select any one of the remaining global variables (so that the rest are deselected) and select them all once again using Ctrl+A. This time 'Remove selected global variables' is active in the context menu!

Here is the context menu item with action:

  <action id="RemoveGlobalVariable"
    			toolbarPath="additions"
    			class="RemoveGlobalVariableAction"
    			icon="icons/remove_variable.gif"
    			label="%RemoveGlobalVariable.label"
    			tooltip="%RemoveGlobalVariable.label"
    			style="push"
    			enablesFor="+">
    				<selection class="GlobalVariable" />




More information:
I was able to fix this with the following code, by generating the event myself.  However the code is non-portable and was rejected by my manager.

try {
// Use unorthodox way to find the tree control
// in our VariablesView in order to catch a CTRL+A
// event that is ignored due to a bug in Eclispe.
final VariablesView varView = (VariablesView)view;
IPage p = varView.getCurrentPage();
SashForm sf = (SashForm)p.getControl();
Control c[] = sf.getChildren();
final Tree varViewTree = (Tree)c[0];
varViewTree.addKeyListener(new KeyAdapter(){
  @Override
  public void keyReleased(KeyEvent e) {
  if (e.character == 0x1)
  {
    // Manually force the selection
    varView.getViewSite().getSelectionProvider().setSelection(getSelection(varViewTree));
   }
}
});
}catch(NullPointerException npe)
{
  npe.printStackTrace();
}
Comment 1 Eric Moffatt CLA 2009-01-28 12:09:58 EST
Mohammed, what type of project is this (Java, C/C++)? I tried to check this using my 'standard' eclipse and don't see the menu item at all in my Variable view (for Java).
Comment 2 Darin Wright CLA 2009-02-09 09:21:51 EST

*** This bug has been marked as a duplicate of bug 255153 ***