package components { import mx.controls.Tree; import mx.core.mx_internal; use namespace mx_internal; public class ExtendedTree extends Tree { public function ExtendedTree() { super(); this.setStyle("indentation", 8); } public function getDropParent():Object { if(_dropData != null) { return _dropData.parent; } else { return null; } } protected override function itemToUID(data:Object):String { if(data is XML) { var node:XML = XML(data); var parent:Object = node.parent(); var grandparent:Object = null; if(parent!=null){ grandparent = node.parent().parent(); } if(parent == null) { return ""; } switch(node.localName()) { case "Configs": return node.localName(); case "Geoide_Client_Config": return node.@id + node.@clientId; case "Colors": return parent.@id + parent.@clientId + "Colors"; case "ButtonBars": return parent.@id + parent.@clientId + "ButtonBars"; case "ActionButtons": return parent.@id + parent.@clientId + "ActionButtons"; case "MapViewerButtons": return parent.@id + parent.@clientId + "MapViewerButtons"; case "PaneButtons": return parent.@id + parent.@clientId+ "PaneButtons"; case "SinglePaneComponents": return parent.@id + parent.@clientId + "SinglePaneComponents"; case "MulitPaneComponents": return parent.@id + parent.@clientId + "MulitPaneComponents"; case "ButtonBar": case "ActionButton": case "MapViewerButton": case "PaneButton": case "SinglePaneComponent": case "MultiPaneComponent": return grandparent.@id + grandparent.@clientId + node.Name; } var nodeUID:String = node.localName(); if(node.attribute("id").length() > 0) { nodeUID += (node.@clientId == "true" ? "c" : "s") + node.@id } return parent == null ? nodeUID : itemToUID(parent) + "/" + nodeUID; } else { return super.itemToUID(data); } } } }