Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Test and Performance Tools Platform (TPTP) » How to expand a TreeViewer in a view through an IVewPart (verification hook)
How to expand a TreeViewer in a view through an IVewPart (verification hook) [message #70599] Fri, 12 May 2006 10:13 Go to next message
Bertrand is currently offline BertrandFriend
Messages: 2
Registered: July 2009
Junior Member
Hello :)

I've done a testCase with the GUI Recorder where I insert a hook on the
package explorer view.
I've downloaded the Ali Mehregani's codes (cf. the
" http://dev.eclipse.org/newslists/news.eclipse.tptp/msg01854. html" news to
know more - very usefull) to get access to the controls located in this
hooked View (the packageExplorer view), and particularly a tree (likely a
TreeViewer).

I've noticed that I can't get control on all the children of the tree in
my code if it isn't fully expanded (am I right or do I need sleep? :p). To
resolve the problem I just add a recursive method to perform a
setExpanded(true) on each tree item.

Surprisingly, it works but just a bit...
The tree is expanded but the expanded items don't show up!
I've somthing like this:

** initial state -, for ex. fully collapsed but it doesn't matter: **

+MyTreeRoot

** I perform the setExpanded)true) through my verification hook and I get
: **

-MyTreeRoot
|_ << nothing

** instead of (for example): **

-MyTreeRoot
|_FirstChild
| |_file1
|
|_SecondChild


The weird thing is that if I "physically" click on the +MyTreeRoot to
expand it, it perfectly works...

I was wondering if it was due to the cast I made on my tree component (I
did a cast from "Control" to "Tree") because I suppose that the tree in
this view is a TreeViewer.

If someone has a beginning of solution... Cheers

Bertrand.
Re: How to expand a TreeViewer in a view through an IVewPart (verification hook) [message #71425 is a reply to message #70599] Sat, 20 May 2006 23:13 Go to previous messageGo to next message
No real name is currently offline No real nameFriend
Messages: 404
Registered: July 2009
Senior Member
There could be differences from programmatically expanding a tree vs.
manually expanding it (for example, expansion listeners may not get notified
when programmatically expanding a tree).
I recommend doing an expansion of the tree to the level that you would like
to verify before inserting the hook.

"Bertrand" <bvanier@curamsoftware.com> wrote in message
news:359f743d74ef9fc294a77f6e41969ab6$1@www.eclipse.org...
> Hello :)
>
> I've done a testCase with the GUI Recorder where I insert a hook on the
> package explorer view.
> I've downloaded the Ali Mehregani's codes (cf. the
> " http://dev.eclipse.org/newslists/news.eclipse.tptp/msg01854. html" news to
> know more - very usefull) to get access to the controls located in this
> hooked View (the packageExplorer view), and particularly a tree (likely a
> TreeViewer).
>
> I've noticed that I can't get control on all the children of the tree in
> my code if it isn't fully expanded (am I right or do I need sleep? :p). To
> resolve the problem I just add a recursive method to perform a
> setExpanded(true) on each tree item.
>
> Surprisingly, it works but just a bit...
> The tree is expanded but the expanded items don't show up!
> I've somthing like this:
>
> ** initial state -, for ex. fully collapsed but it doesn't matter: **
>
> +MyTreeRoot
>
> ** I perform the setExpanded)true) through my verification hook and I get
> : **
>
> -MyTreeRoot
> |_ << nothing
>
> ** instead of (for example): **
>
> -MyTreeRoot
> |_FirstChild
> | |_file1
> |
> |_SecondChild
>
>
> The weird thing is that if I "physically" click on the +MyTreeRoot to
> expand it, it perfectly works...
>
> I was wondering if it was due to the cast I made on my tree component (I
> did a cast from "Control" to "Tree") because I suppose that the tree in
> this view is a TreeViewer.
>
> If someone has a beginning of solution... Cheers
>
> Bertrand.
>
Re: How to expand a TreeViewer in a view through an IVewPart (verification hook) [message #71895 is a reply to message #71425] Fri, 26 May 2006 15:06 Go to previous message
Bertrand is currently offline BertrandFriend
Messages: 2
Registered: July 2009
Junior Member
Ok thanks for the answer, I'll manually expand the tree so :)
Bertrand.
Previous Topic:Profiling under BEA JRockit JVM
Next Topic:unable to generate .execution file from .testsuite
Goto Forum:
  


Current Time: Thu Apr 18 13:36:59 GMT 2024

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

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

Back to the top