Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #29873 > unrolled thread

Setting styles in GWT

Started byw.tom.adams@gmail.com
First post2014-08-30 03:58 -0700
Last post2014-09-08 00:46 +0200
Articles 2 — 2 participants

Back to article view | Back to comp.lang.java.programmer


Contents

  Setting styles in GWT w.tom.adams@gmail.com - 2014-08-30 03:58 -0700
    Re: Setting styles in GWT Magnus Warker <magnux@mailinator.com> - 2014-09-08 00:46 +0200

#29873 — Setting styles in GWT

Fromw.tom.adams@gmail.com
Date2014-08-30 03:58 -0700
SubjectSetting styles in GWT
Message-ID<c54e7a98-fa3a-4956-a9e1-4aabccb49447@googlegroups.com>
I am converting some code from awt to gwt.

It's easier to set the color of a Label in awt.

Looks like I need to use addStyleName to modify the color.  I think that means
the label ends up with a primary and secondary style.

Suppose I have one Label and I want to set another Label to have the same color.
This was easy in awt, I just do L2.setForeground(L1.getForeground()).

But in GWT do I have to get all the styles, parse them, and figure
out the color style and add it to the other label?

[toc] | [next] | [standalone]


#29924

FromMagnus Warker <magnux@mailinator.com>
Date2014-09-08 00:46 +0200
Message-ID<luin8q$smf$1@news.m-online.net>
In reply to#29873
On 08/30/2014 12:58 PM, w.tom.adams@gmail.com wrote:

> Looks like I need to use addStyleName to modify the color.  I think that means
> the label ends up with a primary and secondary style.
>
> Suppose I have one Label and I want to set another Label to have the same color.
> This was easy in awt, I just do L2.setForeground(L1.getForeground()).

  String c = lbl1.getElement ().getStyle ().getColor ();
  lbl2.getElement ().getStyle ().setColor (c);

Magnus

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.java.programmer


csiph-web