Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » tableItem
tableItem [message #465291] Thu, 08 December 2005 15:32 Go to next message
steve lane is currently offline steve laneFriend
Messages: 24
Registered: July 2009
Junior Member
Given that you have a tableItem, is there no way i can find which column
it belongs to ? I have obtained a tableItem using:

TableItem item = table.getItem(new Point(event.x, event.y));

And i need to know what column in my table that represents - surely there
is a way to obtain this ?

thanks,
Re: tableItem [message #465295 is a reply to message #465291] Thu, 08 December 2005 16:15 Go to previous message
Gail Jakubowski is currently offline Gail JakubowskiFriend
Messages: 36
Registered: July 2009
Member
Point pt = new Point(event.x, event.y);
TableItem item = table.getItem(pt);
for (int i=0;i<myTable.getColumnCount();i++) {
Rectangle rect = item.getBounds(i);
if (rect.contains(pt)) {
//column found, value=i
}
}

"steve lane" <steve.x.lane@jpmchase.com> wrote in message
news:aba7463bf1086cfef310da89fad543fb$1@www.eclipse.org...
> Given that you have a tableItem, is there no way i can find which column
> it belongs to ? I have obtained a tableItem using:
>
> TableItem item = table.getItem(new Point(event.x, event.y));
>
> And i need to know what column in my table that represents - surely there
> is a way to obtain this ?
>
> thanks,
>
>
>
Previous Topic:Events not working in Combo when in a CoolBar but works when in a ToolBar
Next Topic:addListner to a extended Class
Goto Forum:
  


Current Time: Wed Apr 24 22:12:06 GMT 2024

Powered by FUDForum. Page generated in 0.03017 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top