ref #4302 Escape '&' in section titles
[taxeditor.git] / eu.etaxonomy.taxeditor.store / src / main / java / eu / etaxonomy / taxeditor / store / StoreUtil.java
index 7190a36af316108bb7525277e6205bf3fa26cdfb..dd3d284a8b4a5905ae215c1c89f90c42c54b6663 100644 (file)
@@ -15,7 +15,6 @@ import org.eclipse.core.commands.operations.IOperationHistory;
 import org.eclipse.core.commands.operations.IUndoContext;
 import org.eclipse.jface.action.IStatusLineManager;
 import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.IEditorInput;
 import org.eclipse.ui.forms.widgets.ScrolledForm;
 
 import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
@@ -120,15 +119,18 @@ public class StoreUtil extends AbstractUtility {
                return TaxeditorStorePlugin.PLUGIN_ID;
        }
 
-       /**
-        *
-        * @return
-        */
-       public static IEditorInput getActiveEditorInput() {
-//             IEditorPart activeEditor = getActiveEditor();
-//             if (activeEditor != null){
-//                     return activeEditor.getEditorInput();
-//             }
-               return null;
+    /**
+     * Cleans title string for output in section titles<br>
+     * E.g. escapes '&' with "&&" to avoid mnemonic handling (see
+     * Label.setText() documentation)<br>
+     * see also #4302
+     *
+     * @param title
+     *            the title string to clean
+     * @return the cleaned title string
+     */
+       public static String cleanTitleString(String title){
+           return title.replace("&", "&&");
        }
+
 }