/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.rjconsultores.ventaboletos.web.utilerias;

import org.zkoss.zul.Combobox;

import com.rjconsultores.ventaboletos.enums.TypeEventListener;

/**
 * 
 * @author gleimar
 */
public class MyComboboxEstandar extends Combobox { 

	private static final long serialVersionUID = 1L;

	public MyComboboxEstandar() {
		super();

		this.setAutodrop(true);
		this.setAutocomplete(true);
		this.setReadonly(true);
		this.setCtrlKeys("#del");

		this.addEventListener(TypeEventListener.ON_CTRL_KEY.getEvent(), new EventListenerOnCtrlKeyMyComboBoxEstandar(this));
	}

	public <T> T getSelecteObject(Class<T> cType) {
		if (this.getSelectedItem() != null) {
			return cType.cast(this.getSelectedItem().getValue());
		}
		return null;
	}

}
