Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Hiding Table Selections
Hiding Table Selections [message #309218] Wed, 18 October 2006 13:46 Go to next message
Eclipse UserFriend
Originally posted by: pecze.us.NO_SPAM.ibm.com

Is there a way to create a Table such that clicking in the table has no
effect on the table?

By default, if an item is selected, the item becomes highlighted. I am
creating a table that is for display purposes only, and I don't want to
mislead the user into thinking that clicking an item in the table will cause
something to happen.

I've tried marking the table READ_ONLY and also tried using HIDE_SELECTION,
however, the item still is highlighted.

I also tried creating a listener on the table that clears the selection when
the table is selected, but I didn't like how the item was highlighted for an
instant and then not highlighted.

Thanks
Re: Hiding Table Selections [message #309219 is a reply to message #309218] Wed, 18 October 2006 16:14 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

simply register a SWT.EraseItem-Listener like this:

table.addListener(SWT.EraseItem, new Listener() {
public void handleEvent(Event event) {
event.detail &= ~SWT.SELECTED;
}
}

Tom

Shawn L. Pecze schrieb:
> Is there a way to create a Table such that clicking in the table has no
> effect on the table?
>
> By default, if an item is selected, the item becomes highlighted. I am
> creating a table that is for display purposes only, and I don't want to
> mislead the user into thinking that clicking an item in the table will cause
> something to happen.
>
> I've tried marking the table READ_ONLY and also tried using HIDE_SELECTION,
> however, the item still is highlighted.
>
> I also tried creating a listener on the table that clears the selection when
> the table is selected, but I didn't like how the item was highlighted for an
> instant and then not highlighted.
>
> Thanks
>
>
Re: Hiding Table Selections [message #309249 is a reply to message #309219] Fri, 20 October 2006 09:06 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: pecze.us.NO_SPAM.ibm.com

In which version of Eclipse was SWT.EraseItem added?

"Tom Schindl" <tom.schindl@bestsolution.at> wrote in message
news:eh61ul$vu6$1@utils.eclipse.org...
> Hi,
>
> simply register a SWT.EraseItem-Listener like this:
>
> table.addListener(SWT.EraseItem, new Listener() {
> public void handleEvent(Event event) {
> event.detail &= ~SWT.SELECTED;
> }
> }
>
> Tom
>
> Shawn L. Pecze schrieb:
>> Is there a way to create a Table such that clicking in the table has no
>> effect on the table?
>>
>> By default, if an item is selected, the item becomes highlighted. I am
>> creating a table that is for display purposes only, and I don't want to
>> mislead the user into thinking that clicking an item in the table will
>> cause something to happen.
>>
>> I've tried marking the table READ_ONLY and also tried using
>> HIDE_SELECTION, however, the item still is highlighted.
>>
>> I also tried creating a listener on the table that clears the selection
>> when the table is selected, but I didn't like how the item was
>> highlighted for an instant and then not highlighted.
>>
>> Thanks
Re: Hiding Table Selections [message #309250 is a reply to message #309249] Fri, 20 October 2006 09:54 Go to previous message
Eclipse UserFriend
3.2 I think.

Tom

Shawn L. Pecze schrieb:
> In which version of Eclipse was SWT.EraseItem added?
>
> "Tom Schindl" <tom.schindl@bestsolution.at> wrote in message
> news:eh61ul$vu6$1@utils.eclipse.org...
>> Hi,
>>
>> simply register a SWT.EraseItem-Listener like this:
>>
>> table.addListener(SWT.EraseItem, new Listener() {
>> public void handleEvent(Event event) {
>> event.detail &= ~SWT.SELECTED;
>> }
>> }
>>
>> Tom
>>
>> Shawn L. Pecze schrieb:
>>> Is there a way to create a Table such that clicking in the table has no
>>> effect on the table?
>>>
>>> By default, if an item is selected, the item becomes highlighted. I am
>>> creating a table that is for display purposes only, and I don't want to
>>> mislead the user into thinking that clicking an item in the table will
>>> cause something to happen.
>>>
>>> I've tried marking the table READ_ONLY and also tried using
>>> HIDE_SELECTION, however, the item still is highlighted.
>>>
>>> I also tried creating a listener on the table that clears the selection
>>> when the table is selected, but I didn't like how the item was
>>> highlighted for an instant and then not highlighted.
>>>
>>> Thanks
>
>
Previous Topic:Question on XML-Textviewer
Next Topic:Nested categories in the new menu, but only showing partent until multiple child categories are pres
Goto Forum:
  


Current Time: Thu Sep 18 18:45:59 EDT 2025

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

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

Back to the top