Célio,

GWT is of course open source, so you could easily create an issue in
the issue manager (http://code.google.com/p/google-web-toolkit/issues/
list) and submit a patch including your code below on, presumably, the
UIObject class.  It could then get discussed and perhaps included in
the main code.

(I wonder, for example, if you would also want a method that allows
you to inspect what the status of the toggle is - a sort of public
boolean widget.hasStyle("SomeStyleName") method that would return the
result of toggleStyleName, or, perhaps better and more generic,  the
result of querying the style for a particular name?)

//Adam

On 22 Juli, 19:00, Célio <ccidral....@gmail.com> wrote:
> Eventually I find my self doing this:
>
>         toggleStyleName = !toggleStyleName;
>         if (toggleStyleName)
>         {
>             widget.addStyleName("SomeStyleName");
>         }
>         else
>         {
>             widget.removeStyleName("SomeStyleName");
>         }
>
> So here goes my 2 cents: instead of manually toggling a style name, it
> could be simply:
>
>         widget.toggleStyleName("SomeStyleName");
>
> jQuery actually has such a method, it's usefull, helps keep my code
> clean.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to Google-Web-Toolkit@googlegroups.com
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to