Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Problem with table.getSelection() !?!?
Problem with table.getSelection() !?!? [message #449283] Thu, 20 January 2005 13:51 Go to next message
Eclipse UserFriend
Originally posted by: melko.gmx.at

Hallo!

I want to select a Row in the table and then to copy the whole content to
the clipboard! But the problem is that with the function
table.getSelection() I only get the Data of the first Column of the
selected items?!?!?!? WHY?
Or is there maybe an other way to copy table-rows?!? Thanks!!

take care, melko
Re: Problem with table.getSelection() !?!? [message #449286 is a reply to message #449283] Thu, 20 January 2005 15:25 Go to previous message
Veronika Irvine is currently offline Veronika IrvineFriend
Messages: 1272
Registered: July 2009
Senior Member
Not sure what you mean by "function table.getSelection() I only get the Data
of the first Column of the selected items". Table.getSelection() returns
the selected TableItems, not the text of aTableItem. I think you are
relying on the toString() implementation of TableItem. You need to iterate
over the columns in the table and get the text for each column:

TableItem[] selection = table.getSelection();
for (int i = 0; i < selection.length; i++) {
for (int j = 0; j < table.getColumnCount(); j++) {
System.out.prinln(selection[i].getText(j));
}
}

"melko" <melko@gmx.at> wrote in message news:csod0n$8he$1@www.eclipse.org...
> Hallo!
>
> I want to select a Row in the table and then to copy the whole content to
> the clipboard! But the problem is that with the function
> table.getSelection() I only get the Data of the first Column of the
> selected items?!?!?!? WHY? Or is there maybe an other way to copy
> table-rows?!? Thanks!!
> take care, melko
>
Previous Topic:trying to load gif from plugin into SWT browser
Next Topic:how to extract vt_bstr send byRef from Variant
Goto Forum:
  


Current Time: Fri Nov 15 11:15:25 GMT 2019

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

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

Back to the top