1
|
/**
|
2
|
* Copyright (C) 2007 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
|
|
10
|
package eu.etaxonomy.taxeditor.editor.name.e4.container;
|
11
|
|
12
|
import org.eclipse.swt.graphics.Image;
|
13
|
|
14
|
import eu.etaxonomy.cdm.model.name.HomotypicalGroup;
|
15
|
import eu.etaxonomy.cdm.model.taxon.Synonym;
|
16
|
import eu.etaxonomy.taxeditor.editor.name.container.IContainerConstants;
|
17
|
import eu.etaxonomy.taxeditor.editor.name.e4.TaxonEditor;
|
18
|
|
19
|
/**
|
20
|
*
|
21
|
* @author pplitzner
|
22
|
* @date Aug 24, 2017
|
23
|
*
|
24
|
*/
|
25
|
public class HomotypicalSynonymGroup extends AbstractHomotypicalGroupContainer {
|
26
|
|
27
|
public HomotypicalSynonymGroup(TaxonEditor editor, HomotypicalGroup group) {
|
28
|
super(editor, group);
|
29
|
}
|
30
|
|
31
|
@Override
|
32
|
protected void createContainers() {
|
33
|
createSynonymContainer();
|
34
|
}
|
35
|
|
36
|
@Override
|
37
|
protected void createSynonymContainer(){
|
38
|
int i = 0;
|
39
|
int indent = IContainerConstants.SYNONYM_INDENT;
|
40
|
Image icon = IContainerConstants.HETEROTYPIC_SYNONYM_ICON;
|
41
|
for(Synonym synonym : getSynonyms()){
|
42
|
if(i > 0){
|
43
|
indent = IContainerConstants.HOMOTYPIC_SYNONYM_IN_HETEROTYPIC_GROUP_INDENT;
|
44
|
icon = IContainerConstants.HOMOTYPIC_SYNONYM_IN_HETEROTYPIC_GROUP_ICON;
|
45
|
}
|
46
|
SynonymContainerE4 container = new SynonymContainerE4(this, synonym, indent, icon);
|
47
|
this.add(container);
|
48
|
container.createContent();
|
49
|
i++;
|
50
|
}
|
51
|
}
|
52
|
|
53
|
@Override
|
54
|
protected boolean redrawNeeded(HomotypicalGroup homotypicalGroup) {
|
55
|
return super.redrawNeeded(homotypicalGroup);
|
56
|
}
|
57
|
}
|