cleanup
authorAndreas Müller <a.mueller@bgbm.org>
Thu, 7 Oct 2021 21:57:37 +0000 (23:57 +0200)
committerAndreas Müller <a.mueller@bgbm.org>
Thu, 7 Oct 2021 21:57:37 +0000 (23:57 +0200)
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/ExtReferenceSelectionDialog.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/SelectionDialogFactory.java

index 1ae62b1292846e3d577c0bdd8b10161faf2c7b4f..2a20bd637667b728df44bcf7779be37ab775acd9 100644 (file)
@@ -37,49 +37,23 @@ public class ExtReferenceSelectionDialog extends
     private Reference remoteSourceRef;
     private IReferenceService service = null;
 
-    /**
-     * <p>select</p>
-     *
-     * @param reference a {@link eu.etaxonomy.cdm.model.reference.ReferenceBase} object.
-     * @param shell a {@link org.eclipse.swt.widgets.Shell} object.
-     * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
-     * @return a {@link eu.etaxonomy.cdm.model.reference.ReferenceBase} object.
-     */
-    public static Reference select(Shell shell, //ConversationHolder conversation,
+    public static Reference select(Shell shell,
             Reference reference, boolean isInReference) {
-        ExtReferenceSelectionDialog dialog = new ExtReferenceSelectionDialog(shell, //conversation,
+        ExtReferenceSelectionDialog dialog = new ExtReferenceSelectionDialog(shell,
                 "Choose a reference", false, reference, isInReference);
         return getSelectionFromDialog(dialog);
     }
 
-    /**
-     * <p>select</p>
-     *
-     * @param reference a {@link eu.etaxonomy.cdm.model.reference.ReferenceBase} object.
-     * @param shell a {@link org.eclipse.swt.widgets.Shell} object.
-     * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
-     * @return a {@link eu.etaxonomy.cdm.model.reference.ReferenceBase} object.
-     */
-    public static Reference select(Shell shell, //ConversationHolder conversation,
+    public static Reference select(Shell shell,
             Reference reference) {
-        ExtReferenceSelectionDialog dialog = new ExtReferenceSelectionDialog(shell, //conversation,
+        ExtReferenceSelectionDialog dialog = new ExtReferenceSelectionDialog(shell,
                 "Choose a reference", false, reference);
         return getSelectionFromDialog(dialog);
     }
 
-    /**
-     * <p>Constructor for FilteredReferenceSelectionDialog.</p>
-     *
-     * @param shell a {@link org.eclipse.swt.widgets.Shell} object.
-     * @param title a {@link java.lang.String} object.
-     * @param reference a {@link eu.etaxonomy.cdm.model.reference.ReferenceBase} object.
-     * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
-     * @param multi a boolean.
-     */
-    protected ExtReferenceSelectionDialog(Shell shell, //ConversationHolder conversation,
+    protected ExtReferenceSelectionDialog(Shell shell,
             String title, boolean multi, Reference reference) {
-        super(shell, //conversation,
-                title, multi, ExtReferenceSelectionDialog.class.getCanonicalName());
+        super(shell, title, multi, ExtReferenceSelectionDialog.class.getCanonicalName());
         this.currentReference = reference;
 //            controller = CdmStore.getCurrentApplicationConfiguration();
         remoteSource = CdmServerInfo.getDevServerRemoteSource();
@@ -87,19 +61,9 @@ public class ExtReferenceSelectionDialog extends
         remoteSourceRef.setTitle(remoteSource.getName());
     }
 
-    /**
-     * <p>Constructor for FilteredReferenceSelectionDialog.</p>
-     *
-     * @param shell a {@link org.eclipse.swt.widgets.Shell} object.
-     * @param title a {@link java.lang.String} object.
-     * @param reference a {@link eu.etaxonomy.cdm.model.reference.ReferenceBase} object.
-     * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
-     * @param multi a boolean.
-     */
-    protected ExtReferenceSelectionDialog(Shell shell, //ConversationHolder conversation,
+    protected ExtReferenceSelectionDialog(Shell shell,
             String title, boolean multi, Reference reference, boolean isInReference) {
-        super(shell, //conversation,
-                title, multi, ExtReferenceSelectionDialog.class.getCanonicalName());
+        super(shell, title, multi, ExtReferenceSelectionDialog.class.getCanonicalName());
         ExtReferenceSelectionDialog.isInReference = isInReference;
         this.currentReference = reference;
 
index bf47d6f7ea9d409fa4dbed6572c7445894ab0ce6..52a3826c734565812b32991498dc708a965f1b01 100644 (file)
@@ -77,8 +77,7 @@ public class SelectionDialogFactory {
                T currentSelection, ICdmFormElement parentElement){\r
 \r
                if(clazz.equals(Taxon.class)){\r
-                       return (T) TaxonSelectionDialog.selectTaxon(shell,\r
-                               (Taxon) currentSelection);\r
+                       return (T) TaxonSelectionDialog.selectTaxon(shell, (Taxon) currentSelection);\r
                }\r
                if(clazz.equals(Synonym.class)){\r
                        return (T) TaxonBaseSelectionDialog.selectSynonym(shell );\r
@@ -87,8 +86,7 @@ public class SelectionDialogFactory {
                        return (T) TaxonBaseSelectionDialog.selectTaxonBase(shell);\r
                }\r
                if(clazz.equals(Classification.class)){\r
-                       return (T) ClassificationSelectionDialog.select(shell,\r
-                               (Classification) currentSelection);\r
+                       return (T) ClassificationSelectionDialog.select(shell, (Classification) currentSelection);\r
                }\r
                if(clazz.equals(TaxonNode.class)){\r
                        return (T) TaxonNodeSelectionDialog.select(shell,\r
@@ -107,17 +105,14 @@ public class SelectionDialogFactory {
                        return (T) ReferenceSelectionDialog.select(shell,\r
                                ((ReferenceDetailElement) parentElement).getEntity(), true);\r
                    }\r
-                       return (T) ReferenceSelectionDialog.select(shell,\r
-                               (Reference) currentSelection);\r
+                       return (T) ReferenceSelectionDialog.select(shell, (Reference) currentSelection);\r
                }\r
 \r
                if(clazz.equals(TaxonName.class)){\r
-                       return (T) NameSelectionDialog.select(shell,\r
-                               (TaxonName) currentSelection);\r
+                       return (T) NameSelectionDialog.select(shell, (TaxonName)currentSelection);\r
                }\r
                if(clazz.equals(Team.class)){\r
-                       return (T) TeamSelectionDialog.select(shell,\r
-                               (Team) currentSelection);\r
+                       return (T) TeamSelectionDialog.select(shell, (Team)currentSelection);\r
                }\r
                if(clazz.equals(TeamOrPersonBase.class) && parentElement instanceof AuthorshipDetailElement){\r
             return (T) NomenclaturalAuthorSelectionDialog.select(shell,\r
@@ -135,20 +130,16 @@ public class SelectionDialogFactory {
                            (TeamOrPersonBase) currentSelection, true);\r
         }\r
                if(clazz.equals(AgentBase.class)){\r
-                       return (T) AgentSelectionDialog.select(shell,\r
-                               (AgentBase) currentSelection, false);\r
+                       return (T) AgentSelectionDialog.select(shell, (AgentBase)currentSelection, false);\r
                }\r
                if(clazz.equals(Feature.class)){\r
-                       return (T) FeatureSelectionDialog.select(shell,\r
-                               (Feature) currentSelection);\r
+                       return (T) FeatureSelectionDialog.select(shell, (Feature)currentSelection);\r
                }\r
                if(clazz.equals(TermTree.class)){\r
-                       return (T) FeatureTreeSelectionDialog.select(shell,\r
-                               (TermTree) currentSelection);\r
+                       return (T) FeatureTreeSelectionDialog.select(shell, (TermTree)currentSelection);\r
                }\r
                if(clazz.equals(PolytomousKey.class)){\r
-                       return (T) PolytomousKeySelectionDialog.select(shell,\r
-                               (PolytomousKey) currentSelection);\r
+                       return (T) PolytomousKeySelectionDialog.select(shell, (PolytomousKey)currentSelection);\r
                }\r
                if(clazz.equals(PolytomousKeyNode.class)){\r
                        MessagingUtils.warningDialog("Not implemented yet", SelectionDialogFactory.class,\r
@@ -156,12 +147,10 @@ public class SelectionDialogFactory {
                        return null;\r
                }\r
                if(clazz.equals(DerivedUnit.class)){\r
-                   return (T) DerivedUnitSelectionDialog.select(shell,\r
-                           (DerivedUnit) currentSelection);\r
+                   return (T) DerivedUnitSelectionDialog.select(shell, (DerivedUnit) currentSelection);\r
                }\r
                if(clazz.equals(FieldUnit.class)){\r
-                   return (T) FieldUnitSelectionDialog.select(shell,\r
-                           (FieldUnit) currentSelection);\r
+                   return (T) FieldUnitSelectionDialog.select(shell, (FieldUnit) currentSelection);\r
                }\r
                if(clazz.equals(SpecimenOrObservationBase.class)){\r
                    return (T) SpecimenOrObservationBaseSelectionDialog.select(shell,\r
@@ -182,52 +171,41 @@ public class SelectionDialogFactory {
                    if (uuidList != null){\r
                        uuidArray = new UUID[uuidList.size()];\r
                        uuidList.toArray(uuidArray);\r
-\r
                    }\r
                    return (T)NamedAreaSelectionDialog.select(shell, (NamedArea) currentSelection, null, uuidArray);\r
                    }\r
                }\r
                if(clazz.equals(Collection.class)){\r
-                       return (T) CollectionSelectionDialog.select(shell,\r
-                               (Collection) currentSelection);\r
+                       return (T) CollectionSelectionDialog.select(shell, (Collection) currentSelection);\r
                }\r
                if(clazz.equals(User.class) && parentElement instanceof MemberDetailElement){\r
                    MemberDetailSection section = (MemberDetailSection)((MemberDetailElement)parentElement).getParentElement();\r
-                       return (T) UserSelectionDialog.select(shell,\r
-                               (User) currentSelection, section.getEntity());\r
+                       return (T) UserSelectionDialog.select(shell,(User) currentSelection, section.getEntity());\r
                }\r
                if(clazz.equals(GrantedAuthorityImpl.class)){\r
-                       return (T) GrantedAuthoritySelectionDialog.select(shell,\r
-                               (GrantedAuthorityImpl) currentSelection);\r
+                       return (T) GrantedAuthoritySelectionDialog.select(shell, (GrantedAuthorityImpl)currentSelection);\r
                }\r
                if (clazz.equals(Person.class)){\r
-                       return (T) PersonSelectionDialog.select(shell,\r
-                               (Person) currentSelection);\r
+                       return (T) PersonSelectionDialog.select(shell, (Person)currentSelection);\r
                }\r
                if(clazz.equals(Group.class) &&  parentElement instanceof GroupsByUserDetailElement){\r
                    GroupsByUserDetailSection section =(GroupsByUserDetailSection)((GroupsByUserDetailElement)parentElement).getParentElement();\r
-                       return (T) GroupSelectionDialog.select(shell,\r
-                               (Group) currentSelection, section.getEntity());\r
+                       return (T) GroupSelectionDialog.select(shell, (Group)currentSelection, section.getEntity());\r
                }\r
                if(clazz.equals(Institution.class)){\r
-                       return (T) InstitutionSelectionDialog.select(shell,\r
-                               (Institution) currentSelection);\r
+                       return (T) InstitutionSelectionDialog.select(shell, (Institution)currentSelection);\r
                }\r
                if(clazz.equals(Primer.class)){\r
-                   return (T) PrimerSelectionDialog.select(shell,\r
-                           (Primer) currentSelection);\r
+                   return (T) PrimerSelectionDialog.select(shell, (Primer)currentSelection);\r
                }\r
                if(clazz.equals(Amplification.class)){\r
-                   return (T) AmplificationSelectionDialog.select(shell,\r
-                           (Amplification) currentSelection);\r
+                   return (T) AmplificationSelectionDialog.select(shell, (Amplification)currentSelection);\r
                }\r
                if(clazz.equals(Media.class)){\r
-                   return (T) MediaSelectionDialog.select(shell,\r
-                           (Media) currentSelection);\r
+                   return (T) MediaSelectionDialog.select(shell, (Media)currentSelection);\r
                }\r
                if(clazz.equals(Rights.class)){\r
-            return (T) RightsSelectionDialog.select(shell,\r
-                    (Rights) currentSelection);\r
+            return (T) RightsSelectionDialog.select(shell, (Rights)currentSelection);\r
         }\r
 \r
                return null;\r
@@ -235,7 +213,6 @@ public class SelectionDialogFactory {
 \r
        public static <T extends ICdmBase> T getSelectionFromExtDialog(Class<T> clazz, Shell shell,\r
                ICdmFormElement parentElement){\r
-           return (T) ExtReferenceSelectionDialog.select(shell,\r
-                   null);\r
+           return (T) ExtReferenceSelectionDialog.select(shell, null);\r
        }\r
 }
\ No newline at end of file