From a2dad66ec1ee5ea61b8ca84f3664370c10af1388 Mon Sep 17 00:00:00 2001
From: Patric Plitzner
Date: Wed, 21 Jan 2015 08:16:10 +0000
Subject: [PATCH] - added sorting to generic configuration wizard page for
imports
---
.../wizard/GenericConfiguratorWizardPage.java | 20 +++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/GenericConfiguratorWizardPage.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/GenericConfiguratorWizardPage.java
index 645ddbed9..7542acfcd 100644
--- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/GenericConfiguratorWizardPage.java
+++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/GenericConfiguratorWizardPage.java
@@ -12,6 +12,8 @@ package eu.etaxonomy.taxeditor.io.wizard;
import java.lang.reflect.Method;
import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
import java.util.List;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
@@ -130,6 +132,24 @@ public class GenericConfiguratorWizardPage extends WizardPage {
composite.setLayout(gridLayout);
List methods = getConfiguratorsBooleanSetMethods(configurator);
+ Collections.sort(methods, new Comparator() {
+ /* (non-Javadoc)
+ * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
+ */
+ @Override
+ public int compare(Method o1, Method o2) {
+ if(o1.getName()==null && o2.getName()!=null){
+ return -1;
+ }
+ if(o1.getName()!=null && o2.getName()==null){
+ return 1;
+ }
+ if(o1.getName()==null && o2.getName()==null){
+ return 0;
+ }
+ return o1.getName().compareTo(o2.getName());
+ }
+ });
for (Method method : methods) {
createCheckbox(composite, method, configurator);
--
2.34.1