Borders on Decorator panel

1,518 views
Skip to first unread message

Marcelo Sena

unread,
Jan 2, 2010, 7:20:14 AM1/2/10
to Google Web Toolkit
I don't know how to change the color in a decorator panel. I tried
looking for help in the documentation so I wrote this to my main css:

.gwt-DecoratorPanel.topLeft{
border-style: solid;
border-width:1;
border-color: RED;
}

But the border is still blue, what do I do?

Marcelo Sena

unread,
Jan 2, 2010, 1:29:39 PM1/2/10
to Google Web Toolkit
It seems that the border is an image, making it quite troublesome to
work with it with CSS.
So I decided to work with the middleCenter element of the panel, that
gives a nice orange border around my widgets:

.gwt-DecoratorPanel .middleCenter{
border-style: solid;
border-width:1;
border-color: #CC6600;
}

Now I want to apply this style to only a few specific widgets. That
is:

#unsavedNote .middleCenter{...}

However calling this code from the widget constructor:

this.setStylePrimaryName("unsavedNote");

Produces no results, I'm inspecting the source with Chrome and I can
tell that the element doesn't have the that style(it has gwt-
DecoratorPanel)

Help?

Chris Ramsdale

unread,
Jan 3, 2010, 3:12:47 PM1/3/10
to google-we...@googlegroups.com
I would suggest using addStyleName(), as it will allow you to tweak the look and feel, and still leverage all of the existing DecoratorPanel CSS. The following code worked for me:

public ContactsView() {
  DecoratorPanel contentTableDecorator = new DecoratorPanel();
  initWidget(contentTableDecorator);
  contentTableDecorator.addStyleName("orangeOutline");
  ...
}


With this CSS:

.orangeOutline {
  border-style: solid;
  border-width:1;
  border-color: #CC6600;
}
.gwt-DecoratorPanel .middleCenter {
  height: 100%;
  width: 100%;
 }


--

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-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.



Marcelo Sena

unread,
Jan 23, 2010, 3:04:02 PM1/23/10
to google-web-toolkit
Thanks Chris, though I chose the lazy approach, using images and
changing them to signal success or failure. But thanks again!!

--
Marcelo Sena

Reply all
Reply to author
Forward
0 new messages