Hi Mary,
You want to use the GWT Events system and the Observer pattern.
Basically you want to make you tree broadcast a change event when an
item is selected and have your TabPanel listen for these change events
by implementing, say, ChangeListener. Then it would have a method like
so:
public void onChange(Widget sender) {
if (sender instanceof MyTreePanel) {
String requiredText = ((MyTreePanel)
sender).getSelectedItemtext();
// do what you ned to select the right tab from this
}
}
Your tree panel needs to implement, say, SourcesChangeEvents and you
can use ChangeListenerCollection to store listeners and fire change
events to them. Your entry point class does not need to become
involved, it just handles registering the TabPanel as a listener with
the TreePanel when it creates them..
This thread goes into it a bit:
http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread/84d94cbfcd662ad0/8fda0fcf8052beaf?lnk=gst&q=gregor+observer+pattern#8fda0fcf8052beaf
and I would take a look at Ian Banbury's site for information about
listeners:
http://examples.roughian.com/#Listeners~Summary
regards
gregor
On Nov 27, 8:48 pm, gmary <[EMAIL PROTECTED]> wrote:
> I have a TreePanel and a Tab Panel... both I call from file Entry-
> point.
>
> I want to that when I do click on TreeNode a Tab corresponding be
> activate. How to do it?. I have create the TreeNode in a file, I add
> its nodes though a for-cicle... Now, how I can pass the text
> (node.getText()) to entry-point file?.
>
> I'll wait a response soon, thanks
>
> Mary
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---