<mvc:View
	class="sapUiSizeCompact"
	controllerName="sap.ui.core.internal.samples.odata.v2.TreeTable.Main"
	height="100%"
	xmlns="sap.m"
	xmlns:core="sap.ui.core"
	xmlns:dnd="sap.ui.core.dnd"
	xmlns:form="sap.ui.layout.form"
	xmlns:mvc="sap.ui.core.mvc"
	xmlns:t="sap.ui.table">
<App>
	<Page id="page" floatingFooter="true" showHeader="false">
		<content>
			<Panel expandable="true" expanded="false" width="auto">
				<headerToolbar>
					<Toolbar>
						<Title id="settingsTitle" level="H2" text="Tree Table Configuration" />
					</Toolbar>
				</headerToolbar>
				<content>
					<form:SimpleForm ariaLabelledBy="settingsTitle" backgroundDesign="Translucent"
						columnsM="3" editable="true" labelSpanM="2" layout="ResponsiveGridLayout">
						<core:Title text="Binding Parameters" />
						<Label text="Expanded Levels" />
						<Input value="{
							constraints : {minimum : 0},
							path : 'ui>/expandedLevels',
							type : 'sap.ui.model.type.Integer'
						}" width="5em" />
						<Label text="Restore Tree State" />
						<CheckBox selected="{ui>/restoreState}" />
						<core:Title text="Model Parameters" />
						<Label text="Refresh After Change" />
						<CheckBox selected="{ui>/refreshAfterChange}" />
					</form:SimpleForm>
				</content>
			</Panel>
			<t:TreeTable id="treetable" rowMode="Auto" selectionBehavior="Row"
				selectionMode="Single" rowSelectionChange="onRowSelection" threshold="10">
				<t:extension>
					<Toolbar>
						<Title level="H1" text="Items" />
						<ToolbarSpacer width="3em" />
						<Button enabled="{ui>/rowSelected}" icon="sap-icon://add" press=".onCreate"
							tooltip="Create Item" />
						<Button enabled="{ui>/rowSelected}" icon="sap-icon://delete"
							press=".onDelete" tooltip="Delete Item" />
						<Button enabled="{ui>/rowSelected}" icon="sap-icon://scissors"
							press=".onCut" tooltip="Cut" />
						<Button enabled="{ui>/rowSelected}" icon="sap-icon://paste"
							press=".onPaste" tooltip="Paste" />
						<Button enabled="{ui>/tableBound}" icon="sap-icon://expand"
							press="onExpandAll" tooltip="Expand All" />
						<Button enabled="{ui>/tableBound}" icon="sap-icon://collapse"
							press="onCollapseAll" tooltip="Collapse All" />
						<ToolbarSpacer width="3em" />
						<Label labelFor="filterCreator" text="Filter by Creator" />
						<SearchField id="filterCreator" search=".onFilterByCreator"
							tooltip="Filter by Creator" value="{ui>/createdByFilter}"
							width="15rem" />
						<ToolbarSpacer width="3em" />
						<Button enabled="{ui>/tableBound}" icon="sap-icon://save" press=".onSave"
							tooltip="Save" />
						<Button enabled="{ui>/tableBound}" icon="sap-icon://refresh"
							press=".onRefresh" tooltip="Refresh" />
						<Button enabled="{ui>/tableBound}" icon="sap-icon://reset"
							press=".onReset" tooltip="Reset Changes" />
						<CheckBox editable="false" selected="{ui>/pendingChanges}"
							text="Pending Changes" />
						<ToolbarSpacer />
						<Button text="Go" press=".onBindTable" type="Emphasized" />
					</Toolbar>
				</t:extension>
				<t:dragDropConfig>
					<dnd:DragDropInfo dragStart="onDragStart" drop="onDrop" sourceAggregation="rows"
						targetAggregation="rows" />
				</t:dragDropConfig>
				<t:columns>
					<t:Column width="20rem">
						<Label text="{/#ErhaOrderItemType/ErhaOrderItem/@sap:label}" />
						<t:template>
							<Input editable="false" value="{ErhaOrderItem}" />
						</t:template>
					</t:Column>
					<t:Column width="15rem">
						<Label text="{/#ErhaOrderItemType/ErhaOrderItemName/@sap:label}" />
						<t:template>
							<Input value="{ErhaOrderItemName}" />
						</t:template>
					</t:Column>
					<t:Column width="10rem">
						<Label text="{/#ErhaOrderItemType/ParentItem/@sap:label}" />
						<t:template>
							<Input editable="false" value="{ParentItem}" />
						</t:template>
					</t:Column>
					<t:Column width="10rem">
						<Label text="{/#ErhaOrderItemType/CreatedByUser/@sap:label}" />
						<t:template>
							<Input editable="false" value="{CreatedByUser}" />
						</t:template>
					</t:Column>
					<t:Column width="10rem">
						<Label text="{/#ErhaOrderItemType/CreationDateTime/@sap:label}" />
						<t:template>
							<Input editable="false" value="{
								formatOptions : {style : 'short'},
								path : 'CreationDateTime',
								type : 'sap.ui.model.odata.type.DateTimeOffset'
							}" />
						</t:template>
					</t:Column>
					<!-- technical properties annotated with tree annotations -->
					<t:Column width="7rem">
						<Label text="Node" />
						<t:template>
							<Input editable="false" value="{HierarchyNode}" />
						</t:template>
					</t:Column>
					<t:Column width="7rem">
						<Label text="Parent Node" />
						<t:template>
							<Input editable="false" value="{HierarchyParentNode}" />
						</t:template>
					</t:Column>
					<t:Column width="5rem">
						<Label text="Level" />
						<t:template>
							<Input editable="false" value="{HierarchyDistanceFromRoot}" />
						</t:template>
					</t:Column>
					<t:Column width="7rem">
						<Label text="# Descendant" />
						<t:template>
							<Input editable="false" value="{HierarchyDescendantCount}" />
						</t:template>
					</t:Column>
					<t:Column width="7rem">
						<Label text="Server State" />
						<t:template>
							<Input editable="false" value="{HierarchyDrillState}" />
						</t:template>
					</t:Column>
					<t:Column width="7rem">
						<Label text="Preorder Rank" />
						<t:template>
							<Input editable="false" value="{HierarchyPreorderRank}" />
						</t:template>
					</t:Column>
					<t:Column width="7rem">
						<Label text="Sibling Rank" />
						<t:template>
							<Input editable="false" value="{HierarchySiblingRank}" />
						</t:template>
					</t:Column>
				</t:columns>
			</t:TreeTable>
			<VBox>
				<dependents>
					<Dialog contentWidth="50%" id="messageDetails" title="Message Details">
						<buttons>
							<Button press="onCloseMessageDetails" text="Close"
								tooltip="Close the message details dialog" type="Emphasized" />
						</buttons>
						<form:SimpleForm editable="false" layout="ResponsiveGridLayout">
							<Label text="Message ID" />
							<Text text="{messages>id}" />
							<Label text="Type" />
							<Text text="{messages>type}" />
							<Label text="Message" />
							<Text text="{messages>message}" />
							<Label text="Additional Text" />
							<Text text="{messages>additionalText}" />
							<Label text="Description" />
							<Text text="{messages>description}" />
							<Label text="Technical" />
							<Text text="{messages>technical}" />
							<Label text="Persistent" />
							<Text text="{messages>persistent}" />
							<Label text="Code" />
							<Text text="{messages>code}" />
							<Label text="Target" />
							<Text id="target::messageDetails" text="{
									formatter : '.formatMessageTargets',
									path : 'messages>aTargets'
								}" />
							<Label text="Full Target" />
							<Text id="fullTarget::messageDetails" text="{
									formatter : '.formatMessageTargets',
									path : 'messages>aFullTargets'
								}" />
						</form:SimpleForm>
					</Dialog>
					<Dialog contentWidth="50%" id="createItem" title="Create Item" type="Message">
						<beginButton>
							<Button press="onCreateItem" text="OK" />
						</beginButton>
						<endButton>
							<Button press="onCancelCreateItem" text="Cancel" />
						</endButton>
						<content>
							<Label text="Item Name" />
							<Input id="newItemName" value="" />
						</content>
					</Dialog>
					<SelectDialog confirm=".onInsertFromClipboard" id="pasteDialog"
						items="{clipboard>/nodes}" noDataText="No Items found"
						title="Select an Item to re-insert">
						<StandardListItem description="Removed Item" icon="sap-icon://tree"
							title="{clipboard>key}" type="Active" />
					</SelectDialog>
				</dependents>
			</VBox>
		</content>
		<footer>
			<OverflowToolbar>
				<Button icon="sap-icon://message-popup" id="messagePopoverButton"
					press="onMessagePopoverPress" text="{ui>/messageCount}" tooltip="Show Messages"
					type="Emphasized">
					<dependents>
						<MessagePopover afterClose="onMessagePopoverClosed" id="messagePopover"
							items="{
								events : {
									change : '.updateMessageCount'
								},
								path : 'messages>/'
							}">
							<MessageItem
								description="{
									formatter : '.formatMessageDescription',
									path : 'messages>'
								}"
								title="{messages>message}"
								type="{messages>type}">
								<Link binding="{messages>}" press="onShowMessageDetails"
									text="Technical Details" />
							</MessageItem>
						</MessagePopover>
					</dependents>
				</Button>
			</OverflowToolbar>
		</footer>
	</Page>
</App>
</mvc:View>