Index: trunk/autoquest-ui-swt/src/main/java/de/ugoe/cs/autoquest/ui/swt/ShowTaskTreeDialog.java
===================================================================
--- trunk/autoquest-ui-swt/src/main/java/de/ugoe/cs/autoquest/ui/swt/ShowTaskTreeDialog.java	(revision 1262)
+++ trunk/autoquest-ui-swt/src/main/java/de/ugoe/cs/autoquest/ui/swt/ShowTaskTreeDialog.java	(revision 1275)
@@ -50,5 +50,5 @@
 /**
  * <p>
- * TODO comment
+ * a dialog to inspect the tasks and task instances of a task model
  * </p>
  * 
@@ -57,18 +57,18 @@
 public class ShowTaskTreeDialog extends Dialog {
 
-    /** */
+    /** the main shell */
     protected Shell shell;
     
-    /** */
+    /** the tree of task instances on the left */
     private Tree instanceTree;
     
-    /** */
+    /** the tree of tasks (model) on the right*/
     private Tree modelTree;
 
-    /** */
+    /** the displayed task model */
     protected ITaskModel taskModel;
 
     /**
-     * 
+     * creates the dialog
      */
     public ShowTaskTreeDialog(Shell parent, int style, ITaskModel taskModel, String taskTreeName) {
@@ -79,5 +79,5 @@
 
     /**
-     * 
+     * displays the dialog
      */
     public void open() {
@@ -94,5 +94,7 @@
 
     /**
-     * 
+     * creates the two views, one on the task instances on the left, on on the task models on the
+     * right. Also adds a selection adapter to the task instances so that for a selected task
+     * instance always the respective model is presented.
      */
     private void createContents() {
@@ -154,5 +156,5 @@
 
     /**
-     * 
+     * convenience method for creating the display of the instances
      */
     private void buildInstanceTree() {
@@ -169,5 +171,5 @@
 
     /**
-     * 
+     * convenience method for creating the display of the instances
      */
     private void buildInstanceTree(TreeItem currentParent, ITaskInstanceList taskInstanceList) {
@@ -182,5 +184,5 @@
 
     /**
-     * 
+     * convenience method for creating the display of the task model
      */
     private void buildModelTree(ITaskModel taskModel) {
@@ -213,5 +215,5 @@
 
     /**
-     * 
+     * convenience method for creating the display of the task model
      */
     private void buildModelTree(ITaskInstance taskInstance) {
@@ -227,5 +229,6 @@
 
     /**
-     *
+     * reduces the list of tasks in a model so that it only contains root nodes and that it is 
+     * sorted starting with the most complex task first 
      */
     private List<ITask> createSortedTaskList(Collection<ITask> tasks) {
@@ -241,5 +244,5 @@
             @Override
             public int compare(ITask task1, ITask task2) {
-                return depth(task1) - depth(task2);
+                return depth(task2) - depth(task1);
             }
 
@@ -263,5 +266,5 @@
 
     /**
-     *
+     * convenience method for removed all non root tasks of the provided list
      */
     private void removeChildren(ITask task, Set<ITask> result) {
@@ -269,15 +272,13 @@
             for (ITask child : ((IStructuringTemporalRelationship) task).getChildren()) {
                 result.remove(child);
-                //removeChildren(child, result);
             }
         }
         else if (task instanceof IMarkingTemporalRelationship) {
             result.remove(((IMarkingTemporalRelationship) task).getMarkedTask());
-            //removeChildren(((IMarkingTemporalRelationship) task).getMarkedTask(), result);
-        }
-    }
-
-    /**
-     * 
+        }
+    }
+
+    /**
+     * expands all nodes in the tree
      */
     private void expandAll(Tree tree, boolean expanded) {
@@ -288,5 +289,5 @@
 
     /**
-     * 
+     * expands all nodes in the tree
      */
     private void expandAll(TreeItem item, boolean expanded, int maxChildrenToExpand) {
@@ -305,5 +306,5 @@
     
     /**
-     * 
+     * ensures, that the children of a specific node are loaded
      */
     private void ensureChildren(TreeItem parent) {
@@ -333,5 +334,5 @@
 
     /**
-     *
+     * convenience method to create a tree item for a task
      */
     private void createTreeItemFor(ITask task, TreeItem parent) {
