Remove unused swat2 code
[kai/samba-autobuild/.git] / swat2 / style / qooxdoo / widgets / widgets / QxTreeElement.js
diff --git a/swat2/style/qooxdoo/widgets/widgets/QxTreeElement.js b/swat2/style/qooxdoo/widgets/widgets/QxTreeElement.js
deleted file mode 100644 (file)
index a73882f..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-/* Copyright (c): 2002-2005 (Germany): United Internet, 1&1, GMX, Schlund+Partner, Alturo */
-function QxTreeElement(vLabel){QxWidget.call(this);if(isValid(vLabel)){this.setLabel(vLabel);};this.setTagName("li");var im=new QxImageManager();this._navigationLineURI = im.buildURI("widgets/tree/line.gif");this._navigationCrossURI = im.buildURI("widgets/tree/cross.gif");this._navigationCrossPlusURI = im.buildURI("widgets/tree/cross_plus.gif");this._navigationCrossMinusURI = im.buildURI("widgets/tree/cross_minus.gif");this._navigationEndURI = im.buildURI("widgets/tree/end.gif");this._navigationEndPlusURI = im.buildURI("widgets/tree/end_plus.gif");this._navigationEndMinusURI = im.buildURI("widgets/tree/end_minus.gif");this._navigationSimplePlusURI = im.buildURI("widgets/tree/plus.gif");this._navigationSimpleMinusURI = im.buildURI("widgets/tree/minus.gif");this.addEventListener("click",this._g3);this.addEventListener("dblclick",this._ondblclick);this.addEventListener("mousedown",this._g1);this.addEventListener("mouseover",this._onmouseover);this.addEventListener("mouseout",this._onmouseout);this.addEventListener("mousemove",this._onmouseover);};QxTreeElement.extend(QxWidget,"QxTreeElement");QxTreeElement._indentCache=[];QxTreeElement.addProperty({name:"label",type:String});QxTreeElement.addProperty({name:"level",type:Number,defaultValue:1});QxTreeElement.addProperty({name:"active",type:Boolean,defaultValue:false});QxTreeElement.addProperty({name:"parentTree"});proto._obtainLastChildState=function(){this._renderImplNavigation();};proto._loseLastChildState=function(){this._renderImplNavigation();};proto.getOpen=function(){return false;};proto._shouldBecomeCreated=function(){return this.getParent().getOpen();};proto._modifyParent=function(_b1,_b2,_b3,_b4){if(_b1){this.setParentTree(_b1.getParentTree(),_b4);this.setLevel(_b1.getLevel()+1);}else {this.setParentTree(null,_b4);};QxWidget.prototype._modifyParent.call(this,_b1,_b2,_b3,_b4);if(_b1&&this.isCreated()){this._renderImplIndent();this._renderImplNavigation();};return true;};proto._modifyElement=function(_b1,_b2,_b3,_b4){this._table=QxTreeElement._h3.cloneNode(true);this._tableRow=this._table.firstChild.firstChild;this._indentCell=this._tableRow.childNodes[0];this._navigationCell=this._tableRow.childNodes[1];this._navigationImage=this._navigationCell.firstChild;this._iconCell=this._tableRow.childNodes[2];this._iconImage=this._iconCell.firstChild;this._labelCell=this._tableRow.childNodes[3];this._renderImplIndent();this._renderImplNavigation();this._renderImplIcon();this._renderImplLabel();_b1.appendChild(this._table);QxWidget.prototype._modifyElement.call(this,_b1,_b2,_b3,_b4);return true;};proto._modifyParentTree=function(_b1,_b2,_b3,_b4){if(this.isCreated()&&!_b2&&_b1){this._renderImplNavigation();this._renderImplIndent();};return true;};proto._modifyActive=function(_b1,_b2,_b3,_b4){var p=this.getParentTree();var c="QxTreeElementLabelCellSelected";if(_b1){QxDOM.addClass(this._labelCell,c);if(p){p.setActiveElement(this,_b4);};}else {QxDOM.removeClass(this._labelCell,c);if(p){p.setActiveElement(null,_b4);};};return true;};proto._modifyLabel=function(_b1,_b2,_b3,_b4){return this._renderImplLabel();};proto._renderImplLabel=function(){if(!this.isCreated()){return true;};var vLabel=this.getLabel();if(vLabel){this._labelCell.firstChild.nodeValue=vLabel;this._table.style.display="block";}else {this._table.style.display="none";};return true;};proto._renderImplIcon=function(){if(!this.isCreated()){return true;};this._iconImage.src=(new QxImageManager).getBlank();return true;};proto._renderImplNavigation=function(){if(!this.isCreated()){return true;};var vParentTree=this.getParentTree();if(!vParentTree){return true;};var newSrc;if(!vParentTree.useTreeLines()){newSrc=(new QxImageManager).getBlank();}else if(this.isLastChild()){newSrc=this._navigationEndURI;}else {newSrc=this._navigationCrossURI;};if(newSrc!=this._navigationImage.src){this._navigationImage.src=newSrc;};return true;};proto._modifyLevel=function(_b1,_b2,_b3,_b4){return this._renderImplIndent();};proto._renderImplIndent=function(){if(!this.isCreated()){return true;};var vParentTree=this.getParentTree();if(!vParentTree){return true;};var vLevel=this.getLevel();if(vLevel==0){return true;};var vParent=this.getParent();if(!vParent){return true;};var chl=this._indentCell.childNodes.length;vLevel--;if(vLevel>chl){var diff=vLevel-chl;var io;do{if(QxTreeElement._indentCache.length>0){this._indentCell.appendChild(QxTreeElement._indentCache.shift());}else {io=new Image();io.src=(new QxImageManager).getBlank();this._indentCell.appendChild(io);};}while(--diff);}else if(vLevel<chl){var diff=chl-vLevel;do{QxTreeElement._indentCache.push(this._indentCell.removeChild(this._indentCell.lastChild));}while(--diff);};var chl=this._indentCell.childNodes.length;if(vLevel<1){return true;};var chI,nI;var vNoLines=!vParentTree.useTreeLines();do{chI=this._indentCell.childNodes[vLevel-1];if(vNoLines||vParent.isLastChild()){nI=(new QxImageManager).getBlank();}else {nI=this._navigationLineURI;};if(nI!=chI.src){chI.src=nI;};vParent=vParent.getParent();if(!vParent){break;};}while(--vLevel);return true;};proto._g1=function(e){switch(e.getDomTargetByTagName("TD",this.getElement())){case this._indentCell:return this._g1Indent(e);case this._navigationCell:return this._g1Navigation(e);case this._iconCell:return this._g1Icon(e);case this._labelCell:return this._g1Label(e);};};proto._g1Indent=function(e){e.preventDefault();};proto._g1Navigation=function(e){e.preventDefault();};proto._g1Icon=function(e){this.setActive(true);e.preventDefault();};proto._g1Label=function(e){this.setActive(true);};proto._g3=function(e){switch(e.getDomTargetByTagName("TD",this.getElement())){case this._indentCell:return this._g3Indent(e);case this._navigationCell:return this._g3Navigation(e);case this._iconCell:return this._g3Icon(e);case this._labelCell:return this._g3Label(e);};};proto._g3Indent=proto._g3Navigation=function(e){};proto._g3Icon=proto._g3Label=function(e){if(this.getParentTree().useDoubleClick()){return;};this.setActive(true);};proto._ondblclick=function(e){var pt=this.getParentTree();if(pt&&!pt.useDoubleClick()){return;};switch(e.getDomTargetByTagName("TD",this.getElement())){case this._indentCell:return this._ondblclickIndent(e);case this._navigationCell:return this._ondblclickNavigation(e);case this._iconCell:return this._ondblclickIcon(e);case this._labelCell:return this._ondblclickLabel(e);};};proto._ondblclickIndent=proto._ondblclickNavigation=proto._ondblclickIcon=proto._ondblclickLabel=function(e){};proto._hoverClass="QxTreeElementLabelCellHover";proto._onmouseover=function(e){var pt=this.getParentTree();if(pt&&pt.useHoverEffects()){switch(e.getDomTargetByTagName("TD")){case this._labelCell:case this._iconCell:QxDOM.addClass(this._labelCell,this._hoverClass);break;default:QxDOM.removeClass(this._labelCell,this._hoverClass);};e.setPropagationStopped(true);};};proto._onmouseout=function(e){var pt=this.getParentTree();if(pt&&pt.useHoverEffects()){QxDOM.removeClass(this._labelCell,this._hoverClass);e.setPropagationStopped(true);};};proto._removeHover=function(){if(this.isCreated()){QxDOM.removeClass(this._labelCell,this._hoverClass);};};proto.dispose=function(){if(this._disposed){return;};QxWidget.prototype.dispose.call(this);this.removeEventListener("click",this._g3);this.removeEventListener("dblclick",this._ondblclick);};QxTreeElement.init=function(){var lt,lb,lr;var lt1,lt2,lt3,lt4;var li2;lt=QxTreeElement._h3=document.createElement("table");lt.border=0;lt.cellSpacing=0;lt.cellPadding=0;lb=document.createElement("tbody");lt.appendChild(lb);lr=document.createElement("tr");lb.appendChild(lr);lt1=document.createElement("td");lr.appendChild(lt1);lt1.className="QxTreeElementIndentCell";lt2=document.createElement("td");lr.appendChild(lt2);lt2.className="QxTreeElementNavigationCell";li2=new Image();li2.src=(new QxImageManager).getBlank();li2.height=16;li2.width=19;lt2.appendChild(li2);lt3=document.createElement("td");lr.appendChild(lt3);lt3.className="QxTreeElementIconCell";li3=new Image();li3.src=(new QxImageManager).getBlank();li3.height=16;li3.width=16;lt3.appendChild(li3);lt4=document.createElement("td");lr.appendChild(lt4);lt4.className="QxTreeElementLabelCell";lt4.appendChild(document.createTextNode("-"));if((new QxClient).isMshtml()){lt.unselectable=lb.unselectable=lr.unselectable=lt1.unselectable=lt2.unselectable=lt3.unselectable=lt4.unselectable=li2.unselectable="on";};};QxTreeElement.init();
\ No newline at end of file