package info.bukova.isspst.ui.renderers;

import info.bukova.isspst.data.Order;

import org.zkoss.zul.Listbox;
import org.zkoss.zul.Listitem;

@SuppressWarnings("serial")
public class OrderCreatedItemRenderer extends GenericListitemRenderer<Order>
{
	@Override
	protected void changeProperties(Listbox lb, Listitem li, int index, String varnm)
	{
		Order order = this.getObjectOfStates();

		boolean objednano = order.isOrdered();

		boolean doruceno = (order.getDeliveredDate() != null);

		if (doruceno)
		{
			li.setSclass("order-select-delivered");
		}
		else if (objednano)
		{
			li.setSclass("order-select-ordered");
		}
	}
}
