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

Bug 313213

Summary: SWT.FULL_SELECTION causes Trees to not have expansion lines
Product: [Eclipse Project] Platform Reporter: Remy Suen <remy.suen>
Component: SWTAssignee: Platform-SWT-Inbox <platform-swt-inbox>
Status: CLOSED NOT_ECLIPSE QA Contact:
Severity: normal    
Priority: P3 CC: eclipse.felipe
Version: 3.6   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Remy Suen CLA 2010-05-17 14:19:04 EDT
I showed Felipe the problem on my computer. It's a rather odd one.

Display display = new Display();
Shell shell = new Shell(display);
shell.setLayout(new FillLayout());
final Tree tree = new Tree(shell, SWT.SINGLE | SWT.FULL_SELECTION);
for (int i = 0; i < 4; i++) {
  TreeItem iItem = new TreeItem(tree, 0);
  iItem.setText("TreeItem (0) -" + i);
  for (int j = 0; j < 4; j++) {
    TreeItem jItem = new TreeItem(iItem, 0);
    jItem.setText("TreeItem (1) -" + j);
  }
}
shell.setSize(200, 200);
shell.open();
while (!shell.isDisposed()) {
  if (!display.readAndDispatch())
    display.sleep();
}
display.dispose();
Comment 1 Felipe Heidrich CLA 2010-05-17 14:54:08 EDT
Hi Remy, here is why, from MSDN:
http://msdn.microsoft.com/en-us/library/bb760013(v=VS.85).aspx

"TVS_FULLROWSELECT Version 4.71. Enables full-row selection in the tree view. The entire row of the selected item is highlighted, and clicking anywhere on an item's row causes it to be selected. This style cannot be used in conjunction with the TVS_HASLINES style. "

Note: SWT.FULL_SELECTION -> TVS_FULLROWSELECT 
Note: TVS_HASLINES = "Uses lines to show the hierarchy of items."

This is a limitation imposed by win32. Closing as not Eclipse.