如何从一个ClientBundle导入图像以在另一个ClientBundle的样式中使用它

时间:2014-03-13 18:03:42

标签: css gwt clientbundle cssresource

我喜欢一个客户端包:

public interface FirstClientBundle extends ClientBundle {

  public static final FirstClientBundle INSTANCE = 
  GWT.create(FirstClientBundle.class);

  @Source("panel-top-bg.png")
  public ImageResource panelTopBg();
}

我想在另一个Bundle的样式中使用第一个Bundle中的图像。像这样:

public interface SecondClientBundle extends ClientBundle {

  public static final SecondClientBundle INSTANCE = 
  GWT.create(SecondClientBundle.class);

  public interface Style extends CssResource {
    @ClassName("panelTop")
    String panelTop();
  }

  @Source({ "style.css" })
  public Style style();
}

结束CSS文件如下:

@sprite .panel-top {
  gwt-image: "FirstClientBundle.panelTopBg";
  height: 18px;
  cursor: move;
}

甚至可能吗?或者我应该采取不同的做法?

1 个答案:

答案 0 :(得分:0)

你能写第二个ClientBundle作为第一个的子接口吗?

public interface SecondClientBundle extends FirstClientBundle
相关问题