SelectionListener not called when setSelection invoked? [message #458623] |
Sat, 16 July 2005 20:27  |
Eclipse User |
|
|
|
Hi,
I have a Tree control in a TreeViewer in eclipse 3.1. I want to change the
selected item in the tree when something is dragged on top of it. I used
Tree.setSelection(TreeItem) to set the selected item to the one that is the
drop target. If I call getSelection immediately afterwards the correct item
is now marked as selected.
I also have a SelectionListener for the tree. This is called correctly when
I click on items in the tree and the selection changes, however, when I set
the selection with Tree.setSelection, the SelectionListener is not invoked.
Is this the normal behavior ? bug? or perhaps something I am doing wrong?
Thanks,
Agnes
|
|
|
|
Re: SelectionListener not called when setSelection invoked? [message #458666 is a reply to message #458625] |
Mon, 18 July 2005 15:29  |
Eclipse User |
|
|
|
Thanks Konstatin, I called notifyListeners to invoke the event on the
listener and this is working for me.
"Konstantin Scheglov" <kscheglov@gmail.com> wrote in message
news:dbcpet$384$1@news.eclipse.org...
> Agnes Freese:
>
> This is normal. Just call handler yourself, if you need.
>
> In other case (if it calls it automatically) you will need more
> changes: add field flag that say, if this selection is because you set
> it and it should not be handled, plus you will need to set/clear in and
> also check in handler.
>
> > I have a Tree control in a TreeViewer in eclipse 3.1. I want to change
the
> > selected item in the tree when something is dragged on top of it. I
used
> > Tree.setSelection(TreeItem) to set the selected item to the one that is
the
> > drop target. If I call getSelection immediately afterwards the correct
item
> > is now marked as selected.
> >
> > I also have a SelectionListener for the tree. This is called correctly
when
> > I click on items in the tree and the selection changes, however, when I
set
> > the selection with Tree.setSelection, the SelectionListener is not
invoked.
> > Is this the normal behavior ? bug? or perhaps something I am doing
wrong?
> >
> > Thanks,
> > Agnes
> >
> >
|
|
|
Powered by
FUDForum. Page generated in 0.04938 seconds