Skip to main content



      Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » is Table.deselectAll() missing ignoreSelect?
is Table.deselectAll() missing ignoreSelect? [message #433291] Tue, 06 April 2004 15:20 Go to next message
Eclipse UserFriend
using eclipse 2.1.3

Should Table.deselectAll() set the ignoreSelect flag to true/false when
calling OS.SendMessage?
like:

ignoreSelect = true;
OS.SendMessage (handle, OS.LVM_SETITEMSTATE, -1, lvItem);
ignoreSelect = false;

Looking at the other "select" methods in Table, the call to OS.SendMessage
is surrounded by ignoreSelect=true/ignoreSelect=false. So I was wondering
why deselectAll() does not do the same.

I ask because I am running into a problem where the lack of ignoreSelect
may be causing me to go into an infinite loop with my tableViewer.

I have a composite that contains a TableViewer. I have added a
selectionChangedListener to the TableViewer. When selectionChanged, I
perform some actions that may involve changing the labels on the items in
my TableViewer, so I then call tableViewer.refresh(true). Before calling
refresh, I set a ignoreSelectionChanged flag I have to true, so that any
selection changes made during refresh will be ignored. This almost seems
to work fine except for when someone hits space then enter real quick on
the TableViewer. For some reason this sends things into an infinite loop.
I traced through the code and it looked like an additional
selectionChanged event was being placed onto the event queue during the
TableViewer refresh (by Table.deselectAll()). And by the time the event
on the event queue is run, my ignoreSelectionChanged flag is already set
back to false, so selectionChanged is being run again. Then refresh is
called, etc, etc..

I don't know why space, enter is the special key sequence to trigger this
infinite loop. I don't have any other listeners and I just want to update
the labels in my TableViewer. I tried putting ignoreSelect in
Table.deselectAll() and it seemed to fix my problem. So is that a bug?

Thanks.
Re: is Table.deselectAll() missing ignoreSelect? [message #433349 is a reply to message #433291] Wed, 07 April 2004 15:13 Go to previous messageGo to next message
Eclipse UserFriend
Yes! The code is wrong. I have fixed it and released it. Thanks a million.

"amy" <amywu@us.DELETETHISPART.ibm.com> wrote in message
news:c4uvum$p3c$1@eclipse.org...
> using eclipse 2.1.3
>
> Should Table.deselectAll() set the ignoreSelect flag to true/false when
> calling OS.SendMessage?
> like:
>
> ignoreSelect = true;
> OS.SendMessage (handle, OS.LVM_SETITEMSTATE, -1, lvItem);
> ignoreSelect = false;
>
> Looking at the other "select" methods in Table, the call to OS.SendMessage
> is surrounded by ignoreSelect=true/ignoreSelect=false. So I was wondering
> why deselectAll() does not do the same.
>
> I ask because I am running into a problem where the lack of ignoreSelect
> may be causing me to go into an infinite loop with my tableViewer.
>
> I have a composite that contains a TableViewer. I have added a
> selectionChangedListener to the TableViewer. When selectionChanged, I
> perform some actions that may involve changing the labels on the items in
> my TableViewer, so I then call tableViewer.refresh(true). Before calling
> refresh, I set a ignoreSelectionChanged flag I have to true, so that any
> selection changes made during refresh will be ignored. This almost seems
> to work fine except for when someone hits space then enter real quick on
> the TableViewer. For some reason this sends things into an infinite loop.
> I traced through the code and it looked like an additional
> selectionChanged event was being placed onto the event queue during the
> TableViewer refresh (by Table.deselectAll()). And by the time the event
> on the event queue is run, my ignoreSelectionChanged flag is already set
> back to false, so selectionChanged is being run again. Then refresh is
> called, etc, etc..
>
> I don't know why space, enter is the special key sequence to trigger this
> infinite loop. I don't have any other listeners and I just want to update
> the labels in my TableViewer. I tried putting ignoreSelect in
> Table.deselectAll() and it seemed to fix my problem. So is that a bug?
>
> Thanks.
>
Re: is Table.deselectAll() missing ignoreSelect? [message #433462 is a reply to message #433349] Thu, 08 April 2004 11:27 Go to previous messageGo to next message
Eclipse UserFriend
Great! Is there a bugzilla bug number for this defect? And was the fix
released for v3 or v2.1.3?


Steve Northover wrote:

> Yes! The code is wrong. I have fixed it and released it. Thanks a million.

> "amy" <amywu@us.DELETETHISPART.ibm.com> wrote in message
> news:c4uvum$p3c$1@eclipse.org...
> > using eclipse 2.1.3
> >
> > Should Table.deselectAll() set the ignoreSelect flag to true/false when
> > calling OS.SendMessage?
> > like:
> >
> > ignoreSelect = true;
> > OS.SendMessage (handle, OS.LVM_SETITEMSTATE, -1, lvItem);
> > ignoreSelect = false;
> >
> > Looking at the other "select" methods in Table, the call to OS.SendMessage
> > is surrounded by ignoreSelect=true/ignoreSelect=false. So I was wondering
> > why deselectAll() does not do the same.
> >
> > I ask because I am running into a problem where the lack of ignoreSelect
> > may be causing me to go into an infinite loop with my tableViewer.
> >
> > I have a composite that contains a TableViewer. I have added a
> > selectionChangedListener to the TableViewer. When selectionChanged, I
> > perform some actions that may involve changing the labels on the items in
> > my TableViewer, so I then call tableViewer.refresh(true). Before calling
> > refresh, I set a ignoreSelectionChanged flag I have to true, so that any
> > selection changes made during refresh will be ignored. This almost seems
> > to work fine except for when someone hits space then enter real quick on
> > the TableViewer. For some reason this sends things into an infinite loop.
> > I traced through the code and it looked like an additional
> > selectionChanged event was being placed onto the event queue during the
> > TableViewer refresh (by Table.deselectAll()). And by the time the event
> > on the event queue is run, my ignoreSelectionChanged flag is already set
> > back to false, so selectionChanged is being run again. Then refresh is
> > called, etc, etc..
> >
> > I don't know why space, enter is the special key sequence to trigger this
> > infinite loop. I don't have any other listeners and I just want to update
> > the labels in my TableViewer. I tried putting ignoreSelect in
> > Table.deselectAll() and it seemed to fix my problem. So is that a bug?
> >
> > Thanks.
> >
Re: is Table.deselectAll() missing ignoreSelect? [message #433467 is a reply to message #433462] Thu, 08 April 2004 16:29 Go to previous message
Eclipse UserFriend
It is only in 3.0. There is no bug report. The code was released just
before I answered your message so it's there now. Try it.

"amy" <amywu@us.DELETETHISPART.ibm.com> wrote in message
news:c53r1v$k4i$1@eclipse.org...
> Great! Is there a bugzilla bug number for this defect? And was the fix
> released for v3 or v2.1.3?
>
>
> Steve Northover wrote:
>
> > Yes! The code is wrong. I have fixed it and released it. Thanks a
million.
>
> > "amy" <amywu@us.DELETETHISPART.ibm.com> wrote in message
> > news:c4uvum$p3c$1@eclipse.org...
> > > using eclipse 2.1.3
> > >
> > > Should Table.deselectAll() set the ignoreSelect flag to true/false
when
> > > calling OS.SendMessage?
> > > like:
> > >
> > > ignoreSelect = true;
> > > OS.SendMessage (handle, OS.LVM_SETITEMSTATE, -1, lvItem);
> > > ignoreSelect = false;
> > >
> > > Looking at the other "select" methods in Table, the call to
OS.SendMessage
> > > is surrounded by ignoreSelect=true/ignoreSelect=false. So I was
wondering
> > > why deselectAll() does not do the same.
> > >
> > > I ask because I am running into a problem where the lack of
ignoreSelect
> > > may be causing me to go into an infinite loop with my tableViewer.
> > >
> > > I have a composite that contains a TableViewer. I have added a
> > > selectionChangedListener to the TableViewer. When selectionChanged, I
> > > perform some actions that may involve changing the labels on the items
in
> > > my TableViewer, so I then call tableViewer.refresh(true). Before
calling
> > > refresh, I set a ignoreSelectionChanged flag I have to true, so that
any
> > > selection changes made during refresh will be ignored. This almost
seems
> > > to work fine except for when someone hits space then enter real quick
on
> > > the TableViewer. For some reason this sends things into an infinite
loop.
> > > I traced through the code and it looked like an additional
> > > selectionChanged event was being placed onto the event queue during
the
> > > TableViewer refresh (by Table.deselectAll()). And by the time the
event
> > > on the event queue is run, my ignoreSelectionChanged flag is already
set
> > > back to false, so selectionChanged is being run again. Then refresh
is
> > > called, etc, etc..
> > >
> > > I don't know why space, enter is the special key sequence to trigger
this
> > > infinite loop. I don't have any other listeners and I just want to
update
> > > the labels in my TableViewer. I tried putting ignoreSelect in
> > > Table.deselectAll() and it seemed to fix my problem. So is that a
bug?
> > >
> > > Thanks.
> > >
>
>
Previous Topic:Class file not generated
Next Topic:Widget Sizes
Goto Forum:
  


Current Time: Sat Sep 20 14:23:50 EDT 2025

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

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

Back to the top