1 package net.systemeD.halcyon.connection.actions {
3 import net.systemeD.halcyon.connection.*;
5 public class SetTagKeyAction extends UndoableEntityAction {
6 private var oldKey:String;
7 private var newKey:String;
9 public function SetTagKeyAction(entity:Entity, oldKey:String, newKey:String) {
10 super(entity, "Rename tag "+oldKey+"->"+newKey);
15 public override function doAction():uint {
16 var tags:Object = entity.getTagsHash();
17 var value:String = tags[oldKey];
18 if ( oldKey != newKey ) {
22 entity.dispatchEvent(new TagEvent(Connection.TAG_CHANGED, entity, oldKey, newKey, value, value));
29 public override function undoAction():uint {
30 var tags:Object = entity.getTagsHash();
31 var value:String = tags[newKey];
35 entity.dispatchEvent(new TagEvent(Connection.TAG_CHANGED, entity, newKey, oldKey, value, value));