|
Re: Preventing TreeItem to expand/collapse [message #553717 is a reply to message #549916] |
Wed, 18 August 2010 10:36   |
Eclipse User |
|
|
|
Hi, sorry for the late reply,
There isn't a way to veto an expand/collapse by the user, other than to
listen for the Expand/Collapse event and invoke the opposite API to
re-expand/re-collapse the item, which can show a flash.
I could not find existing Feature Requests for a better way to do this, so
if you want you can log one or two with swt at
https://bugs.eclipse.org/bugs/enter_bug.cgi?product=Platform
&component=SWT&bug_severity=enhancement .
Grant
"Albert" <albert.pikus@gmail.com> wrote in message
news:i2p9oj$v7s$1@build.eclipse.org...
> Hi, everybody,
>
> I wonder if it is possible to prevent TreeItem to expand/collapse when
> [+]/[-] is clicked. Setting event.doit to false doesn't work.
> I tried to prevent expanding/collapsing with both typed listener
> (TreeListener) and untyped listener, but with no success.
>
>
> Any advise would be greatly appreciated.
>
>
> Best regards,
>
> Albert
>
|
|
|
|
Re: Preventing TreeItem to expand/collapse [message #634066 is a reply to message #549916] |
Wed, 20 October 2010 08:37  |
Eclipse User |
|
|
|
Hi,
thank you both for your replies.
I solved this like Grant suggested, but there is of course this "flash" that occurs when preventing TreeItem to collapse by re-expanding it immediately after the collapse.
I can certainly see a use case when this feature could be useful, although vijay's remark on expanding is true; I need this functionality just to prevent collapse, while preventing expanding of TreeItem can be achieved by other means.
I guess I will just have to live with the above mentioned solution, thank you again for your answers!
Best regards,
Albert
|
|
|
Powered by
FUDForum. Page generated in 0.04485 seconds