Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Technology Project and PMC » SWT: TableItem and Popups
SWT: TableItem and Popups [message #48449] Thu, 06 March 2003 23:07 Go to next message
Eclipse UserFriend
Originally posted by: notvalid.hotmail.com

Hello,

I was reading the HoverExample supplied by eclipse in the hope of
applying their example to my Table.

I want to have special popups for particular cells in a row. But I
notice that in their code they use the command ".setData(...)" on each
TableItem which corresponds to an entire row, and not one particular cell in
a row.

Is there a way to have special popups for specific cells within a row?
Syntactically, I was hoping there would be a command like ".setData(index)"
where I could specify the index of the column to add a hover object to.
But, ".setData()" seems to affect an entire TableItem which is equal to an
entire row, so the popup would affect all cells in a row (which is not what
I want).

Any suggestions, or examples of code which manipulate cells in a table?

Thanks....

SWT Newbie
Re: SWT: TableItem and Popups [message #48543 is a reply to message #48449] Fri, 07 March 2003 15:43 Go to previous message
Eclipse UserFriend
Originally posted by: fcatrin.tuxpan.cl

On Thu, 6 Mar 2003 15:07:18 -0800
"exquisitus" <notvalid@hotmail.com> wrote:

> Hello,
>
> I was reading the HoverExample supplied by eclipse in the hope of
> applying their example to my Table.
>
> I want to have special popups for particular cells in a row. But I
> notice that in their code they use the command ".setData(...)" on each
> TableItem which corresponds to an entire row, and not one particular
> cell in a row.
>
> Is there a way to have special popups for specific cells within a row?
> Syntactically, I was hoping there would be a command like
> ".setData(index)" where I could specify the index of the column to add a
> hover object to. But, ".setData()" seems to affect an entire TableItem
> which is equal to an entire row, so the popup would affect all cells in
> a row (which is not what I want).
>
> Any suggestions, or examples of code which manipulate cells in a table?

You are confused (may be I am). The setData method associates an Object
with your Widget, so you can retrieve "context" objects later.
To change the visible content in a specific cell inside a TableItem, you
use setText(int column, String text)

If you want to launch a different popup for each row, there is no
relationship with the setData method (you can use it for anything you
want). What you need is to know at what column you are located. (AFAIU)
and launch the apporpiate popup there, which could be a global one or a
TableItem data set by setData, or anything you like.

Note that there is a setData with a key argument also.

--
Franco Catrin L.
TUXPAN
Re: SWT: TableItem and Popups [message #591434 is a reply to message #48449] Fri, 07 March 2003 15:43 Go to previous message
Eclipse UserFriend
Originally posted by: fcatrin.tuxpan.cl

On Thu, 6 Mar 2003 15:07:18 -0800
"exquisitus" <notvalid@hotmail.com> wrote:

> Hello,
>
> I was reading the HoverExample supplied by eclipse in the hope of
> applying their example to my Table.
>
> I want to have special popups for particular cells in a row. But I
> notice that in their code they use the command ".setData(...)" on each
> TableItem which corresponds to an entire row, and not one particular
> cell in a row.
>
> Is there a way to have special popups for specific cells within a row?
> Syntactically, I was hoping there would be a command like
> ".setData(index)" where I could specify the index of the column to add a
> hover object to. But, ".setData()" seems to affect an entire TableItem
> which is equal to an entire row, so the popup would affect all cells in
> a row (which is not what I want).
>
> Any suggestions, or examples of code which manipulate cells in a table?

You are confused (may be I am). The setData method associates an Object
with your Widget, so you can retrieve "context" objects later.
To change the visible content in a specific cell inside a TableItem, you
use setText(int column, String text)

If you want to launch a different popup for each row, there is no
relationship with the setData method (you can use it for anything you
want). What you need is to know at what column you are located. (AFAIU)
and launch the apporpiate popup there, which could be a global one or a
TableItem data set by setData, or anything you like.

Note that there is a setData with a key argument also.

--
Franco Catrin L.
TUXPAN
Previous Topic:QNX on Eclipse
Next Topic:SWT and Access Data
Goto Forum:
  


Current Time: Fri Apr 26 12:29:33 GMT 2024

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

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

Back to the top