4 package eu
.etaxonomy
.taxeditor
.editor
.labels
;
6 import java
.util
.SortedSet
;
8 import org
.eclipse
.swt
.graphics
.Image
;
10 import eu
.etaxonomy
.cdm
.model
.name
.NameRelationship
;
11 import eu
.etaxonomy
.cdm
.model
.name
.NameRelationshipType
;
12 import eu
.etaxonomy
.taxeditor
.model
.ImageResources
;
13 import eu
.etaxonomy
.taxeditor
.store
.VocabularyStore
;
19 public class DefaultLabelStrategy
implements ILabelImageStrategy
{
22 * @see eu.etaxonomy.taxeditor.editor.labels.IEditorLabelStrategy#getNameRelationTypeLabel(eu.etaxonomy.cdm.model.name.NameRelationshipType)
24 public String
getNameRelationTypeLabel(NameRelationshipType type
) {
25 SortedSet
<NameRelationshipType
> vocab
=
26 VocabularyStore
.getNameRelationshipTypes();
28 for (NameRelationshipType type1
: vocab
) {
29 if (type1
.equals(type
)) {
30 return type1
.getLabel();
37 * @see eu.etaxonomy.taxeditor.editor.labels.IEditorLabelStrategy#getNameRelationInverseTypeLabel(eu.etaxonomy.cdm.model.name.NameRelationshipType)
39 public String
getNameRelationTypeInverseLabel(NameRelationshipType type
) {
41 SortedSet
<NameRelationshipType
> vocab
=
42 VocabularyStore
.getNameRelationshipTypes();
44 for (NameRelationshipType type1
: vocab
) {
45 if (type1
.equals(type
)) {
46 return type1
.getInverseLabel();
53 * @see eu.etaxonomy.taxeditor.editor.labels.ILabelImageStrategy#getNameRelationImage(eu.etaxonomy.cdm.model.name.NameRelationship)
55 public Image
getNameRelationImage(NameRelationship relation
) {
56 if (relation
.getType().equals(NameRelationshipType
.BASIONYM())) {
57 return ImageResources
.getImage(
58 ImageResources
.BASIONYM_ICON
);
60 if (relation
.getType().equals(
61 NameRelationshipType
.ORTHOGRAPHIC_VARIANT())) {
62 return ImageResources
.getImage(
63 ImageResources
.ORTHOGRAPHIC_VARIANT_ICON
);