/*
 * HtmlCheckBoxEditor.java
 *
 * Created on October 18, 2000, 2:53 PM
 */

package ovt.servlet;

import ovt.beans.*;

import java.io.*;

/**
 * THIS CLASS IS A FAKE!!!! IT IS NO TT WORKING!!!!
 * @author  ko
 * @version 
 */
public class HtmlCheckBoxEditor extends HtmlPropertyEditor {

    /** Creates new HtmlCheckBoxEditor */
    public HtmlCheckBoxEditor(BasicPropertyDescriptor desc) {
        super(desc);
    }

    public String toString() {
        String res="";
        String[] tags = getEd().getTags();
        res = "<INPUT TYPE=\"checkbox\" NAME=\""+ 
                getEd().getPropertyDescriptor().getPropertyPathString()+"\" VALUE=\"" +
                
                ( isChecked() ? "CHECKED" : "") + " >" + 
                getEd().getPropertyName();
        return res;
    }
    
    public boolean isChecked() {
      return((Boolean)getEd().getValue()).booleanValue();
    }
}