Problem creating custom gwt theme

737 views
Skip to first unread message

mitratul

unread,
Nov 17, 2010, 3:16:52 PM11/17/10
to Google Web Toolkit
Hi,

I am trying to create my own theme and use it. But while launching Dev
mode, it is giving the following errors in eclipse console:

Initializing AppEngine server
Loading modules
com.mitratul.theme.standard.Standard
Translatable source found in...
[WARN] No source path entries; expect subsequent failures
Bootstrap link for command-line module
'com.mitratul.theme.standard.Standard'
Linking module 'com.mitratul.theme.standard.Standard'
Constructing StandardLinkerContext
[ERROR] Primary linker is null. Does your module
inherit from com.google.gwt.core.Core or com.google.gwt.user.User?

com.mitratul.theme.standard.Standard is my theme module. I have
followed the same directory structure inside the module as i found
inside GWT inbuilt themes.

Can anybody tell me why is this error coming?

Thanks
Ratul

Gaurav Vaish

unread,
Nov 18, 2010, 3:58:50 AM11/18/10
to Google Web Toolkit
Ensure that your "theme" module "inherits" from
"com.google.gwt.user.User" so as to get a "default-linker".


--
Happy Hacking,
Gaurav Vaish
www.mastergaurav.com

Thomas Broyer

unread,
Nov 18, 2010, 6:40:37 AM11/18/10
to Google Web Toolkit
Your theme has to be <inherit/>ed in an application, not compiled
standalone.

El Mentecato Mayor

unread,
Apr 5, 2012, 3:13:20 PM4/5/12
to google-we...@googlegroups.com
(this is from an old thread I know, but the question hasn't been answered fully in this forum anywhere I see)

So I want to create a custom gwt theme. To do this, I created a standalone maven project with a similar dir structure that I see with the gwt standard theme inside gwt-user.jar. I package it as a jar so it looks like this:

com/mycompany/mytheme/StandardRTL.gwt.xml
com/mycompany/mytheme/Standard.gwt.xml
com/mycompany/mytheme/StandardResources.gwt.xml
com/mycompany/mytheme/public/css/standard.css
com/mycompany/mytheme/public/css/standard_rtl.css
com/mycompany/mytheme/public/images/thumb_vertical.png
com/mycompany/mytheme/public/images/circles.png
com/mycompany/mytheme/public/images/vborder_ie6.png
com/mycompany/mytheme/public/images/thumb_horz.png
com/mycompany/mytheme/public/images/vborder.png
com/mycompany/mytheme/public/images/corner_ie6.png
com/mycompany/mytheme/public/images/hborder_ie6.png
com/mycompany/mytheme/public/images/circles_ie6.png
com/mycompany/mytheme/public/images/corner.png
com/mycompany/mytheme/public/images/hborder.png

then I specify this mytheme.jar as a maven dependency on a gwt project, the idea being that more than one project will use it. In the gwt project, I inherit my custom theme in my gwt module file like this:

<inherits name='com.mycompany.mytheme.Standard' />

and all css styles from standard*.css are used so it works fine, *except* for the images which are simply not used/found.

What do I need to do so that the images are found and used properly when referenced from the css file? (how are custom themes supposed to be packaged?)

El Mentecato Mayor

unread,
Apr 6, 2012, 1:09:48 AM4/6/12
to google-we...@googlegroups.com
I realized soon after posting how to solve my problem... so here's the solution; you have to use the path conventions that the gwt themes use so that your resources can be found. I should have known that because long time ago I got a custom theme from the GWT Theme Generator (http://works.sen-sei.in/gtg/). The css and image files need to be in the public directory and then follow a "gwt/{projectName}/" subdirectory, so the project looks like this now:

com/mycompany/standard/StandardRTL.gwt.xml
com/mycompany/standard/Standard.gwt.xml
com/mycompany/standard/StandardResources.gwt.xml
com/mycompany/standard/public/gwt/standard/standard.css
com/mycompany/standard/public/gwt/standard/standard_rtl.css
com/mycompany/standard/public/gwt/standard/images/thumb_vertical.png
com/mycompany/standard/public/gwt/standard/images/circles.png
com/mycompany/standard/public/gwt/standard/images/vborder_ie6.png
com/mycompany/standard/public/gwt/standard/images/thumb_horz.png
com/mycompany/standard/public/gwt/standard/images/vborder.png
com/mycompany/standard/public/gwt/standard/images/corner_ie6.png
com/mycompany/standard/public/gwt/standard/images/hborder_ie6.png
com/mycompany/standard/public/gwt/standard/images/circles_ie6.png
com/mycompany/standard/public/gwt/standard/images/corner.png
com/mycompany/standard/public/gwt/standard/images/hborder.png

and it works... that's what I get from trying to optimize/modify the structure I copied from the GWT Clean theme.
Reply all
Reply to author
Forward
0 new messages