first go at specialised tag editors
[potlatch2.git] / net / systemeD / potlatch2 / mapfeatures / editors / ChoiceEditorFactory.as
1 package net.systemeD.potlatch2.mapfeatures.editors {
2
3     import net.systemeD.halcyon.connection.*;
4     import net.systemeD.potlatch2.mapfeatures.*;
5     import flash.display.*;
6
7         public class ChoiceEditorFactory extends SingleTagEditorFactory {
8             public var choices:Array;
9         
10         public function ChoiceEditorFactory(inputXML:XML) {
11             super(inputXML);
12             
13             choices = [];
14             for each( var choiceXML:XML in inputXML.choice ) {
15                 var choice:Object = {};
16                 choice["value"] = choiceXML.@value;
17                 choice["description"] = choiceXML.@description;
18                 choice["label"] = choiceXML.@text;
19                 choice["icon"] = choiceXML.@icon;
20                 choices.push(choice);
21             }
22         }
23         
24         override protected function createSingleTagEditor():SingleTagEditor {
25             return new ChoiceEditor();
26         }
27     }
28
29 }
30
31