Beginnings of status API support, including WTFE and dedicated UI for selecting it
[potlatch2.git] / net / systemeD / halcyon / connection / Entity.as
index c975324d1d66db569c52f8f49567081897b66378..2837f39860064427abcc7ddc8049fc067b436588 100644 (file)
@@ -1,5 +1,6 @@
 package net.systemeD.halcyon.connection {
 
+    import flash.events.Event;
     import flash.events.EventDispatcher;
     import flash.utils.Dictionary;
     
@@ -17,6 +18,7 @@ package net.systemeD.halcyon.connection {
         private var modified:Boolean = false;
         private var _loaded:Boolean = true;
         private var parents:Dictionary = new Dictionary();
+               public var status:String;
         /** Lock against purging when off-screen */
         public var locked:Boolean = false;
         public var deleted:Boolean = false;
@@ -178,6 +180,14 @@ package net.systemeD.halcyon.connection {
             return copy;
         }
 
+               /** Change entity status. */
+               public function setStatus(s:String):void {
+                       if (s=='') s=null;
+                       if (s==status) return;
+                       status=s;
+                       dispatchEvent(new EntityEvent(Connection.STATUS_CHANGED,this));
+               }
+
                // Clean/dirty methods
 
         /** Check if entity is modified since last markClean(). */
@@ -394,7 +404,7 @@ package net.systemeD.halcyon.connection {
                }
 
 
-                /** Basic description of Entity - should be overriden by subclass. */
+               /** Basic description of Entity - should be overriden by subclass. */
                public function getDescription():String {
                        var basic:String=this.getType()+" "+_id;
                        if (tags['ref'] && tags['name']) { return tags['ref']+' '+tags['name']+' ('+basic+')'; }