sorry,

hit send too early... here is the example

public interface DesktopResources extends ClientBundle {
 @NotStrict
@Source("desktop.css")
CommonResources commonResources();
 @Source("./images/app_logo.png")
ImageResource appLogo();
}

public interface CommonResources extends CssResource {
/**
 * Width of the Main Page
 */
int pagewidth();
 /**
 * application logo
 */
String appLogo();
}

desktop.css
/* css file definition */


@def pageWidth 1000px;

@sprite .appLogo {
gwt-image: 'appLogo';
float: left;
}

/* end css file def */

you need to define a main Style class which you can use to refer all your
resources

public class Style {
private static DesktopResources resources;
 static {
resources = GWT.create(DesktopResources.class);
resources.commonResources().ensureInjected();
}
 public static CommonResources common() {
return resources.commonResources();
}
 public static DesktopResources resources() {
return resources;
}
}


now in each of your UiBinder define the following line. This would allow you
to refer the styles defined in your css files. Its a good practice to
centrally define all the styles in a CSS files as this would help in easily
managing your changing styles for the page

<ui:with field='style' type='com.example.client.style.Style' />

<g:HTMLPanel>
<div class='{style.common.appLogo}'/>
</g:HTMLPanel>


Thanks
Ashwin


On Tue, Jul 19, 2011 at 9:33 AM, [email protected] <
[email protected]> wrote:

> here is an example
>
> public interface DesktopResouces extends ClientBundle {
>
> }
>
> On Tue, Jul 19, 2011 at 2:49 AM, Markus <[email protected]> wrote:
>
>> Thanks for your reply. But I don't know how it should work with CSS
>> Resource?
>>
>> Ok I created
>>
>> public interface ResourceBundle extends ClientBundle {
>>
>>         public static final ResourceBundle INSTANCE =
>> GWT.create(ResourceBundle.class);
>>
>>          @Source("css/example.css")
>>         public CssResource css();
>>
>> }
>>
>> But now?
>>
>> Where can I define ImageResources? Could you please explain your
>> solution... maybe with an short example?
>>
>> Thanks for your help
>>
>> Regards, Markus
>>
>> --
>> 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.
>>
>>
>

-- 
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