1

This question has been asked before...

GWT 2.0 Themes?

GWT Themes and Component Libraries

...but 2 years have gone by.

Back then the answer was essentially "no" unless you use a widget library. I'm just looking for a nice CSS theme that will get me closer to Vaadin or ExtJS but works with the vanilla GWT controls.

Community
  • 1
  • 1
Dave
  • 21,524
  • 28
  • 141
  • 221

1 Answers1

3

Have you tried the built-in themes in the *.gwt.xml to see if they mesh?

<!-- Inherit the default GWT style sheet. You can change       -->
<!-- the theme of your GWT application by uncommenting         -->
<!-- any one of the following lines.                           -->
<!-- <inherits name='com.google.gwt.user.theme.standard.Standard'/> -->
<!-- <inherits name="com.google.gwt.user.theme.chrome.Chrome"/> -->
<inherits name="com.google.gwt.user.theme.dark.Dark"/>

They are pretty basic. The difficulty with create any skin for GWT is that you pretty much have go through the package and customize some widgets on a case by base basis. With the advent of UiBinder and ClientBundle, some widgets (such as DisclosurePanel and CellTable) contain embedded or inline styling that uses styles and images that are embedded. A different arrow or highlighting scheme need to overridden at an implementation level.

If you take a look at CellTable and if you browse the package you'll see that many of the styling elements packaged inside the JAR. So, in order to have a new CellTable style you'll need to do something like this

class MyCellTable<T> extends CellTable<T> {
    interface MyResources extends CellTable.Resources {
        @Override
        @ImageOptions(flipRtl = true)
        @Source("hamsterDance.gif") // because I can :P
        ImageResource cellTableLoading();

        @Source("MyCellTableStyle.css")
        Style cellTableStyle();
    }
}
Lam Chau
  • 842
  • 5
  • 14
  • So you are saying that GWT CSS normally uses selectors that refer to your own layouts, forms, widgets, etc.? If so, then is there any kind of gallery or examples for GWT CSS that I can get ideas from? We need a designer here, but don't have one yet! – Dave Nov 12 '11 at 17:20
  • Updated answer to go in depth a little bit more, not sure there's that's what you're asking but there isn't a lot of skinning or "themeing" examples (Google has been overhauling it's UI, most of their web apps if not all use GWT). If look and feel is really important, it might not be a bad idea to use something like SmartGWT or GWT-Ext (I haven't used these but they seem to support additional themes). – Lam Chau Nov 12 '11 at 21:40