Revision 52d76872
Added by Katja Luther about 5 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/NaturalLanguageDetailElement.java | ||
---|---|---|
20 | 20 |
import org.eclipse.swt.widgets.Display; |
21 | 21 |
|
22 | 22 |
import eu.etaxonomy.cdm.api.service.NaturalLanguageGenerator; |
23 |
import eu.etaxonomy.cdm.model.description.DescriptionBase; |
|
23 | 24 |
import eu.etaxonomy.cdm.model.description.FeatureTree; |
24 |
import eu.etaxonomy.cdm.model.description.TaxonDescription; |
|
25 | 25 |
import eu.etaxonomy.cdm.model.description.TextData; |
26 | 26 |
import eu.etaxonomy.taxeditor.model.AbstractUtility; |
27 | 27 |
import eu.etaxonomy.taxeditor.preference.PreferencesUtil; |
... | ... | |
38 | 38 |
* @created Sep 16, 2010 |
39 | 39 |
* @version 1.0 |
40 | 40 |
*/ |
41 |
public class NaturalLanguageDetailElement extends AbstractCdmDetailElement<TaxonDescription> {
|
|
41 |
public class NaturalLanguageDetailElement extends AbstractCdmDetailElement<DescriptionBase> {
|
|
42 | 42 |
|
43 | 43 |
|
44 | 44 |
private static final Logger logger = Logger |
... | ... | |
59 | 59 |
/** {@inheritDoc} */ |
60 | 60 |
@Override |
61 | 61 |
protected void createControls(ICdmFormElement formElement, |
62 |
TaxonDescription entity, int style) {
|
|
62 |
DescriptionBase entity, int style) {
|
|
63 | 63 |
label = formFactory.createLabel(formElement, "Generating Natural Language Description ..."); |
64 | 64 |
|
65 | 65 |
if(entity.hasStructuredData()){ |
... | ... | |
81 | 81 |
|
82 | 82 |
private class FetchNaturalLanguageDescriptionJob extends Job { |
83 | 83 |
|
84 |
private TaxonDescription entity;
|
|
84 |
private DescriptionBase entity;
|
|
85 | 85 |
private NaturalLanguageGenerator generator = new NaturalLanguageGenerator(); |
86 | 86 |
private FeatureTree featureTree = PreferencesUtil.getDefaultFeatureTreeForStructuredDescription(); |
87 | 87 |
private Display display = Display.getCurrent(); |
88 | 88 |
|
89 |
public FetchNaturalLanguageDescriptionJob(String jobName, TaxonDescription entity){
|
|
89 |
public FetchNaturalLanguageDescriptionJob(String jobName, DescriptionBase entity){
|
|
90 | 90 |
super(jobName); |
91 | 91 |
this.entity = entity; |
92 | 92 |
} |
Also available in: Unified diff
ref #8124: adapt editor to be able to edit NameFacts