automated build configuration is on its way
[taxeditor.git] / taxeditor-editor / src / main / java / eu / etaxonomy / taxeditor / editor / name / container / HomotypicalSynonymGroup.java
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.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.TaxonNameEditor;
17
18 /**
19 * <p>HomotypicalSynonymGroup class.</p>
20 *
21 * @author p.ciardelli
22 * @created 13.01.2009
23 * @version 1.0
24 */
25 public class HomotypicalSynonymGroup extends AbstractHomotypicalGroupContainer {
26
27 /**
28 * <p>Constructor for HomotypicalSynonymGroup.</p>
29 *
30 * @param editor a {@link eu.etaxonomy.taxeditor.editor.name.TaxonNameEditor} object.
31 * @param group a {@link eu.etaxonomy.cdm.model.name.HomotypicalGroup} object.
32 */
33 public HomotypicalSynonymGroup(TaxonNameEditor editor, HomotypicalGroup group) {
34 super(editor, group);
35 }
36
37 /* (non-Javadoc)
38 * @see eu.etaxonomy.taxeditor.editor.name.AbstractGroup#createContents()
39 */
40 @Override
41 protected void createContainers() {
42 createSynonymContainer();
43 }
44
45 protected void createSynonymContainer(){
46 int i = 0;
47 int indent = IContainerConstants.SYNONYM_INDENT;
48 Image icon = IContainerConstants.HETEROTYPIC_SYNONYM_ICON;
49 for(Synonym synonym : getSynonyms()){
50 if(i > 0){
51 indent = IContainerConstants.HOMOTYPIC_SYNONYM_IN_HETEROTYPIC_GROUP_INDENT;
52 icon = IContainerConstants.HOMOTYPIC_SYNONYM_IN_HETEROTYPIC_GROUP_ICON;
53 }
54 SynonymContainer container = new SynonymContainer(this, synonym, indent, icon);
55 this.add(container);
56 container.createContent();
57 i++;
58 }
59 }
60
61 /* (non-Javadoc)
62 * @see eu.etaxonomy.taxeditor.editor.name.AbstractHomotypicalGroupContainer#redrawNeeded(eu.etaxonomy.cdm.model.name.HomotypicalGroup)
63 */
64 @Override
65 protected boolean redrawNeeded(HomotypicalGroup homotypicalGroup) {
66 return super.redrawNeeded(homotypicalGroup);
67 }
68 }