你需要告诉GWT使用新的风格 - 简单地将它们添加到您的模块CSS文件不会是不够的:
table = new CellTable<FooType>(12,
CellTableResources.INSTANCE, keyProvider);
CellTableResources.INSTANCE应该是一个资源包实例扩展CellTable资源包。喜欢的东西:
import com.google.gwt.core.client.GWT;
import com.google.gwt.resources.client.ImageResource;
import com.google.gwt.resources.client.ImageResource.ImageOptions;
import com.google.gwt.resources.client.ImageResource.RepeatStyle;
import com.google.gwt.user.cellview.client.CellTable;
import com.google.gwt.user.cellview.client.CellTable.Style;
public interface CellTableResources extends CellTable.Resources {
public static CellTableResources INSTANCE = GWT.create(CellTableResources.class);
@Source("footer_bg.png")
@ImageOptions(repeatStyle = RepeatStyle.Both, flipRtl = true)
ImageResource cellTableFooterBackground();
@Source("header.png")
@ImageOptions(repeatStyle = RepeatStyle.Horizontal, flipRtl = true)
ImageResource cellTableHeaderBackground();
@Source("table_head_bg_left.png")
@ImageOptions(repeatStyle = RepeatStyle.None, flipRtl = true)
ImageResource cellTableHeaderFirstColumnBackground();
@Source("table_head_bg_right.png")
@ImageOptions(repeatStyle = RepeatStyle.None, flipRtl = true)
ImageResource cellTableHeaderLastColumnBackground();
@Source(CellTableStyle.DEFAULT_CSS)
Style cellTableStyle();
}
然后当然同样的事情为CellTableStyle:
import com.google.gwt.user.cellview.client.CellTable;
public interface CellTableStyle extends CellTable.Style {
String DEFAULT_CSS = "path/to/your/new/CellTable.css";
String cellTableCell();
// ....
}