|
Re: how to select the elements in a table [message #194354 is a reply to message #194331] |
Thu, 15 February 2007 11:49 |
Eclipse User |
|
|
|
Originally posted by: merks.ca.ibm.com
Zakir,
I think (but am not sure) that org.eclipse.swt.custom.TableCursor might
help (although I've never tried it).
zakir wrote:
> I am having a table with 4 columns...
>
> I want to select the elements in the table..........
>
> but i am not able to select... any element from other than 1st column....
>
> Could you plz give me any suggestions..
>
> Regards,
>
> Zakir
>
|
|
|
Re: how to select the elements in a table [message #194493 is a reply to message #194354] |
Thu, 15 February 2007 13:20 |
Eclipse User |
|
|
|
Originally posted by: csae7511.uibk.ac.at
When you instantiate the table with SWT.FULL_SELECTION, you are able to
select the whole row.
Does this solve your problem?
Regards,
Stefan
Ed Merks schrieb:
> Zakir,
>
> I think (but am not sure) that org.eclipse.swt.custom.TableCursor might
> help (although I've never tried it).
>
>
> zakir wrote:
>> I am having a table with 4 columns...
>>
>> I want to select the elements in the table..........
>>
>> but i am not able to select... any element from other than 1st column....
>>
>> Could you plz give me any suggestions..
>>
>> Regards,
>>
>> Zakir
>>
|
|
|
|
|
Re: how to select the elements in a table [message #194533 is a reply to message #194509] |
Thu, 15 February 2007 18:03 |
Eclipse User |
|
|
|
Originally posted by: dmsubs.NOSPAM.consertum.com
You will need to create a Listener for SWT.MouseDown on your table. In your
listener, you will then need to check if the co-ordinates lie within an editable
cell. Here is a snippet to get you started:
table.addListener(SWT.MouseDown, new Listener() {
public void handleEvent(Event event) {
Rectangle clientArea = table.getClientArea();
Point pt = new Point(event.x, event.y);
int index = table.getTopIndex();
while (index < table.getItemCount()) {
boolean visible = false;
final TableItem item = table.getItem(index);
Rectangle rect = item.getBounds(EDITABLECOLUMN);
if (rect.contains(pt)) {
setEditors(tEditor, EDITABLECOLUMN, item);
}
if (!visible && rect.intersects(clientArea)) {
visible = true;
}
if (!visible)
return;
index++;
}
}
});
setEditors is a function I have written to create an editable Text field over a
cell. EDITABLECOLUMN is a constant of mine as I only ever want to allow editing
on a single column.
HTH
--
Derek
zakir wrote:
> HI Stefan,
>
> I want to select only particular cell in a table.........not whole row...
>
> Could you please suggest me regarding this...
>
> Regards,
>
> Zakir
>
|
|
|
Powered by
FUDForum. Page generated in 0.09240 seconds