On 3 March 2011 21:31, Philippe Beaudoin <[email protected]> wrote:
> Hi!
> I'm using Maven to build my GWT project, together with the standard Maven
> directory layout. That is, sources are in src/main/java while resources
> (such as CSS files) are in src/main/resources.
> Now, in one of my .ui.xml file I have a <ui:style> tag that uses an src
> attribute to define some constants (such as lightPanelColor, below). Here it
> is:
> src/main/java/com/gwtplatform/samples/tab/client/view/AdminAreaView.ui.xml:
> <ui:style src='../../defines.css'>
> .panel {
> background-color: lightPanelColor;
> padding: 5px;
> }
> </ui:style>
> src/main/resources/com/gwtplatform/samples/tab/defines.css:
>
> @def darkPanelColor #fcb072;
> @def lightPanelColor #fcd5b6;
> @def messageBoxColor #fad163;
> @def titleFontWeight bold;
> @def titleFontSize 22px;
> @def titleColor #921b12;
> @def minAppWidth 700px;
> @def leftColWidth 200px;
> @def formLineSpacing 8px;
>
> This works very well when I gwt compile my project, but it causes an error
> in Eclipse on that line:
>
> <ui:style src='../../defines.css'>
>
> because defines.css cannot be found. It's not surprising as it's not in the
> same directory tree...
> The fix is simple: just move defines.css to the java directory tree, but it
> feels a bit dirty. I wondered if it would be possible to make the GEP
> maven-aware somehow? (Maybe this would even let me drop the .ui.xml in the
> resources folder?)
You can most certainly put all of your resources (*.css, *.ui.xml,
*.gwt.xml) in src/main/resources. You do have to make sure that when
you add src/main/resources as a source folder in Eclipse that
Eclipse/Maven do not add an exclusion filter (i.e. remove it).
Another option is to use the Java annotation [i.e.
@Source("../../defines.css")] and use ui:with instead of <ui:style> in
your *.ui.xml. This works very well.
--
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.