Cleaning up ProtologueSection #5638
[taxeditor.git] / eu.etaxonomy.taxeditor.store / src / main / java / eu / etaxonomy / taxeditor / operation / FeedbackGenerator.java
1 // $Id$
2 /**
3 * Copyright (C) 2015 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
6 *
7 * The contents of this file are subject to the Mozilla Public License Version 1.1
8 * See LICENSE.TXT at the top of this package for the full license terms.
9 */
10 package eu.etaxonomy.taxeditor.operation;
11
12 import java.io.Serializable;
13 import java.util.UUID;
14
15 import org.eclipse.swt.widgets.Display;
16
17 import eu.etaxonomy.cdm.api.application.CdmApplicationState;
18
19 /**
20 * Default implementation of the {@link IFeedbackGenerator} interface.
21 *
22 * @author cmathew
23 * @date 29 Oct 2015
24 *
25 */
26 public abstract class FeedbackGenerator implements IFeedbackGenerator {
27
28
29 /**
30 * Generates feedback for a waiting remoting progress monitor
31 *
32 * @return feedback object
33 */
34 public abstract Serializable generateFeedback();
35
36 /**
37 * {@inheritDoc}
38 */
39 @Override
40 public void setFeedbackForMonitor(final UUID uuid) {
41 Display.getDefault().syncExec(new Runnable() {
42 @Override
43 public void run() {
44 CdmApplicationState.getCurrentAppConfig().getProgressMonitorService().setFeedback(uuid, generateFeedback());
45 }
46 });
47 }
48
49 }