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

Bug 298937

Summary: add method signature on TreeItem to return selected cell
Product: [Eclipse Project] Platform Reporter: sombriks <sombriks>
Component: SWTAssignee: Platform-SWT-Inbox <platform-swt-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: enhancement    
Priority: P3 CC: eclipse.felipe, ericwill, pinnamur, remy.suen
Version: 3.5.1Keywords: triaged
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

Description sombriks CLA 2010-01-06 07:32:48 EST
would be nice to have a method on TreeCell able to return the selected cell.

we can easily detect which item are selected, just adding an listener and casting event.item is enough.

after google the web for some time many sources recomend me to use JFace for that, but i think that it's could be better implemented by adding a method on TreeItem.
Comment 1 Remy Suen CLA 2010-01-06 07:49:21 EST
(In reply to comment #0)
> would be nice to have a method on TreeCell able to return the selected cell.

There is no SWT API called TreeCell. I guess you meant TreeItem?
Comment 2 sombriks CLA 2010-01-06 08:16:19 EST
(In reply to comment #1)
> (In reply to comment #0)
> > would be nice to have a method on TreeCell able to return the selected cell.
> 
> There is no SWT API called TreeCell. I guess you meant TreeItem?

sorry for mistake. That's it, TreeItem. someting like item.getSelectedColumn() or getSelectedIndex().

it's very useful and don't want my app depending on jface. unless of course i have no choice, ;)
Comment 3 Felipe Heidrich CLA 2010-01-14 11:03:27 EST
TreeItem == a row in the tree
You can get the selected items using getSelection() and the selection count using getSelectionCount(). SWT does not have the concept of selection a "cell" within the row. Closing as wont fix.

Please reopen the bug if you believe I've misunderstood your request. Thank you.
Comment 4 sombriks CLA 2010-01-14 11:36:54 EST
(In reply to comment #3)
> TreeItem == a row in the tree
> You can get the selected items using getSelection() and the selection count
> using getSelectionCount(). SWT does not have the concept of selection a "cell"
> within the row. Closing as wont fix.
> 
> Please reopen the bug if you believe I've misunderstood your request. Thank
> you.

thanks for the patience.

see, the snippet 111 shows me how to place a dynamic editor on my tree, actually it also have calls to inform which column i want to edit.

by adding the tree observer to watch clicks i can recover the item and if i always edit the very same column it's ok.

i was wondering a way (like jface does, but i still don't want to depend on jface, since would be nice to have it as a core feature) to given that i have the selected TreeItem also have a method do figure which cell/column exactly i clicked.

select the row the toolkit already does and does it pretty well, i have getSelection and event.item to serve me. the problem is just which column/cell on that item the user clicked exactly.

i'm reopening and hope to see that sugar in 3.6, ;)

thanks in advance.
Comment 5 Eric Williams CLA 2019-02-01 14:11:54 EST
Sorry, but this level of detail is something you'll have to depend on JFace for.