]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.export.core/src/org/simantics/export/core/manager/ExportPlan.java
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.export.core / src / org / simantics / export / core / manager / ExportPlan.java
diff --git a/bundles/org.simantics.export.core/src/org/simantics/export/core/manager/ExportPlan.java b/bundles/org.simantics.export.core/src/org/simantics/export/core/manager/ExportPlan.java
new file mode 100644 (file)
index 0000000..d94f4f8
--- /dev/null
@@ -0,0 +1,37 @@
+package org.simantics.export.core.manager;\r
+\r
+import java.util.ArrayList;\r
+import java.util.List;\r
+\r
+import org.simantics.export.core.ExportContext;\r
+\r
+public class ExportPlan {\r
+\r
+       public String label = "Export action";\r
+       \r
+       /** A list of actions */\r
+       List<ExportAction> actions = new ArrayList<ExportAction>();\r
+       \r
+       /** Expected outcome */\r
+       List<Content> manifest = new ArrayList<Content>(); \r
+       \r
+       public void addAction(ExportAction action) {\r
+               actions.add( action );\r
+       }\r
+       \r
+       public void addToManifest(Content content) {\r
+               manifest.add( content );\r
+       }\r
+       \r
+       public int totalWork(ExportContext ctx) {\r
+               int total = 0;\r
+               for (ExportAction action : actions)\r
+                       total += action.work(ctx);\r
+               return total;\r
+       }\r
+       \r
+       public List<Content> getManifest() {\r
+               return manifest;\r
+       }\r
+\r
+}\r