Thanks for the advice. It turns out I found a simpler approach
however. I wasn't aware that you could add something to Toolbar by its
DOM element. For me this turns out to do the trick:

                Hyperlink link = new Hyperlink("Test Link", 
placeRequest.toString
());
                toolbar.addElement(link.getElement());

Extending ToolbarItem I'm sure offers quite a bit of flexibility.

On Oct 25, 9:42 am, "Thomas Arp" <[email protected]> wrote:
> Java doesn't support multiple inheritance (which incidentally is what you're
> after here.
>
> To work around this limitation, it is generally useful to use delegation
> instead:
>
> class ToolbarHyperlink extends ToolbarItem implements HasClickHandlers,
> HasHandlers, EventListener, HasHTML, HasText, SourcesClickEvents
> {
>   Hyperlink itsHyperlink;
>
>   public ToolbarHyperlink(String text, String targetHistoryToken)
>   {
>     itsHyperlink = new Hyperlink(text, targetHistoryToken);
>   }
>
>   ...
>   public void onBrowserEvent(Event event)
>   {
>     super.onBrowserEvent(event);
>     itsHyperlink.onBrowserEvent(event);
>   }
>   ... etc for the other interfaces.
>
> }
>
> This is the "approved" method of simulating multiple inheritance in Java.
>
> Thomas Arp
>
> -----Original Message-----
> From: [email protected] [mailto:[email protected]] On Behalf
>
> Of prairie_kids
> Sent: 24. oktober 2009 23:24
> To: GWT-Ext Developer Forum
> Subject: adding a GWT Hyperlink to a Toolbar
>
> I'm interested in being able to add a Hyperlink to my GWT-EXT Toolbar
> but Hyperlink of course has nothing to do with being derived from
> ToolbarItem. Has anyone gone down this path? Essentially I want
> hyperlinks in my toolbar but using Hyperlink would be nice so that I
> could make use of the built-in browser history functionality.
>
> I'm considering what I might need to do to derive from ToolbarItem but
> could use some help in this.
>
> Thanks
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"GWT-Ext Developer Forum" 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/gwt-ext?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to