Project

General

Profile

Download (1.58 KB) Statistics
| Branch: | Tag: | Revision:
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.TaxonNameEditorE4;
18

    
19
/**
20
 *
21
 * @author pplitzner
22
 * @date Aug 24, 2017
23
 *
24
 */
25
public class HomotypicalSynonymGroupE4 extends AbstractHomotypicalGroupContainerE4 {
26

    
27
	public HomotypicalSynonymGroupE4(TaxonNameEditorE4 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
}
(8-8/11)