1 <?xml version="1.0" encoding="utf-8"?>
2 <edit:RelationMemberEditor
3 xmlns:mx="http://www.adobe.com/2006/mxml"
4 xmlns:edit="net.systemeD.potlatch2.mapfeatures.editors.*"
5 xmlns:flexlib="flexlib.controls.*"
8 toolTip="{fieldDescription}"
9 initialize="addRoutes()">
11 <mx:Label text="{fieldName}:"/>
12 <mx:VBox verticalGap="0" width="100%" id="routeIcons"/>
13 <mx:LinkButton label="Add to route" click="addToRelation()" />
16 import net.systemeD.halcyon.connection.*;
17 import net.systemeD.potlatch2.*;
18 import mx.managers.PopUpManager;
21 public function addRoutes():void {
22 for each(var relation:Object in matchedRelations) {
23 var icon:RouteIcon = new RouteIcon();
24 icon.setRoute(relation, RouteEditorFactory(_factory).icon);
26 icon.addEventListener(MouseEvent.CLICK, routeClicked);
27 routeIcons.addChild(icon);
31 public function routeClicked(event:Event):void {
32 var relation:Object = RouteIcon(event.currentTarget).route;
33 trace(relation+" is clicked");
34 var panel:RelationEditorPanel = RelationEditorPanel(
35 PopUpManager.createPopUp(Application(Application.application), RelationEditorPanel, true));
36 panel.setRelation(relation["relation"]);
37 PopUpManager.centerPopUp(panel);
40 public function addToRelation():void {
41 new RelationSelectPanel().init(_entity, _factory.relationTags);
46 </edit:RelationMemberEditor>