more
[potlatch2.git] / net / systemeD / potlatch2 / mapfeatures / editors / TurnRestrictionEditor.mxml
old mode 100755 (executable)
new mode 100644 (file)
index c5ee509..e97fa1b
@@ -1,6 +1,8 @@
 <?xml version="1.0" encoding="utf-8"?>
 <edit:RelationMemberEditor
-       xmlns:mx="http://www.adobe.com/2006/mxml" 
+       xmlns:fx="http://ns.adobe.com/mxml/2009"
+       xmlns:mx="library://ns.adobe.com/flex/mx"
+    xmlns:s="library://ns.adobe.com/flex/spark"
        xmlns:edit="net.systemeD.potlatch2.mapfeatures.editors.*"
        xmlns:flexlib="flexlib.controls.*"
        verticalGap="0"
        toolTip="{fieldDescription}"
        initialize="addTurnRestrictions()">
 
-  <mx:Label text="{fieldName}:"/>
-  <mx:VBox verticalGap="0" width="100%" id="turnRestrictionIcons"/>
-  <mx:LinkButton label="Add new turn restriction" click="addNewTurnRestriction()" />
+  <s:FormItem label="{fieldName}">
+    <mx:VBox verticalGap="0" width="100%" id="turnRestrictionIcons"/>
+    <mx:LinkButton label="Add new turn restriction" click="addNewTurnRestriction()" />
+  </s:FormItem>
 
-  <mx:Script><![CDATA[
+  <fx:Script><![CDATA[
        import net.systemeD.halcyon.connection.*;
        import net.systemeD.potlatch2.*;
        import mx.core.*;
        }
 
        public function addNewTurnRestriction():void {
-               var conn:Connection = Connection.getConnectionInstance();
-               var relation:Relation = conn.createRelation(
+               var relation:Relation = _entity.connection.createRelation(
                        { type: 'restriction' }, 
                        [ new RelationMember(_entity, 'via') ],
             MainUndoStack.getGlobalStack().addAction);
                addTurnRestrictions();
        }
        
-  ]]></mx:Script>
+  ]]></fx:Script>
 </edit:RelationMemberEditor>