AdfRichUIPeer.createPeerClass(AdfDhtmlTablePeer,"AdfDhtmlTreeTablePeer",!1);
AdfDhtmlTreeTablePeer.InitSubclass=function(){AdfRichUIPeer.addComponentPropertyChanges(this,AdfUITree.DISCLOSED_ROW_KEYS);this._NODE_IMAGE_ATTR="_afrDisImg";this._DISCLOSURE_ICON_ID="di";this.NODE_DEPTH_ATTR="_afrNdDth";this.TREE_FLAGS_ATTR="_afrTrFgs";this._COLLAPSED_NODE_KEY="af_tree.TIP_COLLAPSED_NODE";this._EXPANDED_NODE_KEY="af_tree.TIP_EXPANDED_NODE";this._TREE_TABLE_ICON_EXPANDED="af|treeTable::expanded-icon";this._TREE_TABLE_ICON_COLLAPSED="af|treeTable::collapsed-icon";this._TREE_TABLE_ICON_ANIM=
"af|treeTable::node-anim-icon";this._TREE_TABLE_ICON_LEAF="af|treeTable::leaf-icon";this._TREE_TABLE_ICON_STYLE_EXPANDED="af|treeTable::expanded-icon-style";this._TREE_TABLE_ICON_STYLE_COLLAPSED="af|treeTable::collapsed-icon-style";this._TREE_TABLE_ICON_STYLE_ANIM="af|treeTable::node-anim-icon-style";this._TREE_TABLE_ICON_STYLE_LEAF="af|treeTable::leaf-icon-style";this._TREE_TABLE_ICON_STYLE_SELECTOR="af|treeTable::selector-icon-style";this._NODE_STAMP_COLUMN="_afrNdCol";this._TREE_UP_MARKER="_afrTreeUp";
this._CLIENT_ANCESTOR_PATH="_afrAP";this._KEY_PATH_SEPARATOR="_";this._INDENT_PADDING=16;this._DEFAULT_FIRST_VISIBLE=0;this._DEFAULT_VISIBLE_ROWS=25;this._FIRST_VISIBLE_KEY="_afrFstVbl";this._VISIBLE_ROWS_KEY="_afrVblRws";this.READ_ONLY="_afrReadOnly";this._SELECTED_CLASS="p_AFSelected";this.NODE_COLLAPSE_ROW_MARGIN=5};AdfDhtmlTreeTablePeer.prototype.ComponentRemoved=function(a){this._getTreeUtils().removeContextMenuEventListeners(a);AdfDhtmlTreeTablePeer.superclass.ComponentRemoved.call(this,a)};
AdfDhtmlTreeTablePeer.prototype.getNodeStampColumn=function(){var a=this.__getVisibleLeafColumns();for(i=0;i<a.length;i++){var b=a[i];if(b.getProperty(AdfDhtmlTreeTablePeer._NODE_STAMP_COLUMN))return b}return null};AdfDhtmlTreeTablePeer.prototype._findRowKeyByIndexPath=function(a){AdfAssert.assertNonEmptyString(a);for(var b=null,d=this.GetDataBody().childNodes,e=0;e<d.length&&!b;e++){var f=d[e].rows;if(f)for(var g=0;g<f.length&&!b;g++){var h=f[g];a==h.getAttribute("_afrIP")&&(b=h.getAttribute(AdfDhtmlTableBasePeer._ROW_KEY))}}return b};
AdfDhtmlTreeTablePeer.prototype._findIndexPathByRowKey=function(a){AdfAssert.assertNonEmptyString(a);for(var b=null,d=this.GetDataBody().childNodes,e=0;e<d.length&&!b;e++){var f=d[e].rows;if(f)for(var g=0;g<f.length&&!b;g++){var h=f[g];a==h.getAttribute(AdfDhtmlTableBasePeer._ROW_KEY)&&(b=h.getAttribute("_afrIP"))}}return b};AdfDhtmlTreeTablePeer.prototype.__triggerSortEvent=function(a,b){this.queueSortEvent(this._currency,b)};
AdfDhtmlTreeTablePeer.prototype.queueSortEvent=function(a,b){var d=this.getComponent(),e=this.getNodeStampColumn();null!=e&&(e=e.getSortProperty(),null!=e&&(new AdfSortEvent(d,[e+("$afr$"+a)],[b])).queue())};
AdfDhtmlTreeTablePeer.prototype.AutoPPRBlockReceived=function(a){a=AdfAgent.AGENT.getAttribute(a,"_autoPPRDiscUpdate",null);if(null!=a&&(a=a.split(":"),2==a.length)){var b=this._getDisclosureImageFromRowKey(a[1]);if(b){var d=this.FindRowByKey(a[1]),d=d?d.tr:null;switch(a[0]){case "exp":this._setDisclosureIcon(b,!0,d);break;case "clp":this._setDisclosureIcon(b,!1,d);break;case "lf":this._setLeafIcon(b)}}}};
AdfDhtmlTreeTablePeer.prototype.SetFirst=function(a){this.getComponent().setProperty(AdfDhtmlTreeTablePeer._FIRST_VISIBLE_KEY,a,!1,!0);var b=this.GetAssociatedComponent();null!=b&&b.setProperty(AdfDhtmlTreeTablePeer._FIRST_VISIBLE_KEY,a,!1,!0)};AdfDhtmlTreeTablePeer.prototype.SetRows=function(a){this.getComponent().setProperty(AdfDhtmlTreeTablePeer._VISIBLE_ROWS_KEY,a,!1,!0)};
AdfDhtmlTreeTablePeer.prototype.HandleComponentKeyDown=function(a){if(!this.isDisclosureFetchPending()){var b=a.getNativeEvent(),d=b.ctrlKey,e=b.shiftKey,f=AdfAgent.AGENT,g=f.getEventTarget(b),h=b.keyCode,k=this.getComponent(),l=k.getClientId(),m=this._getTreeUtils();switch(h){default:AdfDhtmlTreeTablePeer.superclass.HandleComponentKeyDown.call(this,a);break;case 54:!m.isSelectorPopupVisible()&&d&&e?(k=AdfRichUIPeer.CreateSubId(l,AdfTreeUtils._SELECTOR_ICON_ID),AdfAgent.AGENT.getElementById(k)&&(m.showSelectorPopup(),
f.eatEvent(b))):AdfDhtmlTreeTablePeer.superclass.HandleComponentKeyDown.call(this,a);break;case AdfKeyStroke.ARROWDOWN_KEY:m.isSelectorPopupVisible()?m.selectSelectorPopupItem(!0):AdfDhtmlTreeTablePeer.superclass.HandleComponentKeyDown.call(this,a);break;case AdfKeyStroke.ARROWUP_KEY:m.isSelectorPopupVisible()?m.selectSelectorPopupItem(!1):AdfDhtmlTreeTablePeer.superclass.HandleComponentKeyDown.call(this,a);break;case AdfKeyStroke.ENTER_KEY:if(m.isSelectorPopupVisible()){if(b=m.getSelectorSelectedRowKey())m.hideSelectorPopup(),
AdfFocusEvent.queue(k,b)}else this._isDisclosure(g)&&!this.BusyAnimating()?this.HandleDisclosure(g):AdfDhtmlTreeTablePeer.superclass.HandleComponentKeyDown.call(this,a)}}};
AdfDhtmlTreeTablePeer.prototype.HandleComponentMouseDown=function(a){if(!this.isDisclosureFetchPending()){var b=AdfAgent.AGENT,d=a.getNativeEvent(),e=b.getEventTarget(d);b.isLeftButton(d)?this._isDisclosure(e)&&!this.BusyAnimating()?this.HandleDisclosure(e):AdfDhtmlTreeTablePeer.superclass.HandleComponentMouseDown.call(this,a):AdfDhtmlTreeTablePeer.superclass.HandleComponentMouseDown.call(this,a)}};
AdfDhtmlTreeTablePeer.prototype.HandleDisclosure=function(a){var b=this.GetRowKeyAndRow(a,this.getDomElement());if(null!=b&&(a=b[0],b=b[1],!this.isLeaf(a))){var d=this.getComponent(),e=d.isPathExpanded(a),f=this._getDisclosureImageFromRowKey(a),g=AdfPage.PAGE.getLookAndFeel(),h=this.GetIconStyleNames(d),g=g.getStyleClass(h.anim);f.className=g;if(f=this._getDisclosureIcon(f))g=this.GetIconNames(d),AdfDomUtils.swapIcon(f,g.anim);d.setDisclosedRowKey(a,!e);this._setRowHeaderFocus(a)||this.UpdateFocusManager(AdfDhtmlTableBasePeer._TABLE_BODY_FOCUS_TYPE,
a,b)}};AdfDhtmlTreeTablePeer.prototype.HandleComponentClick=function(a){var b=AdfAgent.AGENT,d=a.getNativeEvent(),e=b.getEventTarget(d),f=this._getTreeUtils(),g=null,h=this.getComponent();f.getParentWithAttribute(e,AdfTreeUtils.SELECTOR_IMAGE_ATTR,1)?(f.showSelectorPopup(),b.eatEvent(d)):null!=(g=f.getSelectorItemRowKey(d,e))?(f.hideSelectorPopup(),AdfFocusEvent.queue(h,g)):this._isDisclosure(e)||AdfDhtmlTreeTablePeer.superclass.HandleComponentClick.call(this,a)};
AdfDhtmlTreeTablePeer.prototype._setRowHeaderFocus=function(a){var b=!1,d=this.FindRowByKey(a);if(d&&(d=this.GetRowHeaderCellFromRow(d.tr)))this.UpdateFocusManager(AdfDhtmlTableBasePeer._ROW_HEADER_FOCUS_TYPE,a,d),b=!0;return b};
AdfDhtmlTreeTablePeer.prototype._setDisclosureIcon=function(a,b,d){if(a){var e=AdfPage.PAGE.getLookAndFeel(),f=this.GetIconStyleNames(this.getComponent()),g=e.getStyleClass(f.expanded),f=e.getStyleClass(f.collapsed);a.className=b?g:f;e=b?e.getTranslatedString(AdfDhtmlTreeTablePeer._EXPANDED_NODE_KEY):e.getTranslatedString(AdfDhtmlTreeTablePeer._COLLAPSED_NODE_KEY);a.title=e;if(a=this._getDisclosureIcon(a))e=this.GetIconNames(this.getComponent()),AdfDomUtils.swapIcon(a,b?e.expanded:e.collapsed);d&&
d.setAttribute("aria-expanded",b?"true":"false")}};AdfDhtmlTreeTablePeer.prototype._setLeafIcon=function(a){if(a){var b=AdfPage.PAGE.getLookAndFeel(),d=this.GetIconStyleNames(this.getComponent()),b=b.getStyleClass(d.leaf);a.className=b;a.title="";if(a=this._getDisclosureIcon(a))b=this.GetIconNames(this.getComponent()),AdfDomUtils.swapIcon(a,b.leaf)}};
AdfDhtmlTreeTablePeer.prototype.ComponentDisclosedRowKeysChanged=function(a,b,d,e){AdfDhtmlTreeTablePeer.superclass.ComponentDisclosedRowKeysChanged.call(this,a,b,d,e);this._getTreeUtils().setAssociatedDisclosedRowKeys(d,e);(a=this.GetPanelCollectionPeer())&&a.updateRowSelectionContext();return!0};AdfDhtmlTreeTablePeer.prototype._getTotalRemovedHeight=function(a){var b=0,d;for(d in a)(a=this._findChildList(d,!1))&&(b+=a.height);return b};
AdfDhtmlTreeTablePeer.prototype.HandleComponentCollapseEvent=function(a){var b=this.getComponent();if("page"==b.getProperty("scrollPolicy"))AdfPage.PAGE.addPartialTargets(b);else if(!b.getProperty(AdfDhtmlTreeTablePeer.READ_ONLY)||this.isHeightAutoSized())AdfDhtmlTreeTablePeer.superclass.HandleComponentCollapseEvent.call(this,a);else{var d=this.GetDataBody(),e=d.childNodes,e=e[e.length-1],e=e.startPos+e.cachedHeight-this._currentScrollTop,d=d.offsetHeight,f=this._getTotalRemovedHeight(a),e=e-f;if(e<
d&&this._canvasHeight>d){b=(d-e)/this._averageRowHeight;b=Math.ceil(b);b+=AdfDhtmlTreeTablePeer.NODE_COLLAPSE_ROW_MARGIN;a=this._findLastTokenAfterCollapse(a);var g=this._queueFetchEvent(!1,AdfTableDataFetchEvent.COLLAPSE_SUBTYPE);g&&(g.setFillRows(b),g.setLastClientKey(a),AdfDhtmlTableBasePeer.SetCursor(this.GetDataBody(),"wait"))}else{d=null!=b.getProperty(AdfUITree.DISCLOSURE_LISTENER_KEY);f=b.getProperty(AdfUITree.LOCAL_DISCLOSURE_STATE);e={};AdfCollections.copyInto(e,f);for(g in a)f=this.FindRowByKey(g).tr.getAttribute(AdfDhtmlTreeTablePeer._CLIENT_ANCESTOR_PATH)+
"_"+g,this._isParentInSet(a,f)||(d||(e[g]=!0),this._removeChildNodes(g,!0));b.setProperty(AdfUITree.LOCAL_DISCLOSURE_STATE,e,!1,AdfUIComponent.PROPAGATE_ALWAYS)}}};AdfDhtmlTreeTablePeer.prototype.HandleComponentExpandEvent=function(a){var b=this.getComponent();"page"==b.getProperty("scrollPolicy")?AdfPage.PAGE.addPartialTargets(b):AdfDhtmlTreeTablePeer.superclass.HandleComponentExpandEvent.call(this,a)};
AdfDhtmlTreeTablePeer.prototype._removeChildNodes=function(a,b){var d=this._findChildList(a,!1);if(d){var e=this.GetRowCount(),f=this.getDomElement().ownerDocument,g=d.end-d.start+1,f=f.createElement("table"),d=this.FindRowByKey(a).index;f.setAttribute("totalRemoved",g);f.setAttribute("_parentKey",a);f.setAttribute("_startRow",d,null);f.setAttribute("_rowCount",e-g,null);e=AdfPage.PAGE;g=e.isAnimationEnabled();e.setAnimationEnabled(b);this.HandleCollapse(f,d,0);e.setAnimationEnabled(g)}};
AdfDhtmlTreeTablePeer.prototype.HandleAutoPPRRemove=function(a){this.getComponent();var b=AdfAgent.AGENT.getAttribute(a,"_parentKey",null);b&&this._removeChildNodes(b,!1);return AdfDhtmlTreeTablePeer.superclass.HandleAutoPPRRemove.call(this,a)};AdfDhtmlTreeTablePeer.prototype.BeginHandleDataBlocks=function(){this.getComponent().setProperty(AdfUITree.LOCAL_DISCLOSURE_STATE,{},!1,AdfUIComponent.PROPAGATE_ALWAYS)};AdfDhtmlTreeTablePeer.prototype._isChildOf=function(a,b){return-1!=b.indexOf(a+"_")};
AdfDhtmlTreeTablePeer.prototype._isParentInSet=function(a,b){for(var d in a)if(this._isChildOf(d,b))return!0;return!1};AdfDhtmlTreeTablePeer.prototype._findLastTokenAfterCollapse=function(a){for(var b=this.GetDataBody().childNodes,d=b.length-1;0<=d;d--)for(var e=b[d].rows,f=e.length-1;0<=f;f--){var g=e[f],h=g.getAttribute(AdfDhtmlTableBasePeer._ROW_KEY),g=g.getAttribute(AdfDhtmlTreeTablePeer._CLIENT_ANCESTOR_PATH)+"_"+h;if(!this._isParentInSet(a,g))return h}return null};
AdfDhtmlTreeTablePeer.prototype._isDisclosure=function(a){var b=AdfPage.PAGE.getLookAndFeel(),d=this.GetIconStyleNames(this.getComponent()),e=b.getStyleClass(d.expanded),f=b.getStyleClass(d.anim),g=b.getStyleClass(d.collapsed),b=b.getStyleClass(d.leaf),d=a.className;if(0<=d.indexOf(e)||0<=d.indexOf(g)||0<=d.indexOf(b)||0<=d.indexOf(f))return!0;a=a.parentNode.className;return 0<=a.indexOf(e)||0<=a.indexOf(g)||0<=a.indexOf(b)};
AdfDhtmlTreeTablePeer.prototype._getDisclosureIcon=function(a){var b=AdfAgent.getAgent();return null!=a.firstChild&&(a=a.firstChild,b=b.getNodeName(a).toLowerCase(),"img"==b||"span"==b||"#text"==b)?a:null};
AdfDhtmlTreeTablePeer.prototype.isLeaf=function(a){var b=null;a=this.FindRowByKey(a);null!=a&&(b=a.tr);if(null!=b&&(b=this._getNodeStampCell(b),null!=b&&(b=this._getDisclosureIconInCell(b),null!=b))){a=AdfPage.PAGE.getLookAndFeel();var d=this.GetIconStyleNames(this.getComponent());a=a.getStyleClass(d.leaf);return 0<=b.className.indexOf(a)}return!1};AdfDhtmlTreeTablePeer.prototype.isSelectorIconVisible=function(){return this._getTreeUtils().isSelectorIconVisible()};
AdfDhtmlTreeTablePeer.prototype.getDepth=function(a){var b=AdfAgent.AGENT,d=-1;if(a=this._getDisclosureImageFromRowKey(a))a=a.parentNode,"SPAN"==a.tagName&&(d=b.getIntAttribute(a,AdfDhtmlTreeTablePeer.NODE_DEPTH_ATTR,-1));return d};AdfDhtmlTreeTablePeer.prototype.isMultiRoot=function(){return this._getTreeUtils().isMultiRoot()};AdfDhtmlTreeTablePeer.prototype.hasPathStamp=function(){return this._getTreeUtils().hasPathStamp()};
AdfDhtmlTreeTablePeer.prototype._getNodeStampCell=function(a){for(var b=AdfAgent.AGENT,d=this.GetDataBody(),b=b.getIntAttribute(d,AdfDhtmlTableBasePeer._COL_COUNT,-1),d=a.cells,b=0<=b?b:d.length,e=0;e<b;e++){var f=0<=this._lastFrozen&&e>this._lastFrozen?this._getInnerTableCell(a,e):d[e];if(this.IsNodeStampCell(f))return f}return null};AdfDhtmlTreeTablePeer.prototype.IsNodeStampCell=function(a){return AdfAgent.AGENT.getAttribute(a,AdfDhtmlTreeTablePeer._NODE_STAMP_COLUMN)};
AdfDhtmlTreeTablePeer.prototype._getDisclosureIconInCell=function(a){var b=AdfAgent.AGENT;a=a.getElementsByTagName("SPAN");for(var d=a.length,e=0;e<d;e++)if(void 0!=b.getAttribute(a[e],AdfDhtmlTreeTablePeer._NODE_IMAGE_ATTR))for(var f=a[e],g=f.childNodes.length,h=0;h<g;h++){var k=f.childNodes[h];if(1==k.nodeType&&this._isDisclosure(k))return k}return null};AdfDhtmlTreeTablePeer.prototype._getDisclosureImageFromRowKey=function(a){return document.getElementById(this._getDisclosureImageId(a))};
AdfDhtmlTreeTablePeer.prototype._getDisclosureImageId=function(a){a=this.getComponent().getClientId()+":"+a;return AdfRichUIPeer.CreateSubId(a,AdfDhtmlTreeTablePeer._DISCLOSURE_ICON_ID)};AdfDhtmlTreeTablePeer.prototype.GetRowContextMenuId=function(a){var b=this.getComponent(),d=b.getContextMenuId();if(d)return d;var d=this.isLeaf(a),e=b.isPathExpanded(a),f=this.isMultiRoot(),g=this.getDepth(a),h=this._getTreeUtils();a=a==b.getFocusRowKey();return h.setupDefaultRowContextMenu(d,e,g,f,a).getClientId()};
AdfDhtmlTreeTablePeer.prototype.HandleRowContextMenu=function(a,b,d,e,f){this._saveCurrency(b);AdfDhtmlTreeTablePeer.superclass.HandleRowContextMenu.call(this,a,b,d,e,f)};
AdfDhtmlTreeTablePeer.prototype.ContextMenuOpened=function(a,b){var d=this.getComponent(),e=this._currency,f=this._getTreeUtils();if(e){f.addContextMenuEventListeners();var g=this.isLeaf(e),h=d.isPathExpanded(e),k=this.isMultiRoot(),l=this.getDepth(e),m=d.getContextMenuSelect(),d=e==d.getFocusRowKey();f.updateContextMenu(g,h,l,k,m,d)}};AdfDhtmlTreeTablePeer.prototype.ContextMenuClosed=function(a,b){this._getTreeUtils().clearCachedContextMenuItems()};
AdfDhtmlTreeTablePeer.prototype._saveCurrency=function(a){this._currency=a};AdfDhtmlTreeTablePeer.prototype._clearCurrency=function(){this._currency=null};AdfDhtmlTreeTablePeer.prototype.__getCurrency=function(){return this._currency};AdfDhtmlTreeTablePeer.prototype.showAsTop=function(a){var b=this.getComponent();AdfFocusEvent.queue(b,a)};AdfDhtmlTreeTablePeer.prototype.goUp=function(){var a=this.getComponent();AdfFocusEvent.queue(a,AdfDhtmlTreeTablePeer._TREE_UP_MARKER)};
AdfDhtmlTreeTablePeer.prototype.discloseAll=function(a,b){var d=this.getComponent();AdfDhtmlTableBasePeer.SetCursor(this.GetDataBody(),"wait");!b&&(!a||0==a.length)&&d.setProperty("scrollTopRowKey",null,!0,AdfUIComponent.PROPAGATE_ALWAYS);AdfTreeExpandAllEvent.queue(d,a,b);d=AdfPage.PAGE.getLookAndFeel().getTranslatedString("af_table.LABEL_FETCHING");this.DisplayStatus(d,!0)};
AdfDhtmlTreeTablePeer.prototype.InsertActiveRow=function(a,b){var d="insertAfter"!=b,e="";this.IsEmpty||(blocks=this.GetDataBody().childNodes);if(blocks&&0<blocks.length){var f=-1,g=0,e=a.rKey,h=a.iKey,k=null;if(h){var l=this.FindRowByKey(h);if(l)if("insertInside"==b)d=this._getDisclosureImageFromRowKey(h),this.getComponent().isPathExpanded(h)?(f=l.index+1,g=this._getNodeStampDepth(h)+1,k=(k=l.tr.getAttribute(AdfDhtmlTreeTablePeer._CLIENT_ANCESTOR_PATH))?k+AdfDhtmlTreeTablePeer._KEY_PATH_SEPARATOR+
h:h,this.isLeaf(h)&&(d?this._setDisclosureIcon(d,!0,l.tr):this._updateDisclosureIconInLeaf(h,!0))):d&&this._setDisclosureIcon(d,!1,l.tr);else{g=0;if(this.getComponent().isPathExpanded(h)&&(f=this._findChildList(h,!1)))g=f.count;f=d?l.index:l.index+1+g;g=this._getNodeStampDepth(h);k=l.tr.getAttribute(AdfDhtmlTreeTablePeer._CLIENT_ANCESTOR_PATH)}}else d?(h=blocks[blocks.length-1],l=this.GetRowCount(),-1!=l&&h.startRow+h.numRows==l&&(f=l)):0==blocks[0].startRow&&(f=0);-1!=f&&this.IsInsertAllowed(f)?
(h=this.GetTemplateRow(blocks),f=this.InsertClonedRow(h,f,e),k&&f.setAttribute(AdfDhtmlTreeTablePeer._CLIENT_ANCESTOR_PATH,k),this._resetTreeRow(f,g,e),this.InsertClonedComponents(h,e),e=this.UpdateActiveRow(a).rerender):e=AdfDhtmlTableBasePeer.RERENDER_CONTAINER_CHILDREN}else e=AdfDhtmlTableBasePeer.RERENDER_CONTAINER;g=this.GetActiveRowText(a.rKey,b);return{rerender:e,updates:g}};
AdfDhtmlTreeTablePeer.prototype._updateDisclosureIconInLeaf=function(a,b){var d=null,e=this.FindRowByKey(a);null!=e&&(d=e.tr);if(null!=d&&(e=this._getNodeStampCell(d),null!=e))for(var f=e.getElementsByTagName("SPAN"),g=f.length,e=AdfPage.PAGE.getLookAndFeel(),h=this.GetIconStyleNames(this.getComponent()),e=e.getStyleClass(h.leaf),h=AdfAgent.AGENT,k=0;k<g;k++)if(void 0!=h.getAttribute(f[k],AdfDhtmlTreeTablePeer._NODE_IMAGE_ATTR)){f=f[k];g=f.childNodes.length;for(h=0;h<g;h++)if(k=f.childNodes[h],k.className&&
0<=k.className.indexOf(e)){f.removeChild(k);e=f.ownerDocument.createElement("a");e.id=this._getDisclosureImageId(a);e.onclick="return false";e.href="#";f.appendChild(e);this._setDisclosureIcon(e,b,d);break}break}};
AdfDhtmlTreeTablePeer.prototype.RemoveActiveRow=function(a){if(this.IsEmpty)return{rerender:!1,updates:""};var b="",d=a.rKey;if(a=this._findChildList(d,!0)){var e=this.FindRowByKey(d),f=null;e&&(f=e.tr,b=this.GetActiveRowText(d,"remove"),f=f.getAttribute(AdfDhtmlTreeTablePeer._CLIENT_ANCESTOR_PATH));e=a.end-a.start+1;d=[];this.DeleteBlock(a.start,e,e,0,d);for(a=0;a<d.length;a++)AdfPage.PAGE.removeComponentsInSubtree(d[a]);null!=f&&(a=this._findParentRowByAncestorPath(f),null!=a&&(f=a.getAttribute(AdfDhtmlTableBasePeer._ROW_KEY),
a=this._findChildList(f,!1),a||(a=this._getDisclosureImageFromRowKey(f),this._setLeafIcon(a))))}return{rerender:"",updates:b}};AdfDhtmlTreeTablePeer.prototype._findParentRowByAncestorPath=function(a){var b=null;if(null!=a&&(a=a.split(AdfDhtmlTreeTablePeer._KEY_PATH_SEPARATOR),a=this.FindRowByKey(a[a.length-1])))b=a.tr;return b};
AdfDhtmlTreeTablePeer.prototype._getNodeStampDepth=function(a){var b=AdfAgent.AGENT,d=null;a=this.FindRowByKey(a);null!=a&&(d=a.tr);if(null!=d){d=this._getNodeStampCell(d).getElementsByTagName("SPAN");a=d.length;for(var e=0;e<a;e++){var f=b.getAttribute(d[e],AdfDhtmlTreeTablePeer.NODE_DEPTH_ATTR,-1);if(void 0!=f)return parseInt(f,10)}}};
AdfDhtmlTreeTablePeer.prototype._resetTreeRow=function(a,b,d){var e=AdfAgent.AGENT,f=this._getNodeStampCell(a),g=this._getDisclosureIconInCell(f);g.id=this._getDisclosureImageId(d);this._setDisclosureIcon(g,!1,a);a=g.parentNode;"SPAN"==a.tagName&&(depth=e.setAttribute(a,AdfDhtmlTreeTablePeer.NODE_DEPTH_ATTR,b));AdfDhtmlTableBasePeer.FindFirstChildByTagName(f,"DIV").style.paddingLeft=b*AdfDhtmlTreeTablePeer._INDENT_PADDING+"px"};
AdfDhtmlTreeTablePeer.prototype._findChildList=function(a,b){for(var d=null,e=this.GetDataBody().childNodes,f=-1,g=-1,h=!1,k=!1,l=0,m=0,n=0;n<e.length&&!k;n++)for(var p=e[n],q=p.rows,r=0;r<q.length&&!k;r++){var s=q[r],u=s.getAttribute(AdfDhtmlTableBasePeer._ROW_KEY),t=p.startRow+r;if(u==a)b&&(f=g=t,h=!0,l+=s.offsetHeight);else{var u=s.getAttribute(AdfDhtmlTreeTablePeer._CLIENT_ANCESTOR_PATH),v=!1;u&&u.match(RegExp("(^|_)"+a+"(_|$)"))&&(l+=s.offsetHeight,v=!0,g=t,-1==f&&(f=t),m++);!v&&-1!=f&&(k=!0)}}-1!=
f&&(d={start:f,end:g,hasParent:h,height:l,count:m});return d};AdfDhtmlTreeTablePeer.prototype.HandleExpand=function(a,b,d){var e=AdfAgent.AGENT.getAttribute(a,"_startKey");if(e){var f=this._getDisclosureImageFromRowKey(e),g=AdfAgent.AGENT.getIntAttribute(a,"totalInserted",0);if(0<g)if(e=this.FindRowByKey(e))this.InsertBlock(a,e.index+1,b,g,d),this._setDisclosureIcon(f,!0,e.tr),this.UpdateRange(!1),this._expandBlockToAnimate=a;else return!1;else this._setLeafIcon(f)}return!0};
AdfDhtmlTreeTablePeer.prototype.BlockInserted=function(a,b,d){(a=this.GetPanelCollectionPeer())&&a.updateRowSelectionContext()};AdfDhtmlTreeTablePeer.prototype.BlockDeleted=function(){var a=this.GetPanelCollectionPeer();a&&a.updateRowSelectionContext()};
AdfDhtmlTreeTablePeer.prototype.FetchCompleted=function(){var a=this._expandBlockToAnimate;this._expandBlockToAnimate=null;if(null!=a&&!this.IsFetchPending()){var b=0;AdfPage.PAGE.isAnimationEnabled()&&!this.isHeightAutoSized()&&(b=this.GetDisclosureAnimationDuration());0<b?this._animateInsertedBlock(a,b):this.AdjustAutoHeight()}};AdfDhtmlTreeTablePeer.prototype.GetDisclosureAnimationDuration=function(){return parseInt(AdfPage.PAGE.getLookAndFeel().getSkinProperty("af|treeTable-tr-node-disclosure-animation-duration"))};
AdfDhtmlTreeTablePeer.prototype._animateInsertedBlock=function(a,b){var d=a.ownerDocument.createElement("div"),e=d.style,f=a.offsetHeight;this.SetAnimating(!0);e.overflow="hidden";e.position="relative";e.height="1px";a.parentNode.replaceChild(d,a);d.appendChild(a);this.SetNewBlockScrollLeft(a);this._insertDeleteAnimationInEffect=!0;AdfDhtmlElementAnimator.animate(AdfDhtmlElementAnimator.FRAME_METHOD_SLOW_FAST_SLOW,b,[{element:d,properties:{height:f}}],null,AdfDhtmlTreeTablePeer._insertBlockAnimationComplete,
{wrapper:d,peer:this})};AdfDhtmlTreeTablePeer._insertBlockAnimationComplete=function(a){var b=a.wrapper;a=a.peer;var d=b.firstChild;b.parentNode.replaceChild(d,b);a._insertDeleteAnimationInEffect=!1;a&&(a.SetNewBlockScrollLeft(d),a.SetAnimating(!1),a.delayedResizeNotify&&(a.delayedResizeNotify(),a.delayedResizeNotify=null),a.AdjustAutoHeight())};
AdfDhtmlTreeTablePeer.prototype._getFillerDataBlocksFromDeleteBlock=function(a){var b=[];if("TABLE"==a.tagName){a=a.rows;for(var d=a.length,e=0;e<d;e++){var f,g=a[e].cells;if(0<g.length&&null!=(f=AdfDhtmlTableBasePeer.FindFirstChildByTagName(g[0],"TABLE")))g[0].removeChild(f),b.push(f)}}return b};
AdfDhtmlTreeTablePeer.prototype.HandleCollapse=function(a,b,d){var e=AdfAgent.AGENT,f=e.getIntAttribute(a,"totalRemoved",0),g=a.getAttribute("_parentKey"),h=null;g&&(h=this._findChildList(g,!0));if(h&&h.hasParent){var k=this._getDisclosureImageFromRowKey(g),l=this.FindRowByKey(g);this._setDisclosureIcon(k,!1,l?l.tr:null);k=h.start;l=k+1;if(l>h.end)return!1;var h=h.end-l+1,m=f,n=this.GetRowCount(),f=e.getIntAttribute(a,"_rowCount",-1);-1!=n&&-1!=f&&(m=n-f);var n=0,p=null;AdfPage.PAGE.isAnimationEnabled()&&
!this.isHeightAutoSized()&&(n=this.GetDisclosureAnimationDuration());0<n&&(p=[],p.totalHeight=0);this.DeleteBlock(l,h,m,d,p);h!=m?(b-=k,0!=b&&this.ShiftIndex(this.GetDataBody().firstChild,b,!0),this.IsReceivingActiveEvents()||(d=this.GetDataBody(),g=d.firstChild,(0>g.startRow||0==g.startRow&&0>b)&&this.RemoveAllBlocks(d),-1!=f&&(g=d.lastChild,g=g.startRow+g.numRows,(g>f||g==f&&0<b)&&this.RemoveAllBlocks(d)))):0<n&&(disclosedRow=this.FindRowByKey(g).tr,this._animateDeletedRows(p,disclosedRow,n));a=
this._getFillerDataBlocksFromDeleteBlock(a);f=a.length;for(b=0;b<f;b++)d=e.getAttribute(a[b],"_startKey"),this.FindRowByKey(d)&&(this._handleDataCallback(a[b],AdfTableDataFetchEvent.AFTER_KEY_SUBTYPE,!0,0),e.elementsAdded(a[b]));this.UpdateRange(!1)}return!0};
AdfDhtmlTreeTablePeer.prototype._animateDeletedRows=function(a,b,d){this.SetAnimating(!0);var e=b.ownerDocument,f=e.createElement("tr"),g=e.createElement("div"),h=g.style;h.overflow="hidden";h.height=a.totalHeight+"px";h.position="relative";h=e.createElement("td");h.style.padding="0px";f.appendChild(h);h.appendChild(g);h.colSpan=b.cells.length;for(h=null;0<a.length;){var k=a.pop();if("TR"==k.tagName){if(null==h){var l=e.createElement("table");l.cellSpacing=l.cellPadding=0;l.style.cssText=b.parentNode.parentNode.style.cssText;
h=e.createElement("tbody");l.appendChild(h);g.appendChild(l);for(var l=k.cells,m=l.length,n=AdfDomUtils.getFirstChildElement(b.parentNode).cells,p=0;p<m;p++)l[p].style.width=n[p].style.width}h.appendChild(k)}else h=null,g.appendChild(k)}b.nextSibling?b.parentNode.insertBefore(f,b.nextSibling):b.parentNode.appendChild(f);a=g.childNodes.length;for(b=0;b<a;b++)this.SetNewBlockScrollLeft(g.childNodes[b]);this._insertDeleteAnimationInEffect=!0;AdfDhtmlElementAnimator.animate(AdfDhtmlElementAnimator.FRAME_METHOD_SLOW_FAST_SLOW,
d,[{element:g,properties:{height:0}}],null,AdfDhtmlTableBasePeer.CollapseAnimationComplete,{wrapper:f,peer:this})};AdfDhtmlTreeTablePeer.prototype.HandleTableBodyArrowLeftRight=function(a,b,d){AdfDhtmlTreeTablePeer.superclass.HandleTableBodyArrowLeftRight.call(this,a,b,d);b&&(!this.isDisclosureFetchPending()&&!this.BusyAnimating())&&(b=this.GetLastRowKey(),null!=b&&(this.scrollToPos(0,-1),d=this.getComponent(),(isLeafNode=this.isLeaf(b))||d.setDisclosedRowKey(b,!a)))};
AdfDhtmlTreeTablePeer.prototype.GetIconNames=function(a){a={};a.expanded=AdfDhtmlTreeTablePeer._TREE_TABLE_ICON_EXPANDED;a.collapsed=AdfDhtmlTreeTablePeer._TREE_TABLE_ICON_COLLAPSED;a.anim=AdfDhtmlTreeTablePeer._TREE_TABLE_ICON_ANIM;a.leaf=AdfDhtmlTreeTablePeer._TREE_TABLE_ICON_LEAF;return a};
AdfDhtmlTreeTablePeer.prototype.GetIconStyleNames=function(a){a={};a.expanded=AdfDhtmlTreeTablePeer._TREE_TABLE_ICON_STYLE_EXPANDED;a.collapsed=AdfDhtmlTreeTablePeer._TREE_TABLE_ICON_STYLE_COLLAPSED;a.anim=AdfDhtmlTreeTablePeer._TREE_TABLE_ICON_STYLE_ANIM;a.leaf=AdfDhtmlTreeTablePeer._TREE_TABLE_ICON_STYLE_LEAF;a.selector=AdfDhtmlTreeTablePeer._TREE_TABLE_ICON_STYLE_SELECTOR;return a};
AdfDhtmlTreeTablePeer.prototype._getTreeUtils=function(){this._treeUtils||(this._treeUtils=new AdfTreeUtils(this));return this._treeUtils};AdfDhtmlTreeTablePeer.prototype.RegisterFirstPropertyChange=function(){AdfRichUIPeer.addComponentPropertyChanges(AdfDhtmlTreeTablePeer,AdfDhtmlTreeTablePeer._FIRST_VISIBLE_KEY)};AdfDhtmlTreeTablePeer.prototype.GetFirst=function(){return this.getComponent().getProperty(AdfDhtmlTreeTablePeer._FIRST_VISIBLE_KEY)};AdfDhtmlTreeTablePeer.prototype.GetRows=function(){return this.getComponent().getProperty(AdfDhtmlTreeTablePeer._VISIBLE_ROWS_KEY)};
AdfDhtmlTreeTablePeer.prototype.Component_afrFstVblChanged=function(a,b,d,e){AdfPage.PAGE.addPartialTargets(a);this.QueueRangeChangeEvent(e,d);return!1};AdfDhtmlTreeTablePeer.prototype.GetRowHeaderText=function(a,b){try{var d=this.GetRowKeyAndRow(a,b)[1];return this._getNodeStampCell(d).textContent}catch(e){return AdfLogger.LOGGER.fine("Exception while trying to get node stamp text for the active row"+e),""}};
AdfDhtmlTreeTablePeer.prototype.GetActiveDataAnnouncementKey=function(a){return AdfDhtmlTreeTablePeer.msgMap[a]||"AFActiveDataTreeTableRowInsert"};AdfDhtmlTreeTablePeer.prototype.GetParentRowNodeText=function(a){try{var b=a.getAttribute(AdfDhtmlTreeTablePeer._CLIENT_ANCESTOR_PATH),d=this._findParentRowByAncestorPath(b);return this._getNodeStampCell(d).textContent}catch(e){return AdfLogger.LOGGER.fine("Exception while trying to get the text for the parent row of the active row"+e),""}};
AdfDhtmlTreeTablePeer.prototype.GetRowText=function(a,b,d){var e="";try{var f=this.FindRowByKey(a).tr,g=f.cells;if(this.IsWholeRowRead(b,d)){var h=g.length;for(a=0;a<h;a++)e=e+g[a].textContent+" "}else e=this._getNodeStampCell(f).textContent;var e=e.trim(),k=this.GetParentRowNodeText(f);if(""!==k)var l=AdfPage.PAGE.getLookAndFeel().getTranslatedString("AFActiveDataTreeTableParent"),e=TrFastMessageFormatUtils.format(l,k,e);return e}catch(m){return AdfLogger.LOGGER.fine("Exception while trying to get the node text for the active data row"+
m),e}};AdfDhtmlTreeTablePeer.prototype._handleEnterKey=function(a,b){if(AdfDhtmlTreeTablePeer.superclass._handleEnterKey.call(this,a,b)&&this._focusManager.objectType==AdfDhtmlTableBasePeer._TABLE_BODY_FOCUS_TYPE){var d=this.GetFocusedRowKey();if(null!=d){var e=AdfAgent.AGENT.getEventTarget(b),d=this._getDisclosureImageFromRowKey(d);null!=d&&(d=this._getDisclosureIcon(d),null!=d&&AdfDomUtils.isAncestor(e,d)&&this.HandleDisclosure(a))}}};
AdfDhtmlTreeTablePeer.msgMap={update:"AFActiveDataTreeTableRowUpdate",remove:"AFActiveDataTreeTableRowDelete"};