It may not be a perfect solution to what you want to do, but because those
are native DOM Elements, which subtype JavaScriptObject, you can cast them
to any other JSO subtype you like. For example:
@UiField Element elem;

MyWidget() {
  // ...

  // If your element subclasses Element:
  ((MyLabelElement)elem).goCrazy();

  // If not, then:
  MyLabelElement lbl = elem.cast();
  lbl.goCrazy();
}

IOW, the generated code doesn't "create" an element, it just wraps the
native element in a particular JSO interface, which you're free to change
later.

On Fri, Aug 28, 2009 at 6:34 AM, Richard Vowles <richard.vow...@gmail.com>wrote:

>
> No - more like (for example), when it hits a <label> it always creates
> a Google LabelElement - say I want to create a MyLabelElement instead
> (which does some extra thing, which in my case it does). I can't do it
> without hacking it (which I have done). Happy to file an Issue on
> this...
>
> On Aug 27, 11:49 pm, Joel Webber <j...@google.com> wrote:
>
> > I'm not entirely certain I understand the problem here -- is the issue
> that
> > you want to use an element for which there's no Element subtype in the
> .dom
> > package? We didn't go to great lengths to make this extensible, because
> the
> > set of legal HTML DOM elements changes at a glacial pace. But if there's
> one
> > we missed, please let us know!
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~----------~----~----~----~------~----~------~--~---

Reply via email to