4 package eu
.etaxonomy
.taxeditor
.labels
;
8 import org
.eclipse
.swt
.graphics
.Image
;
10 import eu
.etaxonomy
.cdm
.model
.name
.NameRelationshipType
;
11 import eu
.etaxonomy
.taxeditor
.model
.ImageResources
;
12 import eu
.etaxonomy
.taxeditor
.store
.TermStore
;
15 * <p>DefaultLabelStrategy class.</p>
19 public class DefaultLabelStrategy
implements ILabelImageStrategy
{
22 public String
getNameRelationTypeLabel(NameRelationshipType type
) {
23 List
<NameRelationshipType
> vocab
=
24 TermStore
.getTerms(NameRelationshipType
.class);
26 for (NameRelationshipType type1
: vocab
) {
27 if (type1
.equals(type
)) {
28 return type1
.getLabel();
35 public String
getNameRelationTypeInverseLabel(NameRelationshipType type
) {
37 List
<NameRelationshipType
> vocab
=
38 TermStore
.getTerms(NameRelationshipType
.class);
40 for (NameRelationshipType type1
: vocab
) {
41 if (type1
.equals(type
)) {
42 return type1
.getInverseLabel();
49 public Image
getNameRelationTypeImage(NameRelationshipType type
) {
50 if (NameRelationshipType
.BASIONYM().equals(type
)) {
51 return ImageResources
.getImage(
52 ImageResources
.BASIONYM_ICON
);
54 if (NameRelationshipType
.ORTHOGRAPHIC_VARIANT().equals(type
)) {
55 return ImageResources
.getImage(
56 ImageResources
.ORTHOGRAPHIC_VARIANT_ICON
);
62 public String
getNameRelationTypeDescription(NameRelationshipType type
) {
63 if (NameRelationshipType
.BASIONYM().equals(type
)) {
66 return type
.getDescription();