first go at specialised tag editors
[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         
10         public function SingleTagEditorFactory(inputXML:XML) {
11             super(inputXML);
12             tagKey = inputXML.@key;
13         }
14         
15         override public function areTagsMatching(entity:Entity):Boolean {
16             return entity.getTag(tagKey) != null;
17         }
18
19         public function get key():String {
20             return tagKey;
21         }
22         
23         override public function createEditorInstance(entity:Entity):DisplayObject {
24             var editor:SingleTagEditor = createSingleTagEditor();
25             editor.factory = this;
26             editor.entity = entity;
27             return editor;
28         }
29         
30         protected function createSingleTagEditor():SingleTagEditor {
31             return null;
32         }
33     }
34
35 }
36
37