Index: trunk/autoquest-ui-swt/src/main/java/de/ugoe/cs/autoquest/ui/swt/ShowUsabilityEvaluationResultDialog.java
===================================================================
--- trunk/autoquest-ui-swt/src/main/java/de/ugoe/cs/autoquest/ui/swt/ShowUsabilityEvaluationResultDialog.java	(revision 2046)
+++ trunk/autoquest-ui-swt/src/main/java/de/ugoe/cs/autoquest/ui/swt/ShowUsabilityEvaluationResultDialog.java	(revision 2047)
@@ -22,4 +22,5 @@
 import java.util.LinkedList;
 import java.util.List;
+import java.util.ListIterator;
 import java.util.Map;
 
@@ -215,30 +216,51 @@
      */
     private void buildSmellTree() {
+        int groupCount = 5;
+        int groupSize = 30;
+        
         List<UsabilitySmell> smells = usabilityEvalResult.getAllSmells();
-        
-        int[] eventCoverageQuantileGroups = { 990, 975, 950, 0, -1 };
-        int[] minEventCoverages = new int[eventCoverageQuantileGroups.length];
-        int[] maxEventCoverages = new int[eventCoverageQuantileGroups.length];
-
-        final List<Map<String, List<UsabilitySmell>>> sortedSmells =
-            new LinkedList<Map<String, List<UsabilitySmell>>>();
-        
-        for (int i = 0; i < eventCoverageQuantileGroups.length; i++) {
-            sortedSmells.add(new HashMap<String, List<UsabilitySmell>>());
-        }
-        
+
+        final Map<String, List<UsabilitySmell>> sortedSmells = new HashMap<>();
+
         for (UsabilitySmell smell : smells) {
-            int eventCoverageQuantile = smell.getIntensity().getEventCoverageQuantile();
-            
-            for (int i = 0; i < eventCoverageQuantileGroups.length; i++) {
-                if (eventCoverageQuantile >= eventCoverageQuantileGroups[i]) {
-                    Map<String, List<UsabilitySmell>> smellMap = sortedSmells.get(i);
-                    
-                    List<UsabilitySmell> smellList = smellMap.get(smell.getBriefDescription());
-                    
-                    if (smellList == null) {
-                        smellList = new ArrayList<UsabilitySmell>();
-                        smellMap.put(smell.getBriefDescription(), smellList);
-                    }
+            List<UsabilitySmell> smellList = sortedSmells.get(smell.getBriefDescription());
+                    
+            if (smellList == null) {
+                smellList = new ArrayList<UsabilitySmell>();
+                sortedSmells.put(smell.getBriefDescription(), smellList);
+            }
+            
+            ListIterator<UsabilitySmell> it = smellList.listIterator();
+            boolean added = false;
+            
+            while (it.hasNext()) {
+                if (smell.getIntensity().getEventCoverage() >
+                    it.next().getIntensity().getEventCoverage())
+                {
+                    it.previous();
+                    it.add(smell);
+                    added = true;
+                    break;
+                }
+            }
+            
+            if (!added) {
+                smellList.add(smell);
+            }
+        }
+
+        final Map<Integer, Map<String, List<UsabilitySmell>>> allSortedSmells =
+            new HashMap<Integer, Map<String, List<UsabilitySmell>>>();
+        
+        for (Map.Entry<String, List<UsabilitySmell>> entry : sortedSmells.entrySet()) {
+            // we create groupCount groups of size groupSize
+            int overallIndex = 0;
+            
+            for (int i = 0; i < groupCount; i++) {
+                List<UsabilitySmell> smellList = new LinkedList<>();
+                for (int j = 0; overallIndex < entry.getValue().size() &&
+                                ((j < groupSize) || (i == (groupCount - 1))); j++)
+                {
+                    UsabilitySmell smell = entry.getValue().get(overallIndex++);
                     
                     int ratio = smell.getIntensity().getRatio();
@@ -258,4 +280,81 @@
                     
                     smellList.add(index, smell);
+                }
+                
+                if (smellList.size() > 0) {
+                    Map<String, List<UsabilitySmell>> smellGroups = allSortedSmells.get(i);
+                    
+                    if (smellGroups == null) {
+                        smellGroups = new HashMap<>();
+                        allSortedSmells.put(i, smellGroups);
+                    }
+                    
+                    smellGroups.put(entry.getKey(), smellList);
+                }
+            }
+        }
+        
+        if (smellList.getListeners(SWT.Expand).length == 0) {
+            smellList.addListener(SWT.Expand, new Listener() {
+               public void handleEvent(final Event event) {
+                   ensureChildren((TreeItem) event.item);
+                   ((TreeItem) event.item).setExpanded(true);
+               }
+           });
+        }
+
+        for (int i = 0; i < allSortedSmells.size(); i++) {
+            createRootItem("smells group " + (i + 1), allSortedSmells.get(i));
+        }
+        
+    }
+
+    /**
+     * convenience method for creating the display of the instances
+     */
+    /*private void buildSmellTree() {
+        List<UsabilitySmell> smells = usabilityEvalResult.getAllSmells();
+        
+        int[] eventCoverageQuantileGroups = { 990, 975, 950, 0, -1 };
+        int[] minEventCoverages = new int[eventCoverageQuantileGroups.length];
+        int[] maxEventCoverages = new int[eventCoverageQuantileGroups.length];
+
+        final List<Map<String, List<UsabilitySmell>>> sortedSmells =
+            new LinkedList<Map<String, List<UsabilitySmell>>>();
+        
+        for (int i = 0; i < eventCoverageQuantileGroups.length; i++) {
+            sortedSmells.add(new HashMap<String, List<UsabilitySmell>>());
+        }
+        
+        for (UsabilitySmell smell : smells) {
+            int eventCoverageQuantile = smell.getIntensity().getEventCoverageQuantile();
+            
+            for (int i = 0; i < eventCoverageQuantileGroups.length; i++) {
+                if (eventCoverageQuantile >= eventCoverageQuantileGroups[i]) {
+                    Map<String, List<UsabilitySmell>> smellMap = sortedSmells.get(i);
+                    
+                    List<UsabilitySmell> smellList = smellMap.get(smell.getBriefDescription());
+                    
+                    if (smellList == null) {
+                        smellList = new ArrayList<UsabilitySmell>();
+                        smellMap.put(smell.getBriefDescription(), smellList);
+                    }
+                    
+                    int ratio = smell.getIntensity().getRatio();
+                    int eventCoverage = smell.getIntensity().getEventCoverage();
+                    int index = 0;
+                    for (index = 0; index < smellList.size(); index++) {
+                        UsabilitySmellIntensity candidate = smellList.get(index).getIntensity();
+                        if ((ratio == candidate.getRatio()) &&
+                            (eventCoverage > candidate.getEventCoverage()))
+                        {
+                            break;
+                        }
+                        else if (ratio > candidate.getRatio()) {
+                            break;
+                        }
+                    }
+                    
+                    smellList.add(index, smell);
                     
                     if (minEventCoverages[i] == 0) {
