Graphics/ModuleItem.py

changeset 2030
db11a2fe9bbc
parent 1509
c0b5e693b0eb
child 2032
704593d042fe
diff -r 30247d523fdb -r db11a2fe9bbc Graphics/ModuleItem.py
--- a/Graphics/ModuleItem.py	Sat Sep 08 18:20:46 2012 +0200
+++ b/Graphics/ModuleItem.py	Sun Sep 09 14:46:59 2012 +0200
@@ -161,3 +161,31 @@
         painter.drawLine(offsetX, offsetY + y, offsetX + w - 1, offsetY + y)
         
         self.adjustAssociations()
+    
+    def buildItemDataString(self):
+        """
+        Public method to build a string to persist the specific item data.
+        
+        This string must start with ", " and should be built like
+        "attribute=value" with pairs separated by ", ". value must not contain ", "
+        or newlines.
+        
+        @return persistence data (string)
+        """
+        entries = [
+            "item_type=module",
+            "name={0}".format(self.model.getName()),
+        ]
+        classes = self.model.getClasses()
+        if classes:
+            entries.append("classes={0}".format("||".join(classes)))
+        
+        return ", " + ", ".join(entries)
+    
+    def parseItemDataString(self, data):
+        """
+        Public method to parse the given persistence data.
+        
+        @param data persisted data to be parsed (string)
+        """
+        # TODO: implement this

eric ide

mercurial