more
[potlatch2.git] / net / systemeD / potlatch2 / mapfeatures / editors / SingleTagEditorFactory.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 SingleTagEditorFactory extends EditorFactory {
8             private var tagKey:String;
9                 private var boxDirection:String;
10         
11         public function SingleTagEditorFactory(inputXML:XML, defaultLayout:String="vertical") {
12             super(inputXML);
13             tagKey = inputXML.@key;
14                         boxDirection = inputXML.@layout;
15                         if (!boxDirection) { boxDirection=defaultLayout; }
16         }
17         
18         override public function areTagsMatching(entity:Entity):Boolean {
19             return entity.getTag(tagKey) != null;
20         }
21
22         public function get key():String {
23             return tagKey;
24         }
25         
26         public function get direction():String {
27             return boxDirection;
28         }
29         
30         override public function createEditorInstance(entity:Entity):DisplayObject {
31             var editor:SingleTagEditor = createSingleTagEditor();
32             editor.factory = this;
33             editor.entity = entity;
34             return editor;
35         }
36         
37         protected function createSingleTagEditor():SingleTagEditor {
38             return null;
39         }
40     }
41
42 }
43
44