package org.ovirt.engine.ui.common.widget.renderer;

import com.google.gwt.text.shared.AbstractRenderer;

public class BooleanRenderer extends AbstractRenderer<Boolean> {

    String trueText;
    String falseText;

    public BooleanRenderer() {
        super();
    }

    public BooleanRenderer(String trueText, String falseText) {
        this.trueText = trueText;
        this.falseText = falseText;
    }

    @Override
    public String render(Boolean bool) {
        if (trueText == null || falseText == null) {
            return bool.toString();
        }

        return bool != null && bool.booleanValue() ? trueText : falseText;
    }

}

@@ -456,15 +456,95 @@
 ean 
-bool) %7B
+valueToRender) %7B%0A        if (valueToRender == null) %7B%0A            return %22%22;%0A        %7D%0A
 %0A   
@@ -612,20 +612,29 @@
  return 
-bool
+valueToRender
 .toStrin
@@ -668,28 +668,21 @@
 urn 
-bool != null && bool
+valueToRender
 .boo

fix possible null exception in BooleanRenderer