我有DisclosurePanel,作为标题内容,我有应用样式的 Horizo ntalPanel,这些样式具有背景图像,它使用 ClientBundle 和 @sprite。但问题是样式不适用于标题小部件(水平面板)
我的代码在这里
入门级
public class Test implements EntryPoint {
/**
* This is the entry point method.
*/
public void onModuleLoad() {
TestClientBundle.INSTANCE.testCsss().ensureInjected();
DisclosurePanel dp = new DisclosurePanel();
HorizontalPanel hp = new HorizontalPanel();
dp.setStyleName("blue");
Label l = new Label("testing the DP with IMG-CSS bundle");
hp.add(l);
dp.setHeader(hp);
dp.setContent(new Label("Body"));
RootPanel.get().add(dp);
}
}
ClientBundle 接口
public interface TestClientBundle extends ClientBundle {
TestClientBundle INSTANCE = GWT.create(TestClientBundle.class);
@Source("blue.jpg")
public ImageResource blue();
@Source("test.css")
public CssResource testCsss();
}
CSS文件
@external .blue;
@sprite .blue {
gwt-image: 'blue';
cursor: pointer;
text-decoration: none;
}
是 GWT 中的已知问题还是我的代码错误?