AdfRichUIPeer.createPeerClass(AdfRichUIPeer,"AdfDhtmlListViewPeer",!1);
AdfDhtmlListViewPeer.InitSubclass=function(){AdfRichUIPeer.addComponentEventHandlers(this,AdfUIInputEvent.CLICK_EVENT_TYPE,AdfUIInputEvent.KEY_DOWN_EVENT_TYPE,AdfUIInputEvent.MOUSE_IN_EVENT_TYPE,AdfUIInputEvent.MOUSE_OUT_EVENT_TYPE,AdfUIInputEvent.FOCUS_EVENT_TYPE);AdfRichUIPeer.addSuppressedPPRAttributes(this,"rows");AdfRichUIPeer.addComponentPropertyChanges(this,"selectedRowKeys");this.DW_SUB_ID="dataW";this._FETCH_MORE_DIV="fchmr";this._FETCH_MORE_LINK="fchmrlnk";this._ICON_STYLE_EXPANDED="af|listItem::expanded-icon-style";
this._ICON_STYLE_COLLAPSED="af|listItem::collapsed-icon-style";this._ICON_EXPANDED="af|listItem::expanded-icon";this._ICON_COLLAPSED="af|listItem::collapsed-icon";this._EXPANDED_GROUP_KEY="af_listItem.TIP_EXPANDED_GROUP";this._COLLAPSED_GROUP_KEY="af_listItem.TIP_COLLAPSED_GROUP";this._ROW_KEY="data-afrRK";this._GROUP_HEADER_ATTR="data-afrgrpHdr";this._FETCH_INDEX_ATTR="data-afrfchIndx";this._FETCH_DELAY_TIMEOUT=300;this._INPUT_REGEXP=/^INPUT|SELECT|OPTION|BUTTON|^A\b|TEXTAREA|LABEL/;this._NEEDS_REFRESH_ATTRIBUTE=
"data-afrNdsRfr";this._UNDO_FETCH_ATTRIBUTE="data-afrUndFch";this._SELECTED_CLASS="p_AFSelected";this._HIGHLIGHTED_CLASS="p_AFHighlighted";this._DROP_TARGET_CLASS="p_AFDropTarget";this._SEL_UPDATE_ALL_SELECT=0;this._SEL_UPDATE_ALL_UNSELECT=1;this._SEL_UPDATE_ALL_UPDATE=2;this._ACTION_MODE_ROW_KEY="_actionModeRowKey";this._SCROLLBAR_BEHAVIOR="_afrScrollBarBehavior";this._SCROLLBAR_BEHAVIOR_AUTO_HIDE="autohiding-scrollbar"};
AdfDhtmlListViewPeer.prototype.InitDomElement=function(a,b){AdfDhtmlListViewPeer.superclass.InitDomElement.call(this,a,b);this._fetchId=0;AdfAgent.AGENT.getOS()==AdfAgent.MAC_OS?this._scrollbarBehavior=null:(this._scrollbarBehavior=a.getProperty(AdfDhtmlListViewPeer._SCROLLBAR_BEHAVIOR),this.initializeAutoHideScrolling(b))};AdfDhtmlListViewPeer.prototype.isDisclosureFetchPending=function(){return!1};AdfDhtmlListViewPeer.prototype.needsResizeNotify=function(a){return!0};
AdfDhtmlListViewPeer.prototype.ResizeNotify=function(a,b,d,e){if(this._initialized)a=this.getDomElement(),this.initializeAutoHideScrolling(a);else{this._initialized=!0;a=this._getDataBody();d=a.childNodes;b=0;for(e=d.length-1;0<=e;e--){var f=d[e];if("DIV"==f.tagName&&null!=f.getAttribute("data-emptyText")){this._isEmpty=!0;break}else 1==f.nodeType&&b++}d=this.getComponent();b!=d.getProperty("rows")&&d.setProperty("rows",b,!1,AdfUIComponent.PROPAGATE_NEVER);AdfAgent.AGENT.getPlatform()==AdfAgent.IE_PLATFORM&&
this._isMultipleSelect()&&(a.onselectstart=this.createCallback(this._handleDataBodySelectStart));this._isMultipleSelect()&&a.addEventListener("mousedown",this.createCallback(this._handleDataBodySelectStart),!1);if(0!=b)if(a.setAttribute("tabindex","-1"),AdfDomUtils.disableTabStop(a,!0),a=d.getProperty(AdfDhtmlListViewPeer._ACTION_MODE_ROW_KEY)){if(this._focusRowKey=a,a=this._findItemByKey(this._focusRowKey))AdfDomUtils.disableTabStop(a,!1),this._setListItemTabStop(this._focusRowKey)}else this._setFocusRowKey(),
a={},this._focusRowKey&&(a.row=this._findItemByKey(this._focusRowKey),a.rowKey=this._focusRowKey),a.row||(a=this._getFirstRowKeyAndItem()),this._focusRowKey=a.rowKey,this._setListItemTabStop(this._focusRowKey)}};
AdfDhtmlListViewPeer.prototype.initializeAutoHideScrolling=function(a){var b=AdfAgent.AGENT;if(this._scrollbarBehavior==AdfDhtmlListViewPeer._SCROLLBAR_BEHAVIOR_AUTO_HIDE){this._scrollbarWidth||(this._scrollbarWidth=this._calculateScrollBarWidth(a));b=b.getComputedStyle(a);if(!this._verticalScrollPadding&&this._needsVerticalScrollbar(a)){if(AdfDhtmlListViewPeer._isRTL()){var d=AdfAgent.getCSSLengthAsInt(b.paddingLeft);a.style.paddingLeft=d+this._scrollbarWidth+"px"}else d=AdfAgent.getCSSLengthAsInt(b.paddingRight),
a.style.paddingRight=d+this._scrollbarWidth+"px";this._verticalScrollPadding=this._scrollbarWidth}!this._horizontalScrollPadding&&this._needsHorizontalScrollbar(a)&&(b=AdfAgent.getCSSLengthAsInt(b.paddingBottom),a.style.paddingBotttom=b+this._scrollbarWidth+"px",this._horizontalScrollPadding=this._scrollbarWidth)}};
AdfDhtmlListViewPeer.prototype._calculateScrollBarWidth=function(a){var b=this.getDomDocument().createElement("div");b.style.visiblity="hidden";b.style.overflow="scroll";b.style.position="absolute";a.appendChild(b);var d=b.offsetWidth-b.clientWidth;a.removeChild(b);return d};AdfDhtmlListViewPeer.prototype._needsVerticalScrollbar=function(a){return a.scrollHeight>a.offsetHeight};AdfDhtmlListViewPeer.prototype._needsHorizontalScrollbar=function(a){return a.scrollWidth>a.offsetWidth};
AdfDhtmlListViewPeer.prototype.ReplaceDomElement=function(a,b){if(0<a.id.indexOf(AdfDhtmlListViewPeer.DW_SUB_ID)){for(var d=AdfAgent.AGENT,e=this._getDataBody(),f=this.getComponent(),g=d.getIntAttribute(a,"data-fetchId",-1),h=this._pendingFetch,k=b.firstChild;k;)this._unregisterNode(k),b.removeChild(k),k=b.firstChild;(k=a.lastChild)&&k.id&&0<k.id.indexOf(AdfDhtmlListViewPeer._FETCH_MORE_DIV)?a.removeChild(k):k=null;if(void 0!=h&&this._pendingId==g){var l=this._insertAfterNode,g=this._fetchKey;this._cancelPendingFetch();
if(d.getBooleanAttribute(a,AdfDhtmlListViewPeer._NEEDS_REFRESH_ATTRIBUTE,!1)){AdfPage.PAGE.addPartialTargets(f);return}if(d.getBooleanAttribute(a,AdfDhtmlListViewPeer._UNDO_FETCH_ATTRIBUTE,!1)){AdfDhtmlListViewPeer._setCursor(e,"");this._hideStatus();return}this._handleDataCallback(a,h,l,f);if(f=d.getElementById(AdfRichUIPeer.CreateSubId(f.getClientId(),AdfDhtmlListViewPeer._FETCH_MORE_DIV)+g))k?(d.elementsAdded(f),f.parentNode.replaceChild(k,f),d.elementsAdded(k)):(d.elementsAdded(f),f.parentNode.removeChild(f))}else this._addInvalidDataBlock(b,
a,e);AdfDhtmlListViewPeer._setCursor(e,"");this._hideStatus();AdfPage.PAGE.scheduleTimer(this,this._doResizeNotifyOnFetchedChildren,l,10)}else AdfDhtmlListViewPeer.superclass.ReplaceDomElement.call(this,a,b)};
AdfDhtmlListViewPeer.prototype._doResizeNotifyOnFetchedChildren=function(a){var b=AdfPage.PAGE;for(a=a.nextSibling;a;){if(a.firstChild){var d=a.firstChild.id;null!=d&&(d=AdfPage.PAGE.findComponent(d),null!=d&&(b.doResizeNotify(d),AdfDomUtils.disableTabStop(a,!0)))}a=a.nextSibling}b=this.getDomElement();this.initializeAutoHideScrolling(b)};AdfDhtmlListViewPeer.prototype.DomReplaceNotify=function(a){return 0<a.id.indexOf(AdfDhtmlListViewPeer.DW_SUB_ID)?null:a};
AdfDhtmlListViewPeer.prototype.ComponentGroupDisclosedRowKeysChanged=function(a,b,d,e){AdfPage.PAGE.addPartialTargets(a)};AdfDhtmlListViewPeer.prototype._getExpandAction=function(a){var b=AdfPage.PAGE.getLookAndFeel(),d=b.getStyleClass(AdfDhtmlListViewPeer._ICON_STYLE_EXPANDED),e=a.parentNode.className;if(d==a.className||d==e)return"collapse";b=b.getStyleClass(AdfDhtmlListViewPeer._ICON_STYLE_COLLAPSED);return b==a.className||b==e?"expand":null};
AdfDhtmlListViewPeer.prototype.HandleComponentMouseOver=function(a){var b=this.getDomElement();this._unhideListViewScrollbar(b);this._showItemHoverState(a,!0)};AdfDhtmlListViewPeer.prototype.HandleComponentMouseOut=function(a){var b=this.getDomElement();this._hideListViewScrollbar(b);this._showItemHoverState(a,!1)};
AdfDhtmlListViewPeer.prototype._hideListViewScrollbar=function(a){var b=AdfAgent.AGENT;if(this._scrollbarBehavior==AdfDhtmlListViewPeer._SCROLLBAR_BEHAVIOR_AUTO_HIDE){b=b.getComputedStyle(a);if("hidden"!=a.style.overflowY&&this._verticalScrollPadding&&this._needsVerticalScrollbar(a))if(a.style.overflowY="hidden",AdfDhtmlListViewPeer._isRTL()){var d=AdfAgent.getCSSLengthAsInt(b.paddingLeft);a.style.paddingLeft=d+this._verticalScrollPadding+"px"}else d=AdfAgent.getCSSLengthAsInt(b.paddingRight),a.style.paddingRight=
d+this._verticalScrollPadding+"px";"hidden"!=a.style.overflowX&&this._horizontalScrollPadding&&this._needsHorizontalScrollbar(a)&&(a.style.overflowX="hidden",b=AdfAgent.getCSSLengthAsInt(b.paddingBottom),a.style.paddingBotttom=b+this._horizontalScrollPadding+"px")}};
AdfDhtmlListViewPeer.prototype._unhideListViewScrollbar=function(a){var b=AdfAgent.AGENT;if(this._scrollbarBehavior==AdfDhtmlListViewPeer._SCROLLBAR_BEHAVIOR_AUTO_HIDE){b=b.getComputedStyle(a);if("hidden"==a.style.overflowY&&this._verticalScrollPadding&&this._needsVerticalScrollbar(a))if(a.style.overflowY="auto",AdfDhtmlListViewPeer._isRTL()){var d=AdfAgent.getCSSLengthAsInt(b.paddingLeft);a.style.paddingLeft=d-this._verticalScrollPadding+"px"}else d=AdfAgent.getCSSLengthAsInt(b.paddingRight),a.style.paddingRight=
d-this._verticalScrollPadding+"px";"hidden"==a.style.overflowX&&this._horizontalScrollPadding&&this._needsVerticalScrollbar(a)&&(a.style.overflowX="auto",b=AdfAgent.getCSSLengthAsInt(b.paddingBottom),a.style.paddingBotttom=b-this._horizontalScrollPadding+"px")}};
AdfDhtmlListViewPeer.prototype._showItemHoverState=function(a,b){if(this._isOwnComponentEvent(a)){var d=AdfAgent.AGENT,e=a.getNativeEventTarget();e&&!this._isEmpty&&(e=this.__getRowKeyAndItem(e,this.getDomElement()),null!=e&&(e=e[1])&&null==d.getAttribute(e,AdfDhtmlListViewPeer._GROUP_HEADER_ATTR)&&(b&&!AdfDomUtils.containsCSSClassName(e,AdfDhtmlListViewPeer._SELECTED_CLASS)?AdfDomUtils.addCSSClassName(e,AdfDhtmlListViewPeer._HIGHLIGHTED_CLASS):b||AdfDomUtils.removeCSSClassName(e,AdfDhtmlListViewPeer._HIGHLIGHTED_CLASS)))}};
AdfDhtmlListViewPeer.prototype.HandleComponentClick=function(a){if(this._isOwnComponentEvent(a)){var b=AdfAgent.AGENT,d=a.getNativeEvent(),e=b.getEventTarget(d);if(e&&!this._isEmpty){var f=this.getComponent(),g=this.__getRowKeyAndItem(e,this.getDomElement());if(null!=g&&a.isLeftButtonPressed()&&(a=g[0],g=g[1])){if(null!=b.getAttribute(g,AdfDhtmlListViewPeer._GROUP_HEADER_ATTR)){var h=this._getExpandAction(e);null!=h&&("expand"==h?f.setGroupDisclosedRowKey(a,!0):f.setGroupDisclosedRowKey(a,!1))}else this.__isSelectionEnabled()&&
(this.__getSwipeSelected()?this.__setSwipeSelected(!1):this.__doItemSelection(d,a,g));this._focusRowKey=a;this._setListItemTabStop(a);this._isTargetCellEditable(e)||(AdfFocusUtils.focusElement(g),b.eatEvent(d));return}d=e.id;f=AdfRichUIPeer.CreateSubId(f.getClientId(),AdfDhtmlListViewPeer._FETCH_MORE_LINK);d&&-1!=d.indexOf(f)&&this._addMore(d.substring(f.length),b.getIntAttribute(e,AdfDhtmlListViewPeer._FETCH_INDEX_ATTR,-1))}}};
AdfDhtmlListViewPeer.prototype._setListItemTabStop=function(a){for(var b=this._getDataBody().childNodes,d=b.length,e=0;e<d;e++){var f=b[e];1==f.nodeType&&(f=f.firstChild,a==f.getAttribute(AdfDhtmlListViewPeer._ROW_KEY)?f.setAttribute("tabindex","0"):f.setAttribute("tabindex","-1"))}};
AdfDhtmlListViewPeer.prototype._addMore=function(a,b){var d=AdfAgent.AGENT;this._startFetch(AdfListViewDataFetchEvent.MORE_SUBTYPE,a,b);for(var e=this._getDataBody().childNodes,f=e.length,g=null,h=0;h<f;h++){var k=e[h];if(1==k.nodeType&&d.getAttribute(k.firstChild,AdfDhtmlListViewPeer._ROW_KEY)==a){g=k;break}}AdfAssert.assert(null!=g,"Could not locate the node to insert after");this._insertAfterNode=g};
AdfDhtmlListViewPeer.prototype._queueFetchEvent=function(a,b,d){var e=this._fetchId++,f=this.getComponent(),g=new AdfListViewDataFetchEvent(f,e,a,b,d);g.setPartial(!0);f.queueEvent(g);var h=g.isCanceled();h||(this._pendingFetch=a,this._pendingId=e,this._fetchKey=b,this._fetchIndex=d,g.setRoot(f));return h?null:g};
AdfDhtmlListViewPeer.prototype._startFetch=function(a,b,d){if(a!=this._pendingFetch||b!=this._fetchKey)this._queueFetchEvent(a,b,d)?(a=AdfPage.PAGE.getLookAndFeel().getTranslatedString("af_listView.LABEL_FETCHING"),this._displayStatus(a),AdfDhtmlListViewPeer._setCursor(this._getDataBody(),"wait")):this._hideStatus()};
AdfDhtmlListViewPeer.prototype._displayStatus=function(a){var b=this._getStatusMessage();AdfDhtmlListViewPeer._findFirstChildByTagName(b,"IMG").title=a;a=b.style;if("none"==a.display){var d=this.getDomElement(),e=d.offsetWidth,f=d.offsetHeight;a.zIndex=1E4;a.visibility="hidden";a.display="block";e=e/2-b.offsetWidth/2;b=d.scrollTop+f/2-b.offsetHeight/2;AdfDhtmlListViewPeer._isRTL()?a.left=Math.floor(e)+"px":a.right=Math.floor(e)+"px";a.top=Math.floor(b)+"px";a.visibility="visible"}};
AdfDhtmlListViewPeer.prototype._cancelPendingFetch=function(){this._insertAfterNode=this._pendingId=this._fetchKey=this._pendingFetch=void 0};AdfDhtmlListViewPeer.prototype._handleDataCallback=function(a,b,d,e){var f=a.childNodes.length;b=AdfAgent.AGENT;var g=this._getDataBody(),h=0;if(0<f){f=a.firstChild;for(d=d.nextSibling;f;)d?g.insertBefore(f,d):g.appendChild(f),b.elementsAdded(f),1==f.nodeType&&h++,f=a.firstChild;e.setProperty("rows",e.getProperty("rows")+h,!1,AdfUIComponent.PROPAGATE_NEVER)}};
AdfDhtmlListViewPeer.prototype._hideStatus=function(){this._getStatusMessage().style.display="none"};AdfDhtmlListViewPeer.prototype._getDataBody=function(a){return this._getElemBySubId("db",a)};AdfDhtmlListViewPeer.prototype._getStatusMessage=function(){return this._getElemBySubId("sm")};AdfDhtmlListViewPeer.prototype._getElemBySubId=function(a,b){var d=this.getDomElement();null==d&&(d=b);return AdfDhtmlListViewPeer._getChildBySubId(d,a)};
AdfDhtmlListViewPeer._getChildBySubId=function(a,b){AdfAssert.assert(null!=a,"ListView peer cannot get a child by sub ID if the parent is null!");for(var d=a.id+"::"+b,e=a.childNodes,f=0;f<e.length;f++)if(d==e[f].id)return e[f];return null};AdfDhtmlListViewPeer._findFirstChildByTagName=function(a,b){AdfAssert.assert(null!=a,"ListView peer cannot find first child by tag name if the parent is null!");for(var d=a.childNodes,e=0;e<d.length;e++)if(b==d[e].tagName)return d[e];return null};
AdfDhtmlListViewPeer.prototype.__getRowKeyAndItem=function(a,b){AdfAssert.assertDomElement(a);var d=a,e=AdfAgent.AGENT;if(null==d||1!=d.nodeType)return null;for(var f=e.getAttribute(d,AdfDhtmlListViewPeer._ROW_KEY);null==f;){if(null==d||d==b)return null;d=d.parentNode;if(null==d||1!=d.nodeType)return null;f=e.getAttribute(d,AdfDhtmlListViewPeer._ROW_KEY)}return[f,d]};
AdfDhtmlListViewPeer.prototype._getTargetGroupHeader=function(a){for(var b=null,d=AdfAgent.getAgent(),e=this.getDomElement();a&&a!=e;){if(null!=d.getAttribute(a,AdfDhtmlListViewPeer._GROUP_HEADER_ATTR)){b=a;break}a=a.parentNode}return b};AdfDhtmlListViewPeer.prototype.__setItemSwiped=function(a,b){this._swipedItem={component:a,rootDom:b}};AdfDhtmlListViewPeer.prototype.__getItemSwiped=function(){return this._swipedItem};
AdfDhtmlListViewPeer.prototype.__deleteItemSwiped=function(){this._swipedItem=null};AdfDhtmlListViewPeer.prototype.suppressSelectionEventDelivery=function(a){this._suppressSelectionEventDelivery=a};AdfDhtmlListViewPeer.prototype.canDeliverSelectionEvent=function(){return!this._suppressSelectionEventDelivery};
AdfDhtmlListViewPeer.prototype._isTargetCellEditable=function(a){for(var b=AdfAgent.getAgent(),d,e=this.getDomElement(),f=AdfDhtmlListViewPeer._INPUT_REGEXP;null!=a&&a!=e&&"TD"!=(d=b.getNodeName(a))&&"TH"!=d;){if(d.match(f))if("LABEL"==d){var g=a.getAttribute("for");if(g){if((g=b.getElementById(g))&&b.getNodeName(g).match(f))return!0}else if(0!=a.getElementsByTagName("input").length||0!=a.getElementsByTagName("select").length||0!=a.getElementsByTagName("textarea").length)return!0}else return!0;a=
a.parentNode}return!1};AdfDhtmlListViewPeer.prototype._selIsOnlySelection=function(a){var b=this.getComponent().getSelectedRowKeys(),d=b[a];if(d)for(var e in b)if(e!=a){d=!1;break}return d};
AdfDhtmlListViewPeer.prototype._selUpdateAll=function(a){var b=this._getDataBody();if(null!=b){var d=this.getComponent().getSelectedRowKeys();if(d&&!AdfCollections.isEmpty(d))for(var b=b.childNodes,e=AdfAgent.getAgent(),f=b.length,g=0;g<f;++g){var h=b[g];if(1==h.nodeType){var h=h.firstChild,k=e.getAttribute(h,AdfDhtmlListViewPeer._ROW_KEY);if(null!=k)switch(a){case AdfDhtmlListViewPeer._SEL_UPDATE_ALL_SELECT:this._selHighlightItem(h,!0);break;case AdfDhtmlListViewPeer._SEL_UPDATE_ALL_UNSELECT:this._selHighlightItem(h,
!1);break;case AdfDhtmlListViewPeer._SEL_UPDATE_ALL_UPDATE:this._selHighlightItem(h,d[k])}}}}};AdfDhtmlListViewPeer.prototype._selUnselectAll=function(){this._selUpdateAll(AdfDhtmlListViewPeer._SEL_UPDATE_ALL_UNSELECT);this._updateLVSelectionState({})};AdfDhtmlListViewPeer.prototype.__isSelectionEnabled=function(a){a||(a=this.getComponent());return(a=a.getSelection())&&"none"!=a.toLowerCase()};
AdfDhtmlListViewPeer.prototype._isMultipleSelect=function(){var a=this.getComponent().getSelection();return a&&-1!=a.toLowerCase().indexOf("multiple")};AdfDhtmlListViewPeer.prototype._selIsSelected=function(a){return this.getComponent().getSelectedRowKeys()[a]};AdfDhtmlListViewPeer.prototype._selSelectItem=function(a,b,d){this._selHighlightItem(b,!0);d||(b=this.getComponent(),d={},AdfCollections.copyInto(d,b.getSelectedRowKeys()),d[a]=!0,this._updateLVSelectionState(d))};
AdfDhtmlListViewPeer.prototype._selUnselectItem=function(a,b){this._selHighlightItem(b,!1);var d={};AdfCollections.copyInto(d,this.getComponent().getSelectedRowKeys());delete d[a];this._updateLVSelectionState(d)};
AdfDhtmlListViewPeer.prototype._selHighlightItem=function(a,b){AdfAssert.assertDomNode(a);b?(AdfDomUtils.addCSSClassName(a,AdfDhtmlListViewPeer._SELECTED_CLASS),AdfDomUtils.removeCSSClassName(a,AdfDhtmlListViewPeer._HIGHLIGHTED_CLASS),a.setAttribute("aria-selected","true")):(AdfDomUtils.removeCSSClassName(a,AdfDhtmlListViewPeer._SELECTED_CLASS),a.setAttribute("aria-selected","false"))};
AdfDhtmlListViewPeer.prototype._selectItemRange=function(a,b){var d=this._getDataBody();if(null!=d){var e=AdfAgent.AGENT,f=this.getComponent(),g={};AdfCollections.copyInto(g,f.getSelectedRowKeys());for(var h=f=!1,d=d.childNodes,k=d.length,l=0;l<k;++l){var m=d[l];if(1==m.nodeType&&(m=m.firstChild,null==e.getAttribute(m,AdfDhtmlListViewPeer._GROUP_HEADER_ATTR))){var n=e.getAttribute(m,AdfDhtmlListViewPeer._ROW_KEY);if(null!=n){if(n==a||n==b){if(f||a==b)h=!0;f=!0}f&&(this._selSelectItem(n,m,!0),g[n]=
!0);if(h)break}}}this._updateLVSelectionState(g)}};AdfDhtmlListViewPeer.prototype.__setSwipeSelected=function(a){this._swipeSelected=a};AdfDhtmlListViewPeer.prototype.__getSwipeSelected=function(){return this._swipeSelected};
AdfDhtmlListViewPeer.prototype.__doItemSelection=function(a,b,d){var e=this._isMultipleSelect();e&&AdfAgent.AGENT.isSelectionToggle(a)?(this._anchorRowKey=b,this._selIsSelected(b)?this._isActionsFacetDisplayed(d)||this._selUnselectItem(b,d):this._selSelectItem(b,d)):e&&a.shiftKey?(a=this._anchorRowKey,a||(a=this._anchorRowKey=b),this.suppressSelectionEventDelivery(!0),this._selUnselectAll(),this.suppressSelectionEventDelivery(!1),this._selectItemRange(b,a)):(this._anchorRowKey=b,this._selIsOnlySelection(b)||
(this.suppressSelectionEventDelivery(!0),this._selUnselectAll(),this.suppressSelectionEventDelivery(!1),this._selSelectItem(b,d)))};AdfDhtmlListViewPeer.prototype._handleDataBodySelectStart=function(a){a||(a=AdfPage.PAGE.getDomWindow().event);var b=AdfAgent.AGENT,b=b.getEventTarget(a);AdfPage.PAGE.findComponent(b.id);b=AdfAgent.AGENT;if(!this._isTargetCellEditable(b.getEventTarget(a))&&(a.shiftKey||a.ctrlKey))return b.preventDefault(a),!1};
AdfDhtmlListViewPeer.prototype._isActionsFacetDisplayed=function(a){if(a){var b=AdfAgent.AGENT,d=AdfRichUIPeer.CreateSubId(a.id,"startFacet");a=AdfRichUIPeer.CreateSubId(a.id,"endFacet");d=b.getElementById(d);b=b.getElementById(a);if(d&&"none"!=d.style.display||b&&"none"!=b.style.display)return!0}return!1};
AdfDhtmlListViewPeer.prototype._updateLVSelectionState=function(a){this._ignoreSelSet=!0;AdfLogger.LOGGER.finer("Update ListView selection state to:",a);this.getComponent().setSelectedRowKeys(a);this._ignoreSelSet=!1};AdfDhtmlListViewPeer.prototype.ComponentSelectedRowKeysChanged=function(a,b,d,e){this._ignoreSelSet||(this._selUpdateAll(AdfDhtmlListViewPeer._SEL_UPDATE_ALL_UNSELECT),this._selUpdateAll(AdfDhtmlListViewPeer._SEL_UPDATE_ALL_UPDATE))};
AdfDhtmlListViewPeer.prototype._findItemByKey=function(a){for(var b=this._getDataBody().childNodes,d=b.length,e=0;e<d;e++){var f=b[e];if(1==f.nodeType&&a==f.firstChild.getAttribute(AdfDhtmlListViewPeer._ROW_KEY))return f.firstChild}return null};
AdfDhtmlListViewPeer.prototype._disableActionMode=function(a){var b=this.getComponent().getProperty(AdfDhtmlListViewPeer._ACTION_MODE_ROW_KEY);b&&(b=this._findItemByKey(b),b&&a&&AdfDomUtils.isAncestor(b,a)||(b&&AdfDomUtils.disableTabStop(b,!0),this.getComponent().setProperty(AdfDhtmlListViewPeer._ACTION_MODE_ROW_KEY,null,!1,!0)))};AdfDhtmlListViewPeer.prototype._enableActionMode=function(){this.getComponent().setProperty(AdfDhtmlListViewPeer._ACTION_MODE_ROW_KEY,this._focusRowKey,!1,!0)};
AdfDhtmlListViewPeer.prototype._isInActionMode=function(){return this.getComponent().getProperty(AdfDhtmlListViewPeer._ACTION_MODE_ROW_KEY)?!0:!1};AdfDhtmlListViewPeer.prototype.HandleComponentFocus=function(a){a.isCanceled()||(a=a.getNativeEvent(),(a=AdfAgent.AGENT.getEventTarget(a))&&!this._isEmpty&&this._disableActionMode(a))};
AdfDhtmlListViewPeer.prototype.HandleComponentKeyDown=function(a){if(!a.isCanceled()){var b=a.getNativeEvent(),d=AdfAgent.AGENT,e=d.getEventTarget(b),f=b.keyCode;d.getDomDocument();var g=!0;if(e&&!this._isEmpty)switch(f){case AdfKeyStroke.ESC_KEY:this._isInActionMode()?((e=this._findItemByKey(this._focusRowKey))&&AdfFocusUtils.focusElement(e),this._disableActionMode(),g=!1):this._focusRowKey&&this.__isSelectionEnabled()&&this._selUnselectAll();break;case AdfKeyStroke.ARROWLEFT_KEY:case AdfKeyStroke.ARROWRIGHT_KEY:g=
this._handleArrowLeftRight(f==AdfKeyStroke.ARROWLEFT_KEY,b);break;case AdfKeyStroke.ARROWUP_KEY:case AdfKeyStroke.ARROWDOWN_KEY:this._isInActionMode()||(g=this._handleArrowUpDown(f==AdfKeyStroke.ARROWUP_KEY,b));break;case AdfKeyStroke.SPACE_KEY:this._isInActionMode()||(f=d.getAttribute(e,AdfDhtmlListViewPeer._ROW_KEY))&&(g=this._handleSpaceBar(b));break;case AdfKeyStroke.F2_KEY:case AdfKeyStroke.ENTER_KEY:!this._isInActionMode()&&(f=d.getAttribute(e,AdfDhtmlListViewPeer._ROW_KEY))&&(AdfDomUtils.disableTabStop(e,
!1),0<AdfDomUtils.getInputElementsInNode(e).length&&(this._focusRowKey=f,AdfFocusUtils.focusFirstTabStop(e,!0),this._enableActionMode(),g=!1));break;case AdfKeyStroke.TAB_KEY:g=this._handleTabKey(b)}g||(d.eatEvent(b),a.stopBubbling())}};AdfDhtmlListViewPeer.prototype._setFocusRowKey=function(){var a=this._focusRowKey;if(null==a){var b=this.getComponent().getSelectedRowKeys(),d;for(d in b)b[d]&&(a=d);this._focusRowKey=a}};
AdfDhtmlListViewPeer.prototype._handleArrowLeftRight=function(a,b){var d=AdfAgent.AGENT,e=d.getEventTarget(b),f=this.__getRowKeyAndItem(e,this.getDomElement());if(null!=f&&f[1]){var g=f[0],f=f[1];null!=d.getAttribute(f,AdfDhtmlListViewPeer._GROUP_HEADER_ATTR)&&(d=AdfDomUtils.getInputElementsInNode(f,!0),1==d.length&&(e=d[0]),e=this._getExpandAction(e),null!=e&&(d=this.getComponent(),a||"expand"!=e?a&&"expand"!=e&&d.setGroupDisclosedRowKey(g,!1):d.setGroupDisclosedRowKey(g,!0)))}};
AdfDhtmlListViewPeer.prototype._handleArrowUpDown=function(a,b){var d=this.__getRowKeyAndItem(AdfAgent.AGENT.getEventTarget(b),this.getDomElement());return null!=d&&(d=a?this._getPreviousRowKeyAndItem(d[0],!0):this._getNextRowKeyAndItem(d[0],!0),d.item)?(this._focusRowKey=d.rowKey,AdfFocusUtils.focusElement(d.item),this._setListItemTabStop(this._focusRowKey),!1):!0};
AdfDhtmlListViewPeer.prototype._handleSpaceBar=function(a){if(this.__isSelectionEnabled()&&this._focusRowKey){var b=this._findItemByKey(this._focusRowKey);this.__doItemSelection(a,this._focusRowKey,b);return!1}return!0};
AdfDhtmlListViewPeer.prototype._handleTabKey=function(a){var b=AdfAgent.AGENT.getEventTarget(a);if(this._isInActionMode()){var d=this.__getRowKeyAndItem(b,this.getDomElement());if(d)return a.shiftKey?AdfFocusUtils.focusPreviousTabStop(b,d[1]):AdfFocusUtils.focusNextTabStop(b,d[1]),!1}return!0};AdfDhtmlListViewPeer.prototype._unclipItem=function(a){var b=this.getDomElement(),d=b.scrollTop,e=a.offsetTop;if(e>=d+b.offsetHeight||e+a.offsetHeight<=d)b.scrollTop=e};
AdfDhtmlListViewPeer.prototype._getNextRowKeyAndItem=function(a,b){for(var d=AdfAgent.AGENT,e=this._getDataBody(),f=e.childNodes,g=f.length,h={},k=0;k<g;k++){var l=f[k];if(1==l.nodeType){var m=l.firstChild,n=d.getAttribute(m,AdfDhtmlListViewPeer._ROW_KEY),q=null!=d.getAttribute(m,AdfDhtmlListViewPeer._GROUP_HEADER_ATTR);if(null==a&&(!q||b)){h.rowKey=n;h.item=m;break}else if(n==a&&k+1<g){f=AdfDomUtils.getNextElement(l);m=f.firstChild;for(q=null!=d.getAttribute(m,AdfDhtmlListViewPeer._GROUP_HEADER_ATTR);!b&&
q&&f!=AdfDomUtils.getLastChildElement(e);)f=AdfDomUtils.getNextElement(f),m=f.firstChild,q=null!=d.getAttribute(m,AdfDhtmlListViewPeer._GROUP_HEADER_ATTR);if(!q||b)n=d.getAttribute(m,AdfDhtmlListViewPeer._ROW_KEY),h.rowKey=n,h.item=m;break}}}return h};
AdfDhtmlListViewPeer.prototype._getPreviousRowKeyAndItem=function(a,b){for(var d=AdfAgent.AGENT,e=this._getDataBody(),f=e.childNodes,g={},h=f.length-1;0<=h;h--){var k=f[h];if(1==k.nodeType){var l=k.firstChild,m=d.getAttribute(l,AdfDhtmlListViewPeer._ROW_KEY),n=null!=d.getAttribute(l,AdfDhtmlListViewPeer._GROUP_HEADER_ATTR);if(null==a&&(!n||b)){g.rowKey=m;g.row=l;break}else if(m==a&&l!=AdfDomUtils.getFirstChildElement(e)){f=AdfDomUtils.getPreviousElement(k);if(!f)break;l=f.firstChild;for(n=null!=d.getAttribute(l,
AdfDhtmlListViewPeer._GROUP_HEADER_ATTR);!b&&n&&f!=AdfDomUtils.getFirstChildElement(e);){f=AdfDomUtils.getPreviousElement(f);if(!f)break;l=f.firstChild;n=null!=d.getAttribute(l,AdfDhtmlListViewPeer._GROUP_HEADER_ATTR)}if(!n||b)m=d.getAttribute(l,AdfDhtmlListViewPeer._ROW_KEY),g.rowKey=m,g.item=l;break}}}return g};
AdfDhtmlListViewPeer.prototype._getFirstRowKeyAndItem=function(){for(var a=AdfAgent.AGENT,b=this._getDataBody().childNodes,d=b.length,e={},f=0;f<d;f++){var g=b[f];if(1==g.nodeType){var g=g.firstChild,h=a.getAttribute(g,AdfDhtmlListViewPeer._ROW_KEY);if(null!=h){e.rowKey=h;e.row=g;break}}}return e};AdfDhtmlListViewPeer._isRTL=function(){return AdfPage.PAGE.getLocaleContext().isRightToLeft()};
AdfDhtmlListViewPeer.prototype._isOwnComponentEvent=function(a){a=a.getSource();for(var b=this.getComponent(),d=!1;!d&&a;)if(a==b)d=!0;else{if(a instanceof AdfRichListView||a instanceof AdfUIPopup)break;a=a.getParent()}return d};AdfDhtmlListViewPeer._setCursor=function(a,b){a&&a.style.cursor!=b&&(a.style.cursor=b)};AdfDhtmlListViewPeer.prototype.isDragAvailable=function(a){AdfAssert.assertDomElement(a);return a&&this._isTargetCellEditable(a)?!1:!0};
AdfDhtmlListViewPeer.prototype.getRowKeyForEvent=function(a){a=a.getNativeEventTarget();if(null==this._getTargetGroupHeader(a)){var b=this.getDomElement();a=this.__getRowKeyAndItem(a,b);if(null!=a)return a[0]}return null};AdfDhtmlListViewPeer.prototype.applyDragReadyStateForRowKeys=function(a,b,d){AdfAssert.assertArray(d);a=this._getDomNodesForDrag(d);b=0;for(d=a.length;b<d;++b)AdfDomUtils.addCSSClassName(a[b],AdfRichUIPeer.DRAG_READY_STYLECLASS);return a};
AdfDhtmlListViewPeer.prototype.ClearDragReadyState=function(a){AdfAssert.assertArray(a);for(var b=0,d=a.length;b<d;++b)AdfDomUtils.removeCSSClassName(a[b],AdfRichUIPeer.DRAG_READY_STYLECLASS)};AdfDhtmlListViewPeer.prototype.applyDragSourceStateForRowKeys=function(a,b,d){AdfAssert.assertArray(d);a=this._getDomNodesForDrag(d);b=0;for(d=a.length;b<d;++b)AdfDomUtils.addCSSClassName(a[b],AdfRichUIPeer.DRAG_SOURCE_STYLECLASS);return a};
AdfDhtmlListViewPeer.prototype.ClearDragSourceState=function(a){AdfAssert.assertArray(a);for(var b=0,d=a.length;b<d;++b)AdfDomUtils.removeCSSClassName(a[b],AdfRichUIPeer.DRAG_SOURCE_STYLECLASS)};
AdfDhtmlListViewPeer.prototype.getDragOffsetForRowKeys=function(a,b){var d=a.getNativeEventTarget(),e=this.getDomElement(),f=this.__getRowKeyAndItem(d,e),e=d=0,g=AdfAgent.AGENT;if(null!=f)for(var h=f[0],f=f[1],k=0;k<b.length;k++)if(b[k]==h){h=g.getElementPosition(f);g=g.getMousePosition(a.getNativeEvent());d=g.x-h.x;e+=g.y-h.y;break}else{var l=this._findItemByKey(b[k]);AdfAssert.assert(null!=l);e+=l.offsetHeight}return{x:d,y:e}};
AdfDhtmlListViewPeer.prototype.getDragNodeForRowKeys=function(a){AdfAssert.assertArray(a);var b=this.getDomDocument().createElement("div");a=this._getDomNodesForDrag(a);for(var d=0,e=a.length;d<e;++d){var f=this._cloneItemForDrag(a[d]);b.appendChild(f)}return b};
AdfDhtmlListViewPeer.prototype._getLastRowKey=function(){for(var a=AdfAgent.AGENT,b=this._getDataBody().childNodes,d=b.length-1;0<=d;d--){var e=b[d];if(1==e.nodeType&&(rowKey=a.getAttribute(e.firstChild,AdfDhtmlListViewPeer._ROW_KEY),null!=rowKey))return rowKey}return null};AdfDhtmlListViewPeer.prototype._getDomNodesForDrag=function(a){for(var b=[],d=0;d<a.length;++d){var e=this._findItemByKey(a[d]);e&&b.push(e)}return b};
AdfDhtmlListViewPeer.prototype._cloneItemForDrag=function(a){var b=a.cloneNode(!0),d=AdfAgent.AGENT;d.copyStyle(a,b);d.setOpacity(b,50);return b};
AdfDhtmlListViewPeer.prototype.getRowKeyAndOrientationFromHints=function(a,b,d){AdfAssert.assertNumber(a);AdfAssert.assertNumber(b);AdfAssert.assert(null!=d);var e=d[AdfStampedDropTarget.HINT_LAST_ROWKEY],f=d[AdfStampedDropTarget.HINT_LAST_ROWKEY_BOUNDS],g=d[AdfStampedDropTarget.HINT_LAST_DROP_ORIENTATION];if(e&&f&&(AdfAssert.assertString(e),AdfAssert.assertObject(f),a>=f.left&&b>=f.top&&a<=f.right&&b<=f.bottom)){d[AdfStampedDropTarget.ROW_KEY]=e;d[AdfStampedDropTarget.DROP_ORIENTATION]=g;return}this._getRowKeyAndOrientationForPosition(a,
b,d)};
AdfDhtmlListViewPeer.prototype._getRowKeyAndOrientationForPosition=function(a,b,d){AdfAssert.assertNumber(a);AdfAssert.assertNumber(b);var e=this._getDataBody(),f=AdfDomUtils.getElementAtPoint(e,a,b);if(f&&(f=this.__getRowKeyAndItem(f,this.getDomElement()),null!=f)){d[AdfStampedDropTarget.ROW_KEY]=f[0];d[AdfStampedDropTarget.DROP_ORIENTATION]=AdfDropEvent.DROP_ORIENTATION_ON;return}this.IsEmpty?(d[AdfStampedDropTarget.ROW_KEY]=null,d[AdfStampedDropTarget.DROP_ORIENTATION]=AdfDropEvent.DROP_ORIENTATION_AFTER):AdfAgent.AGENT.pointInElementBounds(e,
a,b)?(d[AdfStampedDropTarget.ROW_KEY]=this._getLastRowKey(),d[AdfStampedDropTarget.DROP_ORIENTATION]=AdfDropEvent.DROP_ORIENTATION_AFTER):(d[AdfStampedDropTarget.ROW_KEY]=null,d[AdfStampedDropTarget.DROP_ORIENTATION]=AdfDropEvent.DROP_ORIENTATION_ON)};
AdfDhtmlListViewPeer.prototype.showDragFeedback=function(a,b,d,e,f,g,h){AdfAssert.assertPrototype(a,AdfDnDContext);AdfAssert.assertStringOrNull(b);AdfAssert.assertNumber(d);AdfAssert.assertStringOrNull(e);d==AdfDnDContext.ACTION_NONE&&(AdfDomUtils.removeCSSClassName(this._getDataBody(),AdfDhtmlListViewPeer._DROP_TARGET_CLASS),b=null);e!=b&&(e&&(a=this._findItemByKey(e))&&AdfDomUtils.removeCSSClassName(a,AdfDhtmlListViewPeer._DROP_TARGET_CLASS),b&&(a=this._findItemByKey(b)))&&(AdfDomUtils.addCSSClassName(a,
AdfDhtmlListViewPeer._DROP_TARGET_CLASS),AdfDomUtils.removeCSSClassName(this._getDataBody(),AdfDhtmlListViewPeer._DROP_TARGET_CLASS));null==b&&d!=AdfDnDContext.ACTION_NONE&&AdfDomUtils.addCSSClassName(this._getDataBody(),AdfDhtmlListViewPeer._DROP_TARGET_CLASS)};AdfDhtmlListViewPeer.prototype.getRowKeyBounds=function(a){return a?(a=this._findItemByKey(a))?AdfAgent.AGENT.getElementPageBounds(a):null:null};
AdfDhtmlListViewPeer.prototype.ConvertClientIdToLocator=function(a,b,d,e){b=a.getClientId();a=AdfStrings.count(b,":");AdfAssert.assert(0<=d.indexOf(b));d=d.substring(b.length+1);b=d.indexOf(":");0<b&&(d=d.substring(0,b),d=this._findItemByKey(d),e.push([a+1,d?AdfDomUtils.getElementPosition(d.parentNode):null]))};
AdfDhtmlListViewPeer.prototype.convertLocatorToClientId=function(a,b){var d=a.getClientId(),e=null,f=this._getDataBody();if(null!=f)for(var f=f.childNodes,g=f.length,h=0,k=0;k<g;k++){var l=f[k];if(1==l.nodeType&&(h++,b==h)){e=l.getAttribute(AdfDhtmlListViewPeer._ROW_KEY);break}}return e?d+":"+e:null};
AdfDhtmlListViewPeer.prototype.getRowIndex=function(a){AdfAssert.assertString(a);AdfAssert.assert(null!=a,"Row Key cannot be null");return(a=this._findItemByKey(a))?AdfDomUtils.getElementPosition(a.parentNode):-1};
AdfDhtmlListViewPeer.prototype.getRowKey=function(a){AdfAssert.assertNumber(a);var b=this.getComponent().getProperty("rows");AdfAssert.assert(0<=a&&a<b,"index must be greater than or equal to 0 or less than the number of rows on the client");var b=null,d=this._getDataBody();null!=d&&(b=AdfDomUtils.getChildElementByPosition(d,1,a).firstChild.getAttribute(AdfDhtmlListViewPeer._ROW_KEY));return b};