-/**\r
- * \r
- */\r
-package eu.etaxonomy.taxeditor.labels;\r
-\r
-import org.eclipse.swt.graphics.Image;\r
-\r
-import eu.etaxonomy.cdm.model.name.NameRelationshipType;\r
-import eu.etaxonomy.cdm.model.name.NomenclaturalCode;\r
-import eu.etaxonomy.cdm.model.name.TaxonNameBase;\r
-import eu.etaxonomy.taxeditor.preference.PreferencesUtil;\r
-\r
-/**\r
- * Returns labels and images that are dependent on a nomenclatural\r
- * code using a code-specific ILabelImageStrategy.\r
- * \r
- * @author p.ciardelli\r
- *\r
- */\r
-public class LabelImageProvider implements ILabelImageStrategy {\r
-\r
- private ILabelImageStrategy strategy;\r
-\r
- public static ILabelImageStrategy getLabelStrategy(TaxonNameBase name) {\r
- if (name == null) {\r
- if (PreferencesUtil.getPreferredNomenclaturalCode().\r
- equals(NomenclaturalCode.ICZN)) {\r
- return new ZoologicalNameLabelStrategy();\r
- }\r
- } else if (name.getNomenclaturalCode() != null &&\r
- name.getNomenclaturalCode().equals(NomenclaturalCode.ICZN)) {\r
- return new ZoologicalNameLabelStrategy();\r
- }\r
- return new DefaultLabelStrategy();\r
- }\r
-\r
- public LabelImageProvider(ILabelImageStrategy strategy) {\r
- this.strategy = strategy;\r
- }\r
- \r
- /* (non-Javadoc)\r
- * @see eu.etaxonomy.taxeditor.editor.labels.IEditorLabelStrategy#getNameRelationTypeLabel(eu.etaxonomy.cdm.model.name.NameRelationshipType)\r
- */\r
- public String getNameRelationTypeLabel(NameRelationshipType type) {\r
- return strategy.getNameRelationTypeLabel(type);\r
- }\r
-\r
- /* (non-Javadoc)\r
- * @see eu.etaxonomy.taxeditor.editor.labels.IEditorLabelStrategy#getNameRelationInverseTypeLabel(eu.etaxonomy.cdm.model.name.NameRelationshipType)\r
- */\r
- public String getNameRelationTypeInverseLabel(NameRelationshipType type) {\r
- return strategy.getNameRelationTypeInverseLabel(type);\r
- }\r
-\r
- /* (non-Javadoc)\r
- * @see eu.etaxonomy.taxeditor.editor.labels.ILabelImageStrategy#getNameRelationImage(eu.etaxonomy.cdm.model.name.NameRelationship)\r
- */\r
- public Image getNameRelationTypeImage(NameRelationshipType type) {\r
- return strategy.getNameRelationTypeImage(type);\r
- }\r
-\r
- /* (non-Javadoc)\r
- * @see eu.etaxonomy.taxeditor.labels.ILabelImageStrategy#getNameRelationDescription(eu.etaxonomy.cdm.model.name.NameRelationshipType)\r
- */\r
- public String getNameRelationTypeDescription(NameRelationshipType type) {\r
- return strategy.getNameRelationTypeDescription(type);\r
- }\r
-}\r
+/**
+ *
+ */
+package eu.etaxonomy.taxeditor.labels;
+
+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.taxeditor.preference.PreferencesUtil;
+
+/**
+ * Returns labels and images that are dependent on a nomenclatural
+ * code using a code-specific ILabelImageStrategy.
+ *
+ * @author p.ciardelli
+ * @version $Id: $
+ */
+public class LabelImageProvider implements ILabelImageStrategy {
+
+ private ILabelImageStrategy strategy;
+
+ /**
+ * <p>getLabelStrategy</p>
+ *
+ * @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) {
+ if (name == null) {
+ if (PreferencesUtil.getPreferredNomenclaturalCode().
+ equals(NomenclaturalCode.ICZN)) {
+ return new ZoologicalNameLabelStrategy();
+ }
+ } else if (name.getNomenclaturalCode() != null &&
+ name.getNomenclaturalCode().equals(NomenclaturalCode.ICZN)) {
+ return new ZoologicalNameLabelStrategy();
+ }
+ return new DefaultLabelStrategy();
+ }
+
+ /**
+ * <p>Constructor for LabelImageProvider.</p>
+ *
+ * @param strategy a {@link eu.etaxonomy.taxeditor.labels.ILabelImageStrategy} object.
+ */
+ 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) {
+ return strategy.getNameRelationTypeLabel(type);
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.editor.labels.IEditorLabelStrategy#getNameRelationInverseTypeLabel(eu.etaxonomy.cdm.model.name.NameRelationshipType)
+ */
+ /** {@inheritDoc} */
+ public String getNameRelationTypeInverseLabel(NameRelationshipType type) {
+ return strategy.getNameRelationTypeInverseLabel(type);
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.editor.labels.ILabelImageStrategy#getNameRelationImage(eu.etaxonomy.cdm.model.name.NameRelationship)
+ */
+ /** {@inheritDoc} */
+ public Image getNameRelationTypeImage(NameRelationshipType type) {
+ return strategy.getNameRelationTypeImage(type);
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.labels.ILabelImageStrategy#getNameRelationDescription(eu.etaxonomy.cdm.model.name.NameRelationshipType)
+ */
+ /** {@inheritDoc} */
+ public String getNameRelationTypeDescription(NameRelationshipType type) {
+ return strategy.getNameRelationTypeDescription(type);
+ }
+}