ref #6061: remove the current selection as filter in nomenclatural author selection...
authorKatja Luther <k.luther@bgbm.org>
Thu, 15 Sep 2016 08:40:05 +0000 (10:40 +0200)
committerKatja Luther <k.luther@bgbm.org>
Thu, 15 Sep 2016 08:40:05 +0000 (10:40 +0200)
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/AbstractFilteredCdmResourceSelectionDialog.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/NomenclaturalAuthorSelectionDialog.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/AuthorshipDetailElement.java

index 6ad564e441dcef3f597fc05473dcfa59c87f3e76..2536fcdf44ada7d0f9862ca3abb49f1f67856f59 100644 (file)
@@ -70,7 +70,7 @@ public abstract class AbstractFilteredCdmResourceSelectionDialog<T extends ICdmB
        private final Set<T> transientCdmObjects = new HashSet<T>();
        private final String settings;
        protected final int limitOfInitialElements = 100;
-
+       
        protected T cdmBaseToBeFiltered;
 
 
index cc4c1f049a4e9f8b1ba4d481fc558fe04238b5ad..baad25d457b4510f88f30aa531799b6c88e86a32 100644 (file)
@@ -158,7 +158,9 @@ public class NomenclaturalAuthorSelectionDialog extends AgentSelectionDialog {
                        UuidAndTitleCache uuidAndTitleCache = (UuidAndTitleCache) element;
                        String titleCache = uuidAndTitleCache.getTitleCache();
                        String abbrevTitleCache = uuidAndTitleCache.getAbbrevTitleCache();
-                       abbrevTitleCache += " - " + titleCache;
+                       if (!titleCache.equals(abbrevTitleCache)){
+                               abbrevTitleCache += " - " + titleCache;
+                       }
                        if(PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_ID_IN_ENTITY_SELECTION_DIAOLOG)){
                                abbrevTitleCache += " ["+uuidAndTitleCache.getId()+"]";
                        }
@@ -188,7 +190,11 @@ public class NomenclaturalAuthorSelectionDialog extends AgentSelectionDialog {
                        public boolean matchItem(Object item) {
                                String text = null;
                                if(item instanceof UuidAndTitleCache){
-                                       text = ((UuidAndTitleCache) item).getAbbrevTitleCache();
+                                       if (((UuidAndTitleCache) item).getAbbrevTitleCache() != null){
+                                               text = ((UuidAndTitleCache) item).getAbbrevTitleCache();
+                                       } else{
+                                               text = ((UuidAndTitleCache) item).getTitleCache();
+                                       }
                                }else if(item instanceof String){
                                        text = (String) item;
                                }
index ae3f52b4d6ecf2e596aabc50c8e7e776ce7a79fe..044268570adc898eb3e8b5f302cdf3475aae56f4 100644 (file)
@@ -101,7 +101,7 @@ public class AuthorshipDetailElement extends
                 EntitySelectionElement.ALL, style);
                addElement(selectionBasionymAuthor);
                selectionExBasionymAuthor = formFactory.createSelectionElementWithAbbreviatedTitle(TeamOrPersonBase.class, getConversationHolder(),
-                       formElement, "Ex Basionym Author", entity.getExBasionymAuthorship(),
+                       formElement, "Ex Basionym Author",entity.getExBasionymAuthorship(),
                        EntitySelectionElement.ALL, style);
 
                addElement(selectionExBasionymAuthor);