Add suppport for User and Group to ReferencingObjectsView #5603
authorPatrick Plitzner <p.plitzner@bgbm.org>
Wed, 27 Apr 2016 06:05:27 +0000 (08:05 +0200)
committerPatrick Plitzner <p.plitzner@bgbm.org>
Wed, 27 Apr 2016 06:05:27 +0000 (08:05 +0200)
 - disable viewer table when no selection available

eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/referencingobjects/ReferencingObjectsView.java

index 9db3b0b84fdd32baa70f0d61941df40c1eee9bfc..cc87ecc42469298c1713a091a3bc51af6ccd35ba 100644 (file)
@@ -251,6 +251,10 @@ public class ReferencingObjectsView extends AbstractCdmViewPart {
                 referencedObject = CdmStore.getService(ITermService.class).load(entity, null);
             } else if (EventBase.class.isAssignableFrom(objectClass)){
                 referencedObject = CdmStore.getService(IEventBaseService.class).load(entity, null);
                 referencedObject = CdmStore.getService(ITermService.class).load(entity, null);
             } else if (EventBase.class.isAssignableFrom(objectClass)){
                 referencedObject = CdmStore.getService(IEventBaseService.class).load(entity, null);
+            } else if (User.class.isAssignableFrom(objectClass)){
+                referencedObject = CdmStore.getService(IUserService.class).load(entity, null);
+            } else if (Group.class.isAssignableFrom(objectClass)){
+                referencedObject = CdmStore.getService(IGroupService.class).load(entity, null);
             }
                        //referencedObject =(CdmBase) CdmStore.getService(IIdentifiableEntityService.class).load(referencedObject.getUuid());
                Set<CdmBase> setOfReferencingObjects = null;
             }
                        //referencedObject =(CdmBase) CdmStore.getService(IIdentifiableEntityService.class).load(referencedObject.getUuid());
                Set<CdmBase> setOfReferencingObjects = null;
@@ -308,6 +312,9 @@ public class ReferencingObjectsView extends AbstractCdmViewPart {
                                } else {
                                        setContentDescription("");
                                }
                                } else {
                                        setContentDescription("");
                                }
+                               if(referencingObjects==null){
+                                       viewer.getControl().setEnabled(false);
+                               }
                                showViewer();
                        }catch(Exception e){
                                setContentDescription("The referencing objects view could not be loaded completely. Some Problems occured.");
                                showViewer();
                        }catch(Exception e){
                                setContentDescription("The referencing objects view could not be loaded completely. Some Problems occured.");