1
|
/**
|
2
|
* Copyright (C) 2015 EDIT
|
3
|
* European Distributed Institute of Taxonomy
|
4
|
* http://www.e-taxonomy.eu
|
5
|
*
|
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.
|
8
|
*/
|
9
|
package eu.etaxonomy.taxeditor.operation;
|
10
|
|
11
|
import java.io.Serializable;
|
12
|
import java.util.UUID;
|
13
|
|
14
|
import org.eclipse.swt.widgets.Display;
|
15
|
|
16
|
import eu.etaxonomy.cdm.api.application.CdmApplicationState;
|
17
|
|
18
|
/**
|
19
|
* Default implementation of the {@link IFeedbackGenerator} interface.
|
20
|
*
|
21
|
* @author cmathew
|
22
|
* @date 29 Oct 2015
|
23
|
*
|
24
|
*/
|
25
|
public abstract class FeedbackGenerator implements IFeedbackGenerator {
|
26
|
|
27
|
|
28
|
/**
|
29
|
* Generates feedback for a waiting remoting progress monitor
|
30
|
*
|
31
|
* @return feedback object
|
32
|
*/
|
33
|
public abstract Serializable generateFeedback();
|
34
|
|
35
|
/**
|
36
|
* {@inheritDoc}
|
37
|
*/
|
38
|
@Override
|
39
|
public void setFeedbackForMonitor(final UUID uuid) {
|
40
|
Display.getDefault().syncExec(new Runnable() {
|
41
|
@Override
|
42
|
public void run() {
|
43
|
CdmApplicationState.getCurrentAppConfig().getProgressMonitorService().setFeedback(uuid, generateFeedback());
|
44
|
}
|
45
|
});
|
46
|
}
|
47
|
|
48
|
}
|