Just like with any ClientBundle
and CssResource
: create an interface that extends Datagrid.Resources
and overrides the dataGridStyle
method with a @Source
annotation pointing to your own CSS file (or possibly to both the original file and your own file, so they'll be combined together).
Doing it that way will override the style for all DataGrid
s in your app though (it actually depends on which CssResource
instance gets ensureInjected()
first: the one from the original DataGrid.Resources
or the one from your sub-interface): because you use the same return type (DataGrid.Style
), the obfuscated class names will be the same.
If you want to change the style on a case-by-case basis then, in addition, declare an interface that extends DataGrid.Style
and use that as the return type to your dataGridStyle
override: because the obfuscated class name is based on both the interface fully-qualified name and the method name, your DataGrid.Style
sub-interface will generate different obfuscated class names than the original DataGrid.Style
interface.
Then of course, GWT.create()
your DataGrid.Resources
sub-interface and pass it as an argument to the DataGrid
constructor.
See also http://code.google.com/p/google-web-toolkit/issues/detail?id=6144
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…