Revision: 3481
Author: silva.josemanuel1
Date: Fri Apr 30 08:05:38 2010
Log: Fixed the projectMap by having it update its mappings whenever an
object's UUID changes, which happens to all the objects initially created
when loading a workspace since their UUIDs need to be changed to the server
ones.
http://code.google.com/p/power-architect/source/detail?r=3481
Modified:
/trunk/src/main/java/ca/sqlpower/architect/ArchitectProject.java
=======================================
--- /trunk/src/main/java/ca/sqlpower/architect/ArchitectProject.java Thu
Apr 29 08:28:11 2010
+++ /trunk/src/main/java/ca/sqlpower/architect/ArchitectProject.java Fri
Apr 30 08:05:38 2010
@@ -19,6 +19,7 @@
package ca.sqlpower.architect;
+import java.beans.PropertyChangeEvent;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
@@ -98,6 +99,12 @@
public void childRemoved(SPChildEvent e) {
unpopulateTreeMap(e.getChild());
}
+
+ public void propertyChanged(PropertyChangeEvent e) {
+ if (e.getPropertyName().toUpperCase().equals("UUID")) {
+ projectMap.put((String) e.getNewValue(),
projectMap.remove(e.getOldValue()));
+ }
+ }
private void populateTreeMap(SPObject addedChild) {
if (projectMap.put(addedChild.getUUID(), addedChild) != null) {