I am trying to use CSS classes defined in a ClientBundle
to set the style for my widget.
Unfortunately, the style is not applied.
I use the very same ClientBundle to display an icon, and it works.
I have put the style.css file within the same directory as
MyResources.java clientbundle,
they are in the same package(com.myapp.client.ui.xxx).
this style.css is not included in main html file and is not in webapp
directory.
do I need to put this css file in a webapp folder ?
below is the code:
public interface MyResources extends ClientBundle {
@Source("style.css")
Style style();
@Source("home.png")
ImageResource homeIcon();
public interface Style extends CssResource {
String homeLink();
}
}
style.css:
.homeLink {
color:red;
font-size:20px;
font-weight:bold;
background-color:green;
}
MyWidget:
public class MyWidget extends Composite {
FlowPanel panel = new FlowPanel();
private final AppResources resources;
@Inject
public RolloverListWidget(MyResources resources) {
initWidget(panel);
this.resources = resources;
Hyperlink homeLink = new InlineHyperlink("Home", "home");
homeLink.setStyleName(this.resources.style().homeLink()); //
link is NOT styled : (
//
I tried addStyleNames, etc
//
still didnt work
Image homeIcon = new Image(this.resources.homeIcon()); // I
can see the icon
panel.add(homeLink);
panel.add(homeIcon);
}
}
what I am doing wrong ?
do you know how I can correctly style "homeLink" using ClientBundle
technique ?
--
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.