ref #9038: check value with regex if fit in BigDecimal
[taxeditor.git] / eu.etaxonomy.taxeditor.store / src / main / java / eu / etaxonomy / taxeditor / labels / LabelImageProvider.java
index 1e19522a0bcae2e7e3f6f3e084330c6bff0bae1a..3c000088c0a52c99d76124d5a54f944c0e4d469b 100644 (file)
@@ -1,5 +1,5 @@
 /**
- * 
+ *
  */
 package eu.etaxonomy.taxeditor.labels;
 
@@ -7,7 +7,7 @@ import org.eclipse.swt.graphics.Image;
 
 import eu.etaxonomy.cdm.model.name.NameRelationshipType;
 import eu.etaxonomy.cdm.model.name.NomenclaturalCode;
-import eu.etaxonomy.cdm.model.name.TaxonNameBase;
+import eu.etaxonomy.cdm.model.name.TaxonName;
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 
 /**
@@ -15,7 +15,6 @@ import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
  * code using a code-specific ILabelImageStrategy.
  *
  * @author p.ciardelli
- * @version $Id: $
  */
 public class LabelImageProvider implements ILabelImageStrategy {
 
@@ -27,14 +26,14 @@ public class LabelImageProvider implements ILabelImageStrategy {
         * @param name a {@link eu.etaxonomy.cdm.model.name.TaxonNameBase} object.
         * @return a {@link eu.etaxonomy.taxeditor.labels.ILabelImageStrategy} object.
         */
-       public static ILabelImageStrategy getLabelStrategy(TaxonNameBase name) {
+       public static ILabelImageStrategy getLabelStrategy(TaxonName name) {
                if (name == null) {
                        if (PreferencesUtil.getPreferredNomenclaturalCode().
                                        equals(NomenclaturalCode.ICZN)) {
                                return new ZoologicalNameLabelStrategy();
                        }
-               } else if (name.getNomenclaturalCode() != null &&
-                               name.getNomenclaturalCode().equals(NomenclaturalCode.ICZN)) {
+               } else if (name.getNameType() != null &&
+                               name.getNameType().equals(NomenclaturalCode.ICZN)) {
                        return new ZoologicalNameLabelStrategy();
                }
                return new DefaultLabelStrategy();
@@ -48,12 +47,13 @@ public class LabelImageProvider implements ILabelImageStrategy {
        public LabelImageProvider(ILabelImageStrategy strategy) {
                this.strategy = strategy;
        }
-       
+
        /* (non-Javadoc)
         * @see eu.etaxonomy.taxeditor.editor.labels.IEditorLabelStrategy#getNameRelationTypeLabel(eu.etaxonomy.cdm.model.name.NameRelationshipType)
         */
        /** {@inheritDoc} */
-       public String getNameRelationTypeLabel(NameRelationshipType type) {
+       @Override
+    public String getNameRelationTypeLabel(NameRelationshipType type) {
                return strategy.getNameRelationTypeLabel(type);
        }
 
@@ -61,7 +61,8 @@ public class LabelImageProvider implements ILabelImageStrategy {
         * @see eu.etaxonomy.taxeditor.editor.labels.IEditorLabelStrategy#getNameRelationInverseTypeLabel(eu.etaxonomy.cdm.model.name.NameRelationshipType)
         */
        /** {@inheritDoc} */
-       public String getNameRelationTypeInverseLabel(NameRelationshipType type) {
+       @Override
+    public String getNameRelationTypeInverseLabel(NameRelationshipType type) {
                return strategy.getNameRelationTypeInverseLabel(type);
        }
 
@@ -69,7 +70,8 @@ public class LabelImageProvider implements ILabelImageStrategy {
         * @see eu.etaxonomy.taxeditor.editor.labels.ILabelImageStrategy#getNameRelationImage(eu.etaxonomy.cdm.model.name.NameRelationship)
         */
        /** {@inheritDoc} */
-       public Image getNameRelationTypeImage(NameRelationshipType type) {
+       @Override
+    public Image getNameRelationTypeImage(NameRelationshipType type) {
                return strategy.getNameRelationTypeImage(type);
        }
 
@@ -77,7 +79,8 @@ public class LabelImageProvider implements ILabelImageStrategy {
         * @see eu.etaxonomy.taxeditor.labels.ILabelImageStrategy#getNameRelationDescription(eu.etaxonomy.cdm.model.name.NameRelationshipType)
         */
        /** {@inheritDoc} */
-       public String getNameRelationTypeDescription(NameRelationshipType type) {
+       @Override
+    public String getNameRelationTypeDescription(NameRelationshipType type) {
                return strategy.getNameRelationTypeDescription(type);
        }
 }