Hi,

Create an interface, like:

public interface HasState {
   void setEnabled(boolean enabled);
   boolean isEnabled();
}

...and then implement this with your composite widget. And don't try
to cast objects, GWT supports 'instanceof'. :-)

I hope this was to any help.

P.s. I'm actually confused that such an interface doesn't already
exist within the GWT API since many widgets have exactly those two
methods.


On 19 Okt, 16:07, skrat <[email protected]> wrote:
> Hi all,
>
> all the stuff that FocusWidget does is maybe too much for my case. I
> only need to cast to something that has setEnabled(boolean) method. In
> other words I want to create a widget that would act similar to
> TextBox and similar input widgets. Then I want to checkout Widgets out
> of my container, try to cast (FocusWidget), and if successful, call
> setEnabled().
>
> I tried to extend FocusWidget instead of Composite, but my widget
> stopped working (event handler were not triggered) after that. Any
> ideas how to overcome this?

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

Reply via email to