]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.export.core/src/org/simantics/export/core/manager/ExportAction.java
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.export.core / src / org / simantics / export / core / manager / ExportAction.java
1 package org.simantics.export.core.manager;\r
2 \r
3 import java.util.List;\r
4 \r
5 import org.eclipse.core.runtime.IProgressMonitor;\r
6 import org.simantics.databoard.binding.mutable.Variant;\r
7 import org.simantics.export.core.ExportContext;\r
8 import org.simantics.export.core.error.ExportException;\r
9 \r
10 /**\r
11  * A single article of export action in an export plan.\r
12  *\r
13  * @author toni.kalajainen@semantum.fi\r
14  */\r
15 public abstract class ExportAction {\r
16         \r
17         /**\r
18          * Execute export action.\r
19          * \r
20          * @param ctx\r
21          * @param progress\r
22          * @param options\r
23          * @throws ExportException\r
24          */\r
25         public abstract void execute(ExportContext ctx, IProgressMonitor progress, Variant options)\r
26                         throws ExportException;\r
27         \r
28         /**\r
29          * Get the label for this action to be used in user interface.\r
30          * \r
31          * @param ctx\r
32          * @return the label for this action.\r
33          */\r
34         public abstract String label(ExportContext ctx);\r
35         \r
36         /**\r
37          * Get the amount of work in this action (used in progress bar).\r
38          * \r
39          * @param ctx\r
40          * @return the amount of work\r
41          */\r
42         public abstract int work(ExportContext ctx);\r
43         \r
44         /**\r
45          * Validate action is executable\r
46          * \r
47          * @param ctx\r
48          * @param options\r
49          * @return null or a label describing the expected problem\r
50          */\r
51         public abstract List<String> validate(ExportContext ctx, Variant options);\r
52         \r
53         /**\r
54          * Cancel and cleanup the output of this action. Deletes temporary files. \r
55          * \r
56          * @param ctx\r
57          * @param progress\r
58          * @param options\r
59          * @throws ExportException\r
60          */\r
61         public abstract void cleanup(ExportContext ctx, IProgressMonitor progress, Variant options) throws ExportException;\r
62         \r
63 }\r