/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.elotech.websaude.integracao.cnes.ui;

import com.vaadin.data.Converter;
import com.vaadin.data.Result;
import com.vaadin.data.ValueContext;
import java.util.Locale;

/**
 *
 * @author elotech
 */

public class BooleanConverter implements Converter<String, Boolean>
{   

  public Class<Boolean> getModelType()
  {
    return Boolean.class;
  }

  public Class<String> getPresentationType()
  {
    return String.class;
  }

    @Override
    public Result<Boolean> convertToModel(String value, ValueContext context) {
        return null;
    }

    @Override
    public String convertToPresentation(Boolean value, ValueContext context) {
        return "<input type='checkbox' disabled='disabled'" + (value.booleanValue() ? " checked" : "") + " />";
    }
}
