- fixed bug that showed double or no '&' (#4302)
authorPatric Plitzner <p.plitzner@bgbm.org>
Tue, 5 Aug 2014 11:46:59 +0000 (11:46 +0000)
committerPatric Plitzner <p.plitzner@bgbm.org>
Tue, 5 Aug 2014 11:46:59 +0000 (11:46 +0000)
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/AuthorshipDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/NonViralNameDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/taxon/TaxonBaseDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/selection/EntitySelectionElement.java

index 66c071ced89a6194752dcd6949672531c606bbdd..44aa277454c44f4cf9c4a43b6ab2543971fa4ad6 100644 (file)
@@ -56,7 +56,12 @@ public class AuthorshipDetailSection extends AbstractCdmDetailSection<NonViralNa
        @Override
        protected void setSectionTitle() {
                if(getEntity() != null){
        @Override
        protected void setSectionTitle() {
                if(getEntity() != null){
-                       this.setText(getHeading() + ": " + getEntity().getAuthorshipCache());
+                       String title = getHeading() + ": " + getEntity().getAuthorshipCache();
+               // we have to duplicate ampersands otherwise they are treated as
+               // mnenomic (see Label.setText() documentation)
+            // see also #4302
+               title = title.replace("&", "&&");
+            this.setText(title);
                }
        }
 
                }
        }
 
index 654a025e439f8bffc0632401d0ddc8d70134bbac..edc738db706149840c18700531b18c6274270ec7 100644 (file)
@@ -119,6 +119,21 @@ public class NonViralNameDetailSection extends AbstractCdmDetailSection<NonViral
                setEntity(name);
        }
 
                setEntity(name);
        }
 
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#setSectionTitle()
+     */
+    @Override
+    protected void setSectionTitle() {
+        super.setSectionTitle();
+        String title = getText();
+        // we have to duplicate ampersands otherwise they are treated as
+        // mnenomic (see Label.setText() documentation)
+        // see also #4302
+        title = title.replace("&", "&&");
+        setText(title);
+    }
+
+
        /* (non-Javadoc)
         * @see eu.etaxonomy.taxeditor.section.ITaxonDetailSection#getTaxon(eu.etaxonomy.cdm.model.taxon.TaxonBase)
         */
        /* (non-Javadoc)
         * @see eu.etaxonomy.taxeditor.section.ITaxonDetailSection#getTaxon(eu.etaxonomy.cdm.model.taxon.TaxonBase)
         */
index 27849d6989f474bcb6615ea050015c99d4297c40..3a3a1fad749460a9188a67ec606f7a17133a628b 100644 (file)
@@ -55,4 +55,18 @@ public class TaxonBaseDetailSection extends AbstractCdmDetailSection<TaxonBase>
            return formFactory.createTaxonBaseDetailElement(parentElement, style);
        }
 
            return formFactory.createTaxonBaseDetailElement(parentElement, style);
        }
 
+       /* (non-Javadoc)
+        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#setSectionTitle()
+        */
+       @Override
+       protected void setSectionTitle() {
+           super.setSectionTitle();
+           String title = getText();
+        // we have to duplicate ampersands otherwise they are treated as
+        // mnenomic (see Label.setText() documentation)
+        // see also #4302
+        title = title.replace("&", "&&");
+        setText(title);
+       }
+
 }
 }
index 388827b129cdb97faf0f0b80b2ad2c2d6be1b9f5..b6e5ca65e58550e6c63749de99ae445445121b21 100644 (file)
@@ -288,9 +288,6 @@ public class EntitySelectionElement<T extends ICdmBase> extends
         */
        protected void updateElement() {
                String title = CdmUtils.Nz(getTitle());
         */
        protected void updateElement() {
                String title = CdmUtils.Nz(getTitle());
-               // we have to duplicate ampersands otherwise they are treated as
-               // mnenomic (see Label.setText() documentation)
-               title = title.replace("&", "&&");
                text.setText(title); // title can be null
                if (isEditable) {
                        updateButtonStates();
                text.setText(title); // title can be null
                if (isEditable) {
                        updateButtonStates();