package info.bukova.isspst.ui;

import info.bukova.isspst.StringUtils;

import org.zkoss.bind.BindContext;
import org.zkoss.bind.Converter;
import org.zkoss.zk.ui.Component;

public class BoolConverter implements Converter<String, Boolean, Component>
{
	@Override
	public Boolean coerceToBean(String str, Component component, BindContext cx)
	{
		return false;
	}

	@Override
	public String coerceToUi(Boolean val, Component component, BindContext cx)
	{
		if (val == null)
		{
			val = new Boolean(false);
		}

		return StringUtils.localize(val.toString());
	}
}
