CheckboxCell does not support this functionality, but you can make your own cell that does. Untested code (copied largely from the CheckboxCell code, Copyright Google (see CheckboxCell source for license)) follows! The important part is in the render code. Your new cell would go in a Column<MyType, MyType>.
public class DisableableCheckboxCell extends AbstractEditableCell<MyType> {
/**
* An html string representation of a checked input box.
*/
private static final SafeHtml INPUT_CHECKED = SafeHtmlUtils.fromSafeConstant("<input type=\"checkbox\" tabindex=\"-1\" checked/>");
/**
* An html string representation of an unchecked input box.
*/
private static final SafeHtml INPUT_UNCHECKED = SafeHtmlUtils.fromSafeConstant("<input type=\"checkbox\" tabindex=\"-1\"/>");
private static final SafeHtml INPUT_CHECKED_DISABLED = SafeHtmlUtils.fromSafeConstant("<input type=\"checkbox\" tabindex=\"-1\" checked disabled=\"disabled\"/>");
private static final SafeHtml INPUT_UNCHECKED_DISABLED = SafeHtmlUtils.fromSafeConstant("<input type=\"checkbox\" tabindex=\"-1\" disabled=\"disabled\"/>");
/** You'd copy the rest of the code from CheckboxCell, or implement the other required functions yourself **/
@Override
public void render(Context context, MyType value, SafeHtmlBuilder sb) {
// Get the view data.
Object key = context.getKey();
MyType viewData = getViewData(key);
if (viewData != null && viewData.equals(value)) {
clearViewData(key);
viewData = null;
}
MyType relevantValue = viewData != null ? viewData : value;
boolean checked = relevantValue.shouldBeChecked();
boolean enabled = relevantValue.shouldBeEnabled();
if (checked && !enabled)) {
sb.append(INPUT_CHECKED_DISABLED);
} else if (!checked && !enabled) {
sb.ap
answered 2011-05-22T18:55:54.803