2 * Copyright (C) 2007 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
6 * The contents of this file are subject to the Mozilla Public License Version 1.1
7 * See LICENSE.TXT at the top of this package for the full license terms.
10 package eu
.etaxonomy
.taxeditor
.model
;
12 import java
.io
.BufferedWriter
;
14 import java
.io
.FileOutputStream
;
15 import java
.io
.OutputStreamWriter
;
16 import java
.io
.Writer
;
17 import java
.text
.SimpleDateFormat
;
18 import java
.util
.ArrayList
;
19 import java
.util
.Calendar
;
20 import java
.util
.Collection
;
21 import java
.util
.LinkedHashMap
;
22 import java
.util
.List
;
25 import java
.util
.TreeSet
;
26 import java
.util
.UUID
;
27 import java
.util
.zip
.ZipEntry
;
28 import java
.util
.zip
.ZipOutputStream
;
30 import org
.apache
.commons
.lang
.StringUtils
;
31 import org
.apache
.log4j
.Logger
;
32 import org
.eclipse
.core
.commands
.ExecutionException
;
33 import org
.eclipse
.core
.commands
.operations
.AbstractOperation
;
34 import org
.eclipse
.core
.commands
.operations
.IOperationHistory
;
35 import org
.eclipse
.core
.runtime
.IAdaptable
;
36 import org
.eclipse
.core
.runtime
.ICoreRunnable
;
37 import org
.eclipse
.core
.runtime
.IProgressMonitor
;
38 import org
.eclipse
.core
.runtime
.IStatus
;
39 import org
.eclipse
.core
.runtime
.NullProgressMonitor
;
40 import org
.eclipse
.core
.runtime
.OperationCanceledException
;
41 import org
.eclipse
.core
.runtime
.Status
;
42 import org
.eclipse
.core
.runtime
.SubProgressMonitor
;
43 import org
.eclipse
.core
.runtime
.jobs
.Job
;
44 import org
.eclipse
.e4
.ui
.di
.UISynchronize
;
45 import org
.eclipse
.e4
.ui
.model
.application
.ui
.basic
.MPart
;
46 import org
.eclipse
.e4
.ui
.workbench
.modeling
.EPartService
;
47 import org
.eclipse
.jface
.action
.IStatusLineManager
;
48 import org
.eclipse
.jface
.viewers
.IStructuredSelection
;
49 import org
.eclipse
.jface
.viewers
.SelectionChangedEvent
;
50 import org
.eclipse
.swt
.graphics
.Color
;
51 import org
.eclipse
.swt
.graphics
.Font
;
52 import org
.eclipse
.swt
.widgets
.Display
;
53 import org
.eclipse
.swt
.widgets
.Shell
;
54 import org
.eclipse
.ui
.IWorkbench
;
55 import org
.eclipse
.ui
.PlatformUI
;
56 import org
.eclipse
.ui
.ide
.undo
.WorkspaceUndoUtil
;
57 import org
.eclipse
.ui
.progress
.IProgressConstants
;
59 import eu
.etaxonomy
.cdm
.api
.application
.CdmApplicationState
;
60 import eu
.etaxonomy
.cdm
.api
.service
.IProgressMonitorService
;
61 import eu
.etaxonomy
.cdm
.api
.service
.UpdateResult
;
62 import eu
.etaxonomy
.cdm
.common
.monitor
.IRemotingProgressMonitor
;
63 import eu
.etaxonomy
.cdm
.io
.common
.ExportDataWrapper
;
64 import eu
.etaxonomy
.cdm
.io
.common
.ExportResult
;
65 import eu
.etaxonomy
.cdm
.io
.common
.ExportResultType
;
66 import eu
.etaxonomy
.cdm
.io
.common
.ExportType
;
67 import eu
.etaxonomy
.cdm
.model
.common
.IEnumTerm
;
68 import eu
.etaxonomy
.taxeditor
.event
.EventUtility
;
69 import eu
.etaxonomy
.taxeditor
.operation
.AbstractPostOperation
;
70 import eu
.etaxonomy
.taxeditor
.operation
.IFeedbackGenerator
;
71 import eu
.etaxonomy
.taxeditor
.operation
.IPostMoniteredOperationEnabled
;
72 import eu
.etaxonomy
.taxeditor
.operation
.IPostOperationEnabled
;
73 import eu
.etaxonomy
.taxeditor
.operation
.e4
.RemotingCdmHandlerE4
;
74 import eu
.etaxonomy
.taxeditor
.store
.CdmStore
;
75 import eu
.etaxonomy
.taxeditor
.store
.internal
.TaxeditorStorePlugin
;
76 import eu
.etaxonomy
.taxeditor
.ui
.dialog
.ReportTextDialog
;
77 import eu
.etaxonomy
.taxeditor
.view
.e4
.AbstractCdmDataViewerE4
;
78 import eu
.etaxonomy
.taxeditor
.view
.e4
.details
.DetailsPartE4
;
79 import eu
.etaxonomy
.taxeditor
.workbench
.part
.IE4SavablePart
;
87 public abstract class AbstractUtility
{
89 protected static final Logger logger
= Logger
.getLogger(AbstractUtility
.class);
91 /** Constant <code>statusLineManager</code> */
92 protected static IStatusLineManager statusLineManager
;
93 /** Constant <code>DATE_FORMAT_NOW="yyyyMMddHHmm"</code> */
94 public static final String DATE_FORMAT_NOW
= "yyyyMMddHHmm";
96 public static Object
getActivePart() {
97 MPart activePart
= EventUtility
.getActivePart();
99 return activePart
.getObject();
104 public static Shell
getShell() {
105 return EventUtility
.getShell();
108 public static IWorkbench
getWorkbench() {
109 return TaxeditorStorePlugin
.getDefault().getWorkbench();
112 public static Object
getService(Class api
) {
113 return TaxeditorStorePlugin
.getDefault().getWorkbench().getService(api
);
116 public static Font
getFont(String symbolicName
) {
117 return FontResources
.getFont(symbolicName
);
120 public static Color
getColor(String symbolicName
) {
121 return ColorResources
.getColor(symbolicName
);
124 public static IStatus
executeOperation(final AbstractPostOperation operation
, UISynchronize sync
) {
125 if (getOperationHistory() == null) {
126 throw new IllegalArgumentException(
127 "There is no operation history for this context");
130 final IAdaptable uiInfoAdapter
= WorkspaceUndoUtil
131 .getUIInfoAdapter(getShell());
133 Job job
= Job
.create(operation
.getLabel(), (ICoreRunnable
) monitor
-> {
134 sync
.syncExec(() -> {
135 String operationlabel
= operation
.getLabel();
136 monitor
.beginTask(operationlabel
, 100);
137 IStatus status
= Status
.CANCEL_STATUS
;
139 operation
.addContext(IOperationHistory
.GLOBAL_UNDO_CONTEXT
);
140 status
= operation
.execute(monitor
, uiInfoAdapter
);
141 } catch (ExecutionException e
) {
143 MessagingUtils
.operationDialog(AbstractUtility
.class, e
, TaxeditorStorePlugin
.PLUGIN_ID
, operationlabel
, null);
149 String statusString
= status
.equals(Status
.OK_STATUS
) ?
"completed"
151 setStatusLine(operationlabel
+ " " + statusString
+ ".");
152 IPostOperationEnabled postOperationEnabled
= operation
153 .getPostOperationEnabled();
154 if (postOperationEnabled
!= null) {
155 postOperationEnabled
.onComplete();
163 } catch (Exception e
) {
164 MessagingUtils
.messageDialog("Error executing operation", AbstractUtility
.class, "An error occurred while executing " + operation
.getLabel(), e
);
167 return Status
.OK_STATUS
;
170 public static IStatus
executeOperation(final AbstractOperation operation
, final RemotingCdmHandlerE4 handler
, UISynchronize sync
) {
171 return executeOperation_internal(operation
, handler
, sync
);
174 private static IStatus
executeOperation_internal(final AbstractOperation operation
, final RemotingCdmHandlerE4 handler
,
175 UISynchronize sync
) {
176 if (getOperationHistory() == null) {
177 throw new IllegalArgumentException(
178 "There is no operation history for this context");
181 final IAdaptable uiInfoAdapter
= WorkspaceUndoUtil
182 .getUIInfoAdapter(getShell());
185 Job job
= Job
.create(operation
.getLabel(), (ICoreRunnable
) monitor
-> {
186 sync
.syncExec(() -> {
187 String operationlabel
= operation
.getLabel();
188 monitor
.beginTask(operationlabel
, 100);
189 IStatus status
= Status
.CANCEL_STATUS
;
191 operation
.addContext(IOperationHistory
.GLOBAL_UNDO_CONTEXT
);
192 status
= operation
.execute(monitor
,
194 handler
.postOperation(status
);
195 } catch (ExecutionException e
) {
196 MessagingUtils
.operationDialog(AbstractUtility
.class, e
, TaxeditorStorePlugin
.PLUGIN_ID
, operationlabel
, null);
201 String statusString
= status
.equals(Status
.OK_STATUS
) ?
"completed"
203 setStatusLine(operationlabel
+ " " + statusString
+ ".");
209 sync
.syncExec(()->job
.schedule());
210 } catch (Exception e
) {
211 MessagingUtils
.messageDialog("Error executing operation", AbstractUtility
.class, "An error occurred while executing " + operation
.getLabel(), e
);
214 return Status
.OK_STATUS
;
218 * Executes a remoting monitored operation
220 * @param label for the operation
221 * @param uuid of the remoting monitor already started on the server
222 * @param pollInterval in milliseconds
223 * @param cancelable flag which determines whether the operation can be cancelled
224 * @param postOp callback for running post operation logic
227 public static IStatus
executeMoniteredExport(final String label
,
229 final int pollInterval
,
230 final boolean cancelable
,
231 final IPostMoniteredOperationEnabled postOp
,
232 final IFeedbackGenerator feedbackGenerator
,
237 // get the remoting monitor the first time to make sure that the
238 // operation is valid
239 final IProgressMonitorService progressMonitorService
= CdmApplicationState
.getCurrentAppConfig().getProgressMonitorService();
240 // final IRemotingProgressMonitor firstRemotingMonitor = progressMonitorService.getRemotingMonitor(uuid);
241 // if(firstRemotingMonitor == null) {
242 // throw new IllegalStateException("Remoting progress monitor is null");
245 Job job
= new Job(label
) {
249 public IStatus
run(IProgressMonitor monitor
) {
250 // run the monitor until the operation is finished
251 monitor
.beginTask("Start", 100);
252 IRemotingProgressMonitor remotingMonitor
;
254 remotingMonitor
= CdmStore
.getProgressMonitorClientManager().pollMonitor(label
,
260 } catch (Exception ex
) {
261 return new Status(Status
.ERROR
, TaxeditorStorePlugin
.PLUGIN_ID
, "Operation Interrupted", ex
);
263 final StringBuilder reportSb
= new StringBuilder();
264 if (remotingMonitor
.getResult() instanceof ExportResult
){
265 ExportResult result
= (ExportResult
)remotingMonitor
.getResult();
267 reportSb
.append(result
.createReport());
269 if(!StringUtils
.isBlank(reportSb
.toString())) {
270 Display
.getDefault().asyncExec(new Runnable() {
273 // display reports with possibility to save
274 ReportTextDialog dialog
= new ReportTextDialog(PlatformUI
.getWorkbench().getActiveWorkbenchWindow().getShell());
275 dialog
.setTitle(label
+ " Report");
276 dialog
.setReportText(reportSb
.toString());
282 if (urlString
!= null){
283 ExportDataWrapper data
= result
.getExportData();
285 if (result
.getExportData().getType().equals(ExportResultType
.BYTE_ARRAY
)){
286 byte[] exportData
= (byte[])data
.getExportData();
287 if(exportData
!= null){
288 File file
= new File(urlString
);
289 FileOutputStream stream
= new FileOutputStream(file
);
290 Writer out
= new BufferedWriter(new OutputStreamWriter(
293 stream
.write(exportData
);
297 } else if (result
.getExportData().getType().equals(ExportResultType
.MAP_BYTE_ARRAY
)){
298 Map
<String
, byte[]> resultMap
= (Map
<String
, byte[]>)data
.getExportData();
299 Set
<String
> keySet
= resultMap
.keySet();
300 SimpleDateFormat sdf
= new SimpleDateFormat(DATE_FORMAT_NOW
);
301 Calendar cal
= Calendar
.getInstance();
302 String fileEnding
= ".csv";
305 File file
= new File(urlString
+File
.separator
+ sdf
.format(cal
.getTime())+ ".zip");
306 FileOutputStream stream
= new FileOutputStream(file
);
307 ZipOutputStream zos
= new ZipOutputStream(stream
);
308 for (String key
: keySet
){
309 byte[] fileData
= resultMap
.get(key
);
310 ZipEntry entry
= new ZipEntry( key
+ fileEnding
);
311 zos
.putNextEntry(entry
);
317 if(result
.getExportType().equals(ExportType
.DWCA
)){
319 File file
= new File(urlString
);
320 FileOutputStream stream
= new FileOutputStream(file
);
321 ZipOutputStream zos
= new ZipOutputStream(stream
);
322 for (String key
: keySet
){
323 byte[] fileData
= resultMap
.get(key
);
324 ZipEntry entry
= new ZipEntry( key
);
325 zos
.putNextEntry(entry
);
331 for (String key
: keySet
){
332 byte[] fileData
= resultMap
.get(key
);
333 File file
= new File(urlString
+File
.separator
+ key
+ fileEnding
);
334 FileOutputStream stream
= new FileOutputStream(file
);
335 Writer out
= new BufferedWriter(new OutputStreamWriter(
337 stream
.write(fileData
);
343 logger
.error("This kind of result data is not supported yet." + result
.getExportData().getType().toString());
345 } catch(Exception e
){
346 logger
.error(e
.getStackTrace());
350 return Status
.OK_STATUS
;
354 protected void canceling() {
355 CdmStore
.getCurrentApplicationConfiguration().getProgressMonitorService().cancel(uuid
);
360 job
.setProperty(IProgressConstants
.KEEP_PROPERTY
, true);
365 } catch (Exception e
) {
366 MessagingUtils
.errorDialog("Error executing operation",
367 AbstractUtility
.class,
368 "An error occurred while executing " + label
,
369 TaxeditorStorePlugin
.PLUGIN_ID
,
374 return Status
.OK_STATUS
;
377 public static IOperationHistory
getOperationHistory() {
378 return getWorkbench().getOperationSupport().getOperationHistory();
381 public static void setStatusLine(final String message
) {
382 Display
.getDefault().asyncExec(new Runnable() {
386 statusLineManager
.setMessage(message
);
393 public static IProgressMonitor
getMonitor() {
394 statusLineManager
.setCancelEnabled(false);
395 return statusLineManager
.getProgressMonitor();
399 * Starts either the given {@link IProgressMonitor} if it's not
400 * <code>null</code> or a new {@link NullProgressMonitor}.
402 * @param progressMonitor
403 * The {@link IProgressMonitor} or <code>null</code> if no
404 * progress should be reported.
406 * The name of the main task.
408 * The number of steps this task is subdivided into.
409 * @return The {@link IProgressMonitor}.
411 public static IProgressMonitor
startMainMonitor(
412 IProgressMonitor progressMonitor
, String taskName
, int steps
) {
413 IProgressMonitor newMonitor
= progressMonitor
;
414 if (newMonitor
== null) {
415 newMonitor
= new NullProgressMonitor();
417 newMonitor
.beginTask(taskName
== null ?
"" : taskName
, steps
);
418 newMonitor
.subTask(" ");
423 * Creates a {@link SubProgressMonitor} if the given
424 * {@link IProgressMonitor} is not <code>null</code> and not a
425 * {@link NullProgressMonitor}.
427 * @param progressMonitor
428 * The parent {@link IProgressMonitor} of the
429 * {@link SubProgressMonitor} to be created.
431 * The number of steps this subtask is subdivided into. Must be a
432 * positive number and must not be
433 * {@link IProgressMonitor#UNKNOWN}.
434 * @return The {@link IProgressMonitor}.
436 public static IProgressMonitor
getSubProgressMonitor(
437 IProgressMonitor progressMonitor
, int ticks
) {
438 if (progressMonitor
== null) {
439 return new NullProgressMonitor();
441 if (progressMonitor
instanceof NullProgressMonitor
) {
442 return progressMonitor
;
445 return new SubProgressMonitor(progressMonitor
, ticks
);
449 * Checks whether the user canceled this operation. If not canceled, the
450 * given number of steps are declared as done.
453 * a {@link org.eclipse.core.runtime.IProgressMonitor} object.
457 public static void workedChecked(IProgressMonitor newMonitor
, int steps
) {
458 // In case the progress monitor was canceled throw an exception.
459 if (newMonitor
.isCanceled()) {
460 throw new OperationCanceledException();
462 // Otherwise declare this step as done.
463 newMonitor
.worked(steps
);
466 public static String
getPluginId() {
467 return "eu.taxeditor";
470 public static Object
getActiveEditor() {
471 MPart activePart
= EventUtility
.getActivePart();
472 if(activePart
!=null && activePart
.getObject()!=null
473 && activePart
.getObject() instanceof IE4SavablePart
){
474 return activePart
.getObject();
479 public static DetailsPartE4
getDetailsView(EPartService partService
) {
480 MPart part
= partService
.findPart("eu.etaxonomy.taxeditor.view.e4.details.DetailsPartE4");
482 return (DetailsPartE4
) part
.getObject();
487 public static void refreshDetailsViewer(EPartService partService
) {
488 if (getDetailsView(partService
) != null) {
489 ((AbstractCdmDataViewerE4
) getDetailsView(partService
).getViewer()).refresh();
493 public static void reflowDetailsViewer(EPartService partService
) {
494 if (getDetailsView(partService
) != null) {
495 ((AbstractCdmDataViewerE4
) getDetailsView(partService
).getViewer()).reflow();
501 * Orders a Collection of {@link IEnumTerm}s according to the term
504 * The returned map will be be ordered primarily by root elements,
505 * secondarily by the child elements and their children resp., both ascending alphabetically. <br>
507 * A {@link Collection} of {@link IEnumTerm}s for which the term
508 * hierarchy should be created
509 * @return a map which holds the terms as keys and their string
510 * representation via {@link IEnumTerm#getMessage()} as values
512 public static <T
extends IEnumTerm
<T
>> LinkedHashMap
<T
, String
> orderTerms(Collection
<T
> terms
) {
513 TreeSet
<TermNode
<T
>> parentElements
= new TreeSet
<TermNode
<T
>>();
514 parentElements
.addAll(getTermHierarchy(terms
));
516 // create list according to the type hierarchy (root elements alphabetically with recursive children also alphabetically)
517 LinkedHashMap
<T
, String
> result
= new LinkedHashMap
<T
, String
>();
518 parseTermTree(parentElements
, result
, -1);
522 private static<T
extends IEnumTerm
<T
>> void parseTermTree(Collection
<TermNode
<T
>> children
, LinkedHashMap
<T
, String
> result
, int depth
){
524 for(TermNode
<T
> node
:children
){
525 String indentString
= "";
526 for(int i
=0;i
<depth
;i
++){
530 indentString
+= "- ";
532 result
.put(node
.term
, indentString
+ node
.term
.getMessage());
533 parseTermTree(node
.children
, result
, depth
);
537 private static<T
extends IEnumTerm
<T
>> void addToParents(List
<TermNode
<T
>> parents
, Collection
<T
> terms
){
538 List
<TermNode
<T
>> hasChildrenList
= new ArrayList
<TermNode
<T
>>();
540 // only terms with parents
541 if(term
.getKindOf()!=null){
542 TermNode
<T
> parentNode
= new TermNode
<T
>(term
.getKindOf());
543 TermNode
<T
> childNode
= new TermNode
<T
>(term
);
544 if(parents
.contains(parentNode
)){
545 // parent found in parent list -> add this term to parent's child list
546 parents
.get(parents
.indexOf(parentNode
)).addChild(childNode
);
547 if(!term
.getGeneralizationOf().isEmpty()){
548 // has more children -> add to list which will be the parent for the next recursion
549 hasChildrenList
.add(childNode
);
554 if(!hasChildrenList
.isEmpty()){
555 addToParents(hasChildrenList
, terms
);
559 private static<T
extends IEnumTerm
<T
>> List
<TermNode
<T
>> getTermHierarchy(Collection
<T
> terms
){
560 List
<TermNode
<T
>> parents
= new ArrayList
<TermNode
<T
>>();
563 T parentTerm
= term
.getKindOf();
564 if(parentTerm
==null){
566 parents
.add(new TermNode
<T
>(term
));
569 addToParents(parents
, terms
);
573 @SuppressWarnings("unchecked")
575 * Recursively iterates over all term parents until no more parent is found i.e. the root node
576 * @param term The term for which the parent should be found
577 * @return the root terms of the term hierarchy
579 private static<T
extends IEnumTerm
<T
>> T
getParentFor(T term
){
580 // PP: cast should be safe. Why is Eclipse complaining??
581 T parent
= term
.getKindOf();
586 return getParentFor(term
.getKindOf());
590 private static class TermNode
<T
extends IEnumTerm
<T
>> implements Comparable
<TermNode
<T
>>{
591 private final T term
;
592 private final TreeSet
<TermNode
<T
>> children
;
594 public TermNode(T term
) {
597 this.children
= new TreeSet
<TermNode
<T
>>();
600 public void addChild(TermNode
<T
> child
){
601 this.children
.add(child
);
604 public TreeSet
<TermNode
<T
>> getChildren() {
613 public int hashCode() {
614 final int prime
= 31;
616 result
= prime
* result
+ ((term
== null) ?
0 : term
.hashCode());
621 public boolean equals(Object obj
) {
628 if (getClass() != obj
.getClass()) {
631 TermNode other
= (TermNode
) obj
;
633 if (other
.term
!= null) {
636 } else if (!term
.equals(other
.term
)) {
643 public int compareTo(TermNode
<T
> that
) {
644 return this.term
.getMessage().compareTo(that
.term
.getMessage());
648 public static Object
getElementsFromSelectionChangedEvent(SelectionChangedEvent event
) {
649 IStructuredSelection selection
= (IStructuredSelection
) event
.getSelection();
650 Object selectionToSet
= selection
;
651 if(selection
.size() == 1){
652 selectionToSet
= selection
.getFirstElement();
654 else if(!selection
.isEmpty()){
655 selectionToSet
= selection
.toArray();
657 return selectionToSet
;
661 * Executes a remoting monitored import
663 * @param label for the import
664 * @param uuid of the remoting monitor already started on the server
665 * @param pollInterval in milliseconds
666 * @param cancelable flag which determines whether the operation can be cancelled
667 * @param postOp callback for running post operation logic
670 public static IStatus
executeMoniteredOperation(final String label
,
672 final int pollInterval
,
673 final boolean cancelable
,
674 final IPostMoniteredOperationEnabled postOp
,
675 final IFeedbackGenerator feedbackGenerator
) {
678 // get the remoting monitor the first time to make sure that the
679 // operation is valid
680 final IProgressMonitorService progressMonitorService
= CdmApplicationState
.getCurrentAppConfig().getProgressMonitorService();
681 final IRemotingProgressMonitor firstRemotingMonitor
= progressMonitorService
.getRemotingMonitor(uuid
);
682 if(firstRemotingMonitor
== null) {
683 throw new IllegalStateException("Remoting progress monitor is null");
686 Job job
= new Job(label
) {
690 public IStatus
run(IProgressMonitor monitor
) {
691 // run the monitor until the operation is finished
692 monitor
.beginTask("Start", 100);
693 IRemotingProgressMonitor remotingMonitor
;
695 remotingMonitor
= CdmStore
.getProgressMonitorClientManager().pollMonitor(label
,
701 } catch (Exception ex
) {
702 return new Status(Status
.ERROR
, TaxeditorStorePlugin
.PLUGIN_ID
, "Operation Interrupted", ex
);
704 final StringBuilder reportSb
= new StringBuilder();
706 // for(String report : remotingMonitor.getResult()) {
707 if (remotingMonitor
.getResult() instanceof ExportResult
) {
708 reportSb
.append(((ExportResult
)remotingMonitor
.getResult()).createReport());
709 }else if (remotingMonitor
.getResult() instanceof UpdateResult
){
710 if (((UpdateResult
)remotingMonitor
.getResult()).isOk()){
711 reportSb
.append("Update successfull. \n"+"Updated Objects: " + ((UpdateResult
)remotingMonitor
.getResult()).getUpdatedObjects().size());
713 if (!((UpdateResult
)remotingMonitor
.getResult()).getExceptions().isEmpty()){
714 reportSb
.append(((UpdateResult
)remotingMonitor
.getResult()).getExceptions().toString());
718 if(!StringUtils
.isBlank(reportSb
.toString()) && reportSb
.length() != 0) {
719 Display
.getDefault().asyncExec(new Runnable() {
722 // display reports with possibility to save
723 ReportTextDialog dialog
= new ReportTextDialog(PlatformUI
.getWorkbench().getActiveWorkbenchWindow().getShell());
724 dialog
.setTitle(label
+ " Report");
725 dialog
.setReportText(reportSb
.toString());
730 return Status
.OK_STATUS
;
734 protected void canceling() {
735 CdmStore
.getCurrentApplicationConfiguration().getProgressMonitorService().cancel(uuid
);
740 job
.setProperty(IProgressConstants
.KEEP_PROPERTY
, true);
745 } catch (Exception e
) {
746 MessagingUtils
.errorDialog("Error executing operation",
747 AbstractUtility
.class,
748 "An error occurred while executing " + label
,
749 TaxeditorStorePlugin
.PLUGIN_ID
,
754 return Status
.OK_STATUS
;