You can add a style name at any time.  If the UIObject had no style
name at the time, that would be the same as setting style name.

You can set style name at any time. It blows away any pre-existing
style name(s).

You can only add dependent style name when there is a 'primary' style
name in place (see above).

So in your case, if you say fp.setStyleName("foo-FlowPanel"), then you
can make up a css rule for .foo-FlowPanel {}, and you can also say
fp.addStyleDependentName("bar"), and the full style name will now be
"foo-FlowPanel foo-FlowPanel-bar".

Walden

On Oct 27, 10:32 am, hezjing <[EMAIL PROTECTED]> wrote:
> Hi Walden
> Do you mean we have to explicitly setStyleName() before calling
> addStyleName() or addStyleDependentName()?
>
>
>
>
>
> On Mon, Oct 27, 2008 at 8:12 PM, walden <[EMAIL PROTECTED]> wrote:
>
> > You need a style name set before you can set a dependent name.  So, to
> > the original poster, construct your FlowPanel.  Set its style name to
> > whatever, and then write your css rules to that.
>
> > Walden
>
> > On Oct 27, 3:18 am, hezjing <[EMAIL PROTECTED]> wrote:
> > > Hi
>
> > > To add the borders to a panel, we will create a style in CSS:
>
> > > .test {
> > >   background-color: red;
> > >   border: thin solid #000000;
> > >   margin: 10px;
>
> > > }
>
> > > Then set the style to a panel like this:
>
> > > FlowPanel panel = new FlowPanel();
> > > panel.setWidth("100%");
> > > panel.setHeight("100%");
> > > // panel.addStyleDependentName("test") does not work?
> > > panel.setStyleName("test");
>
> > > Why the above code works with setStyleName() but nothing happen when
> > calling
> > > addStyleDependentName()?
>
> > > On Mon, Oct 27, 2008 at 12:43 AM, hezjing <[EMAIL PROTECTED]> wrote:
> > > > Hi
> > > > How can I draw a border, and set the background color of a FlowPanel?
>
> > > > I think this should be done via CSS (right?) but unfortunately, I don't
> > > > find the CSS style rules from the API doc.
>
> > > > --
>
> > > > Hez
>
> > > --
>
> > > Hez
>
> --
>
> Hez- Hide quoted text -
>
> - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to