I need to set up specific styles of Cell Browser cells in GWT from a CSS file. Any pointers on how to do it
GWT: Setting specific styles for Cell in Cell Browser
849 views Asked by JDT At
2
There are 2 answers
3
On
If you are using 2.4 or 2.5 sdk of GWT
Override getCellStyleNames()
while creating column.
TextColumn<String> col= new TextColumn<String>() {
@Override
public String getCellStyleNames(Context context, String object) {
return "yourStylee";
}
@Override
public String getValue(String object) {
return object.getName();
}
};
};
If its cell
public void render(com.google.gwt.cell.client.Cell.Context context, Meeting object, SafeHtmlBuilder sb) {
sb.append(SafeHtmlUtils.fromString(" <div class=youclass><table>"));
// Code goes here
sb.append(SafeHtmlUtils.fromString("<table> </div>"));
You should be able to set the css style on any widget using methods from UIObject. In this case something like this should work:
with "newStyle" being listed in your CSS.