I created a CellTable with image column in GWT. Image is added through `ImageResource .
private Column<DocList, ImageResource> statusColumn;
private final Resources resources = GWT.create(Resources.class);
final String STATUS_COLUMN = "Status";
statusColumn = buildStatusColumn();
private Column<DocList, ImageResource> buildStatusColumn() {
statusColumn = new Column<DocList, ImageResource>(
new ImageResourceCell()) {
@Override
public ImageResource getValue(DocList object) {
return resources.draft();
}
};
statusColumn.setDataStoreName(STATUS_COLUMN);
return statusColumn;
}
public interface Resources extends ClientBundle {
@Source("draft.png")
ImageResource draft();
}
But the problem is that I want to change some css properties of the image, for example, size or cursor="pointer" for click event, but I don't know how. In Firebug there is a default size.
How to add css to image done by ImageResource in GWT?
Columnhas a method calledgetCellStyleName().You can override this method and return a style that reflects the image you use
Then you could create a style in your sheet like this: