the way you are going to solve the problem. If you are an OO-guy, then
the better solution is to use styling interfaces and just appropriate
method (http://code.google.com/intl/ru-RU/webtoolkit/doc/latest/
DevGuideUiBinder.html#Programmatic_access). But this approach requires
you to use UiBinder. So, result will look like this:
myUiField.setStyleName(style.grey()).
Less beautiful way is to define all your styles in some external css
file and set style names for any widget ( it does not matter is it is
your custom one or a default one ) directly specifying its name. For
ex: anyWidget.setStyleName("myColorStyle"). This appoach does not
sensitive to the way you declare\code your user interface.
The hard-rock way is to use DOM. :
Widget.getElement().getStyle().setProperty("backgroundColor",
"#AABBCD");
/* very wrong way in nowadays, in my point */
Any way it is up to you to chose one.
By the way: try to play with addStyleName("style1") method. If I
remmeber thing right, you can add some extra style when you need it
with that method, and delete it with method deleteStyleName("style1")
On 26 июл, 16:35, sanjay kanwar <sanj.kan...@gmail.com> wrote:
> Hi There,
>
> I have two Css background color and i want to show one color at a time when
> a certain kind of condition fulfill. Confused how to proceeed. any help or
> example (sample) would be great.
> Thx in Advance
>
> --
> Regards
> Sam
--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
No comments:
Post a Comment