I've changed my code.  Now for every FastTreeItem I create, I override
everything like this:

                        FastTreeItem fti1 = new FastTreeItem("test1"){
                                public void onSelected()
                                {
                                        //duplicate code
                                }
                                //More overrides
                        };
                        fti1.becomeInteriorNode();
                        myTree.addItem(fti1);

                        FastTreeItem fti2 = new FastTreeItem("test"){
                                public void onSelected()
                                {
                                        //duplicate code
                                }
                                //more overrides
                        };
                        fti2.becomeInteriorNode();
                        myTree.addItem(fti2);

I need this to work so I'm willing to do that, but if someone has the
solution how to extend FastTreeItem and use it to capture FastTreeItem
events, I'd be grateful.

Thanks,
Mark



On Dec 16, 9:14 pm, Mark Rieck <[email protected]> wrote:
> Sorry for the beginner question, I've been doing too much C# and not
> enough Java for too long.
>
> Anyway, I want to get listeners for a FastTreeItem with my FastTree...
> since FastTreeItem doesn't have addXListener methods, I extended
> FastTreeItem.
>
> When I try a simple function to add the items, I only get the first
> node and no events fire.   What do I have to do to get these events to
> fire?
>
> private class MyFastTreeItem extends FastTreeItem
> {
>                   public MyFastTreeItem()
>                   {
>                          super();
>                   }
>                  public MyFastTreeItem(String html)
>                  {
>                         super(html);
>                  }
>                  public MyFastTreeItem(Widget widget)
>                 {
>                       super(widget);
>                 }
>                 @Override
>                 protected void onSelected()
>                 {
>                         //...
>
>                 }
>                 @Override
>                 public void beforeOpen()
>                 {
>                         //...
>                 }
>
> }
>
> private void create()
> {
>                FastTree testTree = new FastTree();
>                 MyFastTreeItem fti1 = 
> (MyFastTreeItem)testTree.addItem("test1");
>                 MyFastTreeItem fti2 = 
> (MyFastTreeItem)testTree.addItem("test2");
>                 MyFastTreeItem fti3 = 
> (MyFastTreeItem)testTree.addItem("test3");
>
> }
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to