Revision 707b6237
Added by Niels Hoffmann over 12 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/ExportManager.java | ||
---|---|---|
16 | 16 |
import org.eclipse.core.runtime.Status; |
17 | 17 |
import org.eclipse.core.runtime.jobs.Job; |
18 | 18 |
import org.eclipse.swt.widgets.Display; |
19 |
import org.eclipse.ui.IWorkbenchPart; |
|
19 | 20 |
|
20 |
import eu.etaxonomy.cdm.api.application.CdmApplicationController;
|
|
21 |
import eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration;
|
|
21 | 22 |
import eu.etaxonomy.cdm.api.conversation.IConversationEnabled; |
22 | 23 |
import eu.etaxonomy.cdm.io.common.CdmDefaultExport; |
23 | 24 |
import eu.etaxonomy.cdm.io.common.IExportConfigurator; |
... | ... | |
40 | 41 |
|
41 | 42 |
/** |
42 | 43 |
* |
43 |
* @param applicationController
|
|
44 |
* @param applicationConfiguration
|
|
44 | 45 |
*/ |
45 |
private ExportManager(CdmApplicationController applicationController) {
|
|
46 |
super(applicationController);
|
|
46 |
private ExportManager(ICdmApplicationConfiguration applicationConfiguration) {
|
|
47 |
super(applicationConfiguration);
|
|
47 | 48 |
} |
48 | 49 |
|
49 | 50 |
/** |
... | ... | |
51 | 52 |
* NewInstance |
52 | 53 |
* </p> |
53 | 54 |
* |
54 |
* @param applicationController
|
|
55 |
* @param applicationConfiguration
|
|
55 | 56 |
* a |
56 | 57 |
* {@link eu.etaxonomy.cdm.api.application.CdmApplicationController} |
57 | 58 |
* object. |
58 | 59 |
* @return a {@link eu.etaxonomy.taxeditor.io.ExportManager} object. |
59 | 60 |
*/ |
60 | 61 |
public static ExportManager NewInstance( |
61 |
CdmApplicationController applicationController) {
|
|
62 |
return new ExportManager(applicationController);
|
|
62 |
ICdmApplicationConfiguration applicationConfiguration) {
|
|
63 |
return new ExportManager(applicationConfiguration);
|
|
63 | 64 |
} |
64 | 65 |
|
65 | 66 |
/** |
... | ... | |
102 | 103 |
CdmDefaultExport<IExportConfigurator> exporter = new CdmDefaultExport<IExportConfigurator>(); |
103 | 104 |
configurator.setProgressMonitor(CdmProgressMonitorAdapter |
104 | 105 |
.CreateSubMonitor(monitor, 80)); |
105 |
exporter.setCdmAppController(applicationController);
|
|
106 |
exporter.setCdmAppController(applicationConfiguration);
|
|
106 | 107 |
monitor.worked(10); |
107 | 108 |
|
108 | 109 |
try { |
... | ... | |
121 | 122 |
|
122 | 123 |
@Override |
123 | 124 |
public void run() { |
124 |
// terminate any open transactions |
|
125 |
IConversationEnabled activePart = (IConversationEnabled) StoreUtil |
|
126 |
.getActivePage().getActivePart(); |
|
127 |
// restarting transaction and committing it to trigger |
|
128 |
// change listener |
|
129 |
// TODO verify correct behaviour |
|
130 |
activePart.getConversationHolder().startTransaction(); |
|
131 |
activePart.getConversationHolder().commit(); |
|
125 |
IWorkbenchPart activePart = StoreUtil.getActivePage() |
|
126 |
.getActivePart(); |
|
127 |
if (activePart instanceof IConversationEnabled) { |
|
128 |
// terminate any open transactions |
|
129 |
IConversationEnabled conversationEnabled = (IConversationEnabled) activePart; |
|
130 |
// restarting transaction and committing it to |
|
131 |
// trigger |
|
132 |
// change listener |
|
133 |
// TODO verify correct behaviour |
|
134 |
conversationEnabled.getConversationHolder() |
|
135 |
.startTransaction(); |
|
136 |
conversationEnabled.getConversationHolder() |
|
137 |
.commit(); |
|
138 |
} |
|
132 | 139 |
} |
133 | 140 |
}); |
134 | 141 |
monitor.worked(10); |
Also available in: Unified diff
Merged with trunk