<?xml version="1.0" encoding="UTF-8"?>
<f:root 
	xmlns:f="http://ajax4jsf.org/cdk/template" 
	xmlns:c=" http://java.sun.com/jsf/core" 
	xmlns:ui=" http://ajax4jsf.org/cdk/ui"
	xmlns:u=" http://ajax4jsf.org/cdk/u"
	xmlns:x=" http://ajax4jsf.org/cdk/x"
	xmlns:h=" http://ajax4jsf.org/cdk/h"
	xmlns:vcp=" http://ajax4jsf.org/cdk/vcp"
	class="org.richfaces.renderkit.html.TreeRenderer"
	baseclass="org.richfaces.renderkit.TreeRendererBase"
	component="org.richfaces.component.UITree" 
	>
	<h:styles>css/tree.xcss</h:styles>

	<h:scripts>
		new org.ajax4jsf.javascript.PrototypeScript(),
		new org.ajax4jsf.javascript.AjaxScript(),
		/org/richfaces/renderkit/html/scripts/utils.js,
		/org/ajax4jsf/javascript/scripts/form.js,
		/org/richfaces/renderkit/html/scripts/form.js,
		/org/richfaces/renderkit/html/scripts/events.js,
		/org/richfaces/renderkit/html/scripts/tree.js,
		/org/richfaces/renderkit/html/scripts/tree-selection.js,
		/org/richfaces/renderkit/html/scripts/tree-item.js,
		/org/richfaces/renderkit/html/scripts/tree-item-dnd.js,
		/org/richfaces/renderkit/html/scripts/drag-indicator.js,
		/org/richfaces/renderkit/html/scripts/browser_info.js	
	</h:scripts>

	<f:clientId var="clientId" />
	
	<jsp:scriptlet>
		<![CDATA[org.richfaces.component.util.FormUtil.throwEnclFormReqExceptionIfNeed(context,component);]]>
    </jsp:scriptlet>

	<div id="#{clientId}"
		style="#{component.attributes['style']}" class="dr-tree rich-tree #{component.attributes['styleClass']}">
		
	<f:call name="encodeAttributeParameters" />

	<f:call name="writeNamespace" />
	
	<f:call name="utils.encodePassThruWithExclusions">
        <f:parameter value="id,style,class,rows"/>
    </f:call>

	<vcp:body />
	
	<f:call name="encodeSelectionStateInput" />
	<f:clientId var="clientId" />
	<script type="text/javascript">
		var #{this:getJavaScriptVarName(context, component)} =
		new Tree("#{clientId}", "#{clientId}:input", "#{component.switchType}",
		{
			onselect: "#{component.attributes['onselected']}", 
			onexpand: "#{component.attributes['onexpand']}", 
			oncollapse: "#{component.attributes['oncollapse']}" 
		},
		function(event) {
			#{this:getAjaxScript(context, component)}
		},
		#{component.toggleOnClick},
		#{component.showConnectingLines}
		);
		#{this:getScriptContributions(context, component)}
	</script> 
	<div id="#{clientId}:script" class="dr-tree-h-script">
		<script type="text/javascript">
		</script>
	</div>
	</div>
</f:root>
