/*
 * Copyright (c) 2012-2014 Kaarle Ritvanen
 * See LICENSE file for license details
 */

define(
    [
	"aconf/type",
	"aconf/widget/inline",
	"aconf/widget/table/header",
	"aconf/widget/table/row"
    ],
    function(type, Base, TableHeader, TableRow) {
	return Base.extend({
	    render: function(data, meta) {
		this.header = true;
		Base.render.call(this, data, meta);
	    },
		    
	    widget: function(meta) {
		if (!type.isTreeNode(meta))
		    return Base.widget.call(this, meta);
		if (!this.header) return TableRow;
		this.header = false;
		return TableHeader;
	    }
	});
    }
);
