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>
20 public class DefaultLabelStrategy
implements ILabelImageStrategy
{
23 * @see eu.etaxonomy.taxeditor.editor.labels.IEditorLabelStrategy#getNameRelationTypeLabel(eu.etaxonomy.cdm.model.name.NameRelationshipType)
26 public String
getNameRelationTypeLabel(NameRelationshipType type
) {
27 List
<NameRelationshipType
> vocab
=
28 TermStore
.getNameRelationshipTypes();
30 for (NameRelationshipType type1
: vocab
) {
31 if (type1
.equals(type
)) {
32 return type1
.getLabel();
39 * @see eu.etaxonomy.taxeditor.editor.labels.IEditorLabelStrategy#getNameRelationInverseTypeLabel(eu.etaxonomy.cdm.model.name.NameRelationshipType)
42 public String
getNameRelationTypeInverseLabel(NameRelationshipType type
) {
44 List
<NameRelationshipType
> vocab
=
45 TermStore
.getNameRelationshipTypes();
47 for (NameRelationshipType type1
: vocab
) {
48 if (type1
.equals(type
)) {
49 return type1
.getInverseLabel();
56 * @see eu.etaxonomy.taxeditor.editor.labels.ILabelImageStrategy#getNameRelationImage(eu.etaxonomy.cdm.model.name.NameRelationship)
59 public Image
getNameRelationTypeImage(NameRelationshipType type
) {
60 if (NameRelationshipType
.BASIONYM().equals(type
)) {
61 return ImageResources
.getImage(
62 ImageResources
.BASIONYM_ICON
);
64 if (NameRelationshipType
.ORTHOGRAPHIC_VARIANT().equals(type
)) {
65 return ImageResources
.getImage(
66 ImageResources
.ORTHOGRAPHIC_VARIANT_ICON
);
72 * @see eu.etaxonomy.taxeditor.labels.ILabelImageStrategy#getNameRelationDescription(eu.etaxonomy.cdm.model.name.NameRelationshipType)
75 public String
getNameRelationTypeDescription(NameRelationshipType type
) {
76 if (NameRelationshipType
.BASIONYM().equals(type
)) {
79 return type
.getDescription();