package com.jxml.quick.tf;
import com.jxml.quick.*;
import com.jxml.quick.access.*;
import java.beans.*;
import java.lang.reflect.*;

public class QListFieldTF extends QListPropertyTF
{
    public Object create(QContext context)
	throws QPE
    {
	return new QListFieldAccess();
    }

    public boolean isInstance(Object object, QContext context)
    {
	return object instanceof QListFieldAccess;
    }

    public String getText(Object object, 
			  QContext context)
	throws QPE
    {
	return ((QListFieldAccess)object).field;
    }

    public void add(Object object, 
		    String name, 
		    String text,
		    QAccess access,
		    Object parent,
		    QTargetFactory parentFactory,
		    QContext context)
	throws QPE
    {
	if (!isInstance(object,context))
	    context.throwPE("Class mismatch: "+text);
	QListFieldAccess pa=(QListFieldAccess)object;
	pa.field=text;
	if (parent==null)
	    context.doc.setRoot(object);
	else
	    access.add(parent,parentFactory,object,context);
    }
}
