Remove bug stuff from marker panel
[potlatch2.git] / net / systemeD / potlatch2 / panels / MarkerPanel.mxml
1 <?xml version="1.0" encoding="utf-8"?>
2
3 <!--
4     Marker Panel
5 -->
6
7 <mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml" height="100%">
8   <mx:Text id="markerPanelText" text="You have selected a marker." width="100%" styleName="helpInfo" />
9   <mx:DataGrid editable="false" id="markerPanelDG" width="100%" height="50%">
10     <mx:columns>
11       <mx:DataGridColumn editable="false" dataField="key" headerText="key" />
12       <mx:DataGridColumn editable="false" dataField="value" headerText="value" />
13     </mx:columns>
14   </mx:DataGrid>
15   <mx:Script><![CDATA[
16
17       import net.systemeD.halcyon.connection.*;
18       import net.systemeD.halcyon.VectorLayer;
19       import net.systemeD.potlatch2.BugLayer;
20       import mx.collections.*;
21
22       private var selectedEntity:Entity;
23       private var tagDataProvider:ArrayCollection;
24       private var layer:VectorLayer;
25
26       public function init(entity:Entity, layer:VectorLayer):void {
27             this.layer = layer;
28             if ( tagDataProvider == null ) {
29                 tagDataProvider = new ArrayCollection();
30                 markerPanelDG.dataProvider = tagDataProvider;
31             }
32
33             selectedEntity=entity;
34             updateTagDataProvider();
35       }
36
37       private function updateTagDataProvider():void {
38             tagDataProvider.removeAll();
39             if (selectedEntity==null) { return; }
40             var tags:Array = selectedEntity.getTagArray();
41             tags.sortOn("key");
42             for each(var tag:Tag in tags) { tagDataProvider.addItem(tag); }
43       }
44       ]]>
45   </mx:Script>
46 </mx:VBox>