Merge branch 'hotfix/3.12.4' into develop
[taxeditor.git] / eu.etaxonomy.taxeditor.store / src / main / java / eu / etaxonomy / taxeditor / ui / dialog / selection / AbstractFilteredCdmResourceSelectionDialog.java
index 8bfa50dd67f542f256411f7858a241e01b48bfef..a22f14454b57b8fe06cad6624edb8ee1e1ce9153 100644 (file)
@@ -91,7 +91,7 @@ public abstract class AbstractFilteredCdmResourceSelectionDialog<T extends ICdmB
                this.settings = settings;
 
                this.conversation = conversation;
-
+               this.cdmBaseToBeFiltered = cdmObject;
                Cursor cursor = shell.getCursor();
                shell.setCursor(shell.getDisplay().getSystemCursor(SWT.CURSOR_WAIT));
                init();
@@ -223,7 +223,7 @@ public abstract class AbstractFilteredCdmResourceSelectionDialog<T extends ICdmB
        /** {@inheritDoc} */
        @Override
        public void refresh() {
-               //initModel();
+               initModel();
                filterExcludedObjects();
                super.refresh();
        }
@@ -477,26 +477,27 @@ public abstract class AbstractFilteredCdmResourceSelectionDialog<T extends ICdmB
                        @Override
                        public void widgetSelected(SelectionEvent e) {
 
-                               AbstractNewEntityWizard wizard = getNewEntityWizard(e.text);
-
-                               wizard.init(null, null);
-                               if(wizard.getEntity() != null) {
-                                       WizardDialog dialog = new WizardDialog(getShell(), wizard);
-                                       int status = dialog.open();
-
-                                       if (status == IStatus.OK) {
-
-                                               T entity = (T) wizard.getEntity();
-                                               model.add(new UuidAndTitleCache<T>(entity.getUuid(),
-                                                       entity.getId(),
-                                                       getTitle(entity)));
-                                               refresh();
-                                               setPattern(entity);
-                                               getConversationHolder().bind();
-                                       }
-                                       //FIXME : Need to make sure this is a stable fix (ticket 3822)
-                                       getConversationHolder().commit();
-                               }
+                           AbstractNewEntityWizard wizard = getNewEntityWizard(e.text);
+                           if(wizard!=null){
+                               wizard.init(null, null);
+                               if(wizard.getEntity() != null) {
+                                   WizardDialog dialog = new WizardDialog(getShell(), wizard);
+                                   int status = dialog.open();
+
+                                   if (status == IStatus.OK) {
+
+                                       T entity = (T) wizard.getEntity();
+                                       model.add(new UuidAndTitleCache<T>(entity.getUuid(),
+                                               entity.getId(),
+                                               getTitle(entity)));
+                                       refresh();
+                                       setPattern(entity);
+                                       getConversationHolder().bind();
+                                   }
+                                   //FIXME : Need to make sure this is a stable fix (ticket 3822)
+                                   getConversationHolder().commit();
+                               }
+                           }
                        }
                };
        }