Index: /trunk/autoquest-ui-swt/pom.xml
===================================================================
--- /trunk/autoquest-ui-swt/pom.xml	(revision 1093)
+++ /trunk/autoquest-ui-swt/pom.xml	(revision 1094)
@@ -46,4 +46,9 @@
             <groupId>de.ugoe.cs.autoquest</groupId>
             <artifactId>autoquest-core-usageprofiles</artifactId>
+            <version>${project.parent.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>de.ugoe.cs.autoquest</groupId>
+            <artifactId>autoquest-core-tasktrees</artifactId>
             <version>${project.parent.version}</version>
         </dependency>
Index: /trunk/autoquest-ui-swt/src/main/java/de/ugoe/cs/autoquest/ui/swt/ModelsTabComposite.java
===================================================================
--- /trunk/autoquest-ui-swt/src/main/java/de/ugoe/cs/autoquest/ui/swt/ModelsTabComposite.java	(revision 1093)
+++ /trunk/autoquest-ui-swt/src/main/java/de/ugoe/cs/autoquest/ui/swt/ModelsTabComposite.java	(revision 1094)
@@ -23,4 +23,5 @@
 import org.eclipse.swt.layout.GridData;
 
+import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskTree;
 import de.ugoe.cs.autoquest.usageprofiles.FirstOrderMarkovModel;
 import de.ugoe.cs.autoquest.usageprofiles.IDotCompatible;
@@ -34,6 +35,22 @@
 public class ModelsTabComposite extends Composite {
 
+    /** */
     List modelList;
 
+    /** */
+    Button btnShow;
+
+    /** */
+    Button btnDelete_1;
+
+    /** */
+    Button btnGenSequences;
+
+    /** */
+    Button btnProperties;
+
+    /** */
+    Button btnCreateDot;
+    
     /**
      * Create the composite.
@@ -47,4 +64,7 @@
     }
 
+    /**
+     * 
+     */
     private void createContents() {
         setLayout(new GridLayout(5, false));
@@ -52,6 +72,43 @@
         modelList = new List(this, SWT.BORDER | SWT.V_SCROLL);
         modelList.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 5, 1));
-
-        Button btnShow = new Button(this, SWT.NONE);
+        modelList.addSelectionListener(new SelectionAdapter() {
+            @Override
+            public void widgetSelected(SelectionEvent e) {
+                String[] selectedStrings = modelList.getSelection();
+                if (selectedStrings.length == 1) {
+                    btnShow.setEnabled(true);
+                    btnDelete_1.setEnabled(true);
+                    Object obj = GlobalDataContainer.getInstance().getData(selectedStrings[0]);
+                    if (obj instanceof IStochasticProcess) {
+                        btnGenSequences.setEnabled(true);
+                        btnProperties.setEnabled(true);
+                        btnCreateDot.setEnabled(true);
+                    }
+                    else {
+                        btnGenSequences.setEnabled(false);
+                        btnProperties.setEnabled(false);
+                        btnCreateDot.setEnabled(false);
+                    }
+                }
+                else if (selectedStrings.length > 1) {
+                    btnShow.setEnabled(false);
+                    btnDelete_1.setEnabled(true);
+                    btnProperties.setEnabled(false);
+                    btnCreateDot.setEnabled(false);
+                    
+                    boolean enableSequenceGeneration = true;
+                    for (String selectedString : selectedStrings) {
+                        Object obj = GlobalDataContainer.getInstance().getData(selectedString);
+                        if (!(obj instanceof IStochasticProcess)) {
+                            enableSequenceGeneration = false;
+                            break;
+                        }
+                    }
+                    btnGenSequences.setEnabled(enableSequenceGeneration);
+                }
+            }
+        });
+
+        btnShow = new Button(this, SWT.NONE);
         btnShow.addSelectionListener(new SelectionAdapter() {
             @Override
@@ -62,16 +119,25 @@
                     return;
                 }
-                IStochasticProcess process =
-                    (IStochasticProcess) GlobalDataContainer.getInstance()
-                        .getData(selectedStrings[0]);
-                if (process instanceof FirstOrderMarkovModel) {
+                else if (selectedStrings.length > 1) {
+                    SWTHelpers.moreThanOneSelectedError(getShell());
+                    return;
+                }
+                
+                Object obj = GlobalDataContainer.getInstance().getData(selectedStrings[0]);
+                
+                if (obj instanceof FirstOrderMarkovModel) {
                     String command = "showMarkovModel " + selectedStrings[0];
                     CommandExecuter.getInstance().exec(command);
                 }
+                else if (obj instanceof ITaskTree) {
+                    ShowTaskTreeDialog showTaskTreeDialog = new ShowTaskTreeDialog
+                        (getShell(), SWT.NONE, (ITaskTree) obj, selectedStrings[0]);
+                    showTaskTreeDialog.open();
+                }
                 else {
                     MessageBox messageBox = new MessageBox(getShell(), SWT.NONE);
                     messageBox.setText("Feature Not Available");
-                    messageBox
-                        .setMessage("The feature is currently only available for first-order Markov models.");
+                    messageBox.setMessage("This feature is currently only available for " +
+                                          "first-order Markov models and task trees.");
                     messageBox.open();
                 }
@@ -79,6 +145,7 @@
         });
         btnShow.setText("Visualize");
-
-        Button btnDelete_1 = new Button(this, SWT.NONE);
+        btnShow.setEnabled(false);
+
+        btnDelete_1 = new Button(this, SWT.NONE);
         btnDelete_1.addSelectionListener(new SelectionAdapter() {
             @Override
@@ -93,6 +160,7 @@
         });
         btnDelete_1.setText("Delete");
-
-        Button btnGenSequences = new Button(this, SWT.NONE);
+        btnDelete_1.setEnabled(false);
+
+        btnGenSequences = new Button(this, SWT.NONE);
         btnGenSequences.addSelectionListener(new SelectionAdapter() {
             @Override
@@ -103,13 +171,33 @@
                     return;
                 }
-                GenerateSequencesDialog generateSequencesDialog =
-                    new GenerateSequencesDialog(getShell(), SWT.NONE);
-                generateSequencesDialog.setProcessName(selectedStrings[0]);
-                generateSequencesDialog.open();
+                
+                boolean enableSequenceGeneration = true;
+                for (String selectedString : selectedStrings) {
+                    Object obj = GlobalDataContainer.getInstance().getData(selectedString);
+                    if (!(obj instanceof IStochasticProcess)) {
+                        enableSequenceGeneration = false;
+                        break;
+                    }
+                }
+                
+                if (enableSequenceGeneration) {
+                    GenerateSequencesDialog generateSequencesDialog =
+                        new GenerateSequencesDialog(getShell(), SWT.NONE);
+                    generateSequencesDialog.setProcessName(selectedStrings[0]);
+                    generateSequencesDialog.open();
+                }
+                else {
+                    MessageBox messageBox = new MessageBox(getShell(), SWT.NONE);
+                    messageBox.setText("Feature Not Available");
+                    messageBox.setMessage("This feature is not available for task trees. Please " +
+                                          "deselect the selected task tree(s)!");
+                    messageBox.open();
+                }
             }
         });
         btnGenSequences.setText("Gen. Sequences");
-
-        Button btnProperties = new Button(this, SWT.NONE);
+        btnGenSequences.setEnabled(false);
+
+        btnProperties = new Button(this, SWT.NONE);
         btnProperties.addSelectionListener(new SelectionAdapter() {
             @Override
@@ -120,16 +208,32 @@
                     return;
                 }
-                IStochasticProcess process =
-                    (IStochasticProcess) GlobalDataContainer.getInstance()
-                        .getData(selectedStrings[0]);
-                ModelPropertiesDialog modelPropertiesDialog =
-                    new ModelPropertiesDialog(getShell(), SWT.NONE);
-                modelPropertiesDialog.setStochasticProcess(process);
-                modelPropertiesDialog.open();
+                else if (selectedStrings.length > 1) {
+                    SWTHelpers.moreThanOneSelectedError(getShell());
+                    return;
+                }
+                
+                Object obj = GlobalDataContainer.getInstance().getData(selectedStrings[0]);
+                
+                if (obj instanceof IStochasticProcess) {
+                    IStochasticProcess process = (IStochasticProcess) obj;
+                    ModelPropertiesDialog modelPropertiesDialog =
+                        new ModelPropertiesDialog(getShell(), SWT.NONE);
+                    modelPropertiesDialog.setStochasticProcess(process);
+                    modelPropertiesDialog.open();
+                }
+                else {
+                    MessageBox messageBox = new MessageBox(getShell(), SWT.NONE);
+                    messageBox.setText("Feature Not Available");
+                    messageBox.setMessage("The feature is currently only available for " +
+                                          "stochastic processes. Please select a model that " +
+                                          "is a stochastic process.");
+                    messageBox.open();
+                }
             }
         });
         btnProperties.setText("Properties");
-
-        Button btnCreateDot = new Button(this, SWT.NONE);
+        btnProperties.setEnabled(false);
+
+        btnCreateDot = new Button(this, SWT.NONE);
         btnCreateDot.addSelectionListener(new SelectionAdapter() {
             @Override
@@ -140,21 +244,39 @@
                     return;
                 }
-                IStochasticProcess process =
-                    (IStochasticProcess) GlobalDataContainer.getInstance()
-                        .getData(selectedStrings[0]);
-                String command = "";
-                if (process instanceof IDotCompatible) {
-                    command = "printDot ";
-                }
-                else {
-                    command = "printTrieDot ";
-                }
-                command += selectedStrings[0];
-                CommandExecuter.getInstance().exec(command);
+                else if (selectedStrings.length > 1) {
+                    SWTHelpers.moreThanOneSelectedError(getShell());
+                    return;
+                }
+                
+                Object obj = GlobalDataContainer.getInstance().getData(selectedStrings[0]);
+                
+                if (obj instanceof IStochasticProcess) {
+                    String command;
+                    if (obj instanceof IDotCompatible) {
+                        command = "printDot ";
+                    }
+                    else {
+                        command = "printTrieDot ";
+                    }
+                    command += selectedStrings[0];
+                    CommandExecuter.getInstance().exec(command);
+                }
+                else {
+                    MessageBox messageBox = new MessageBox(getShell(), SWT.NONE);
+                    messageBox.setText("Feature Not Available");
+                    messageBox.setMessage("The feature is currently only available for " +
+                                          "stochastic processes. Please select a model that " +
+                                          "is a stochastic process.");
+                    messageBox.open();
+                }
             }
         });
         btnCreateDot.setText("Create DOT");
+        btnCreateDot.setEnabled(false);
     }
 
+    /**
+     * 
+     */
     @Override
     protected void checkSubclass() {
@@ -162,8 +284,13 @@
     }
 
+    /**
+     * 
+     */
     public void updateModelList() {
         modelList.removeAll();
-        for(String key : GlobalDataContainer.getInstance().getAllKeys()) {
-            if( GlobalDataContainer.getInstance().getData(key) instanceof IStochasticProcess ) {
+        for (String key : GlobalDataContainer.getInstance().getAllKeys()) {
+            if ((GlobalDataContainer.getInstance().getData(key) instanceof IStochasticProcess) ||
+                (GlobalDataContainer.getInstance().getData(key) instanceof ITaskTree))
+            {
                 modelList.add(key);
             }
Index: /trunk/autoquest-ui-swt/src/main/java/de/ugoe/cs/autoquest/ui/swt/SWTHelpers.java
===================================================================
--- /trunk/autoquest-ui-swt/src/main/java/de/ugoe/cs/autoquest/ui/swt/SWTHelpers.java	(revision 1093)
+++ /trunk/autoquest-ui-swt/src/main/java/de/ugoe/cs/autoquest/ui/swt/SWTHelpers.java	(revision 1094)
@@ -22,6 +22,14 @@
 import de.ugoe.cs.util.console.CommandExecuter;
 
+/**
+ * TODO comment
+ *
+ * @author Steffen Herbold, Patrick Harms
+ */
 public class SWTHelpers {
 
+    /**
+     * 
+     */
     public static boolean deleteSelectedFromStorage(final List list) {
         String[] selectedStrings = list.getSelection();
@@ -38,7 +46,21 @@
     }
 
+    /**
+     * 
+     */
     public static void noSelectionError(final Shell shell) {
         MessageBox messageBox = new MessageBox(shell, SWT.ERROR);
-        messageBox.setMessage("No objects selected!");
+        messageBox.setMessage
+            ("No objects selected! Please select at least one object to execute this function");
+        messageBox.setText("Error");
+        messageBox.open();
+    }
+
+    /**
+     *
+     */
+    public static void moreThanOneSelectedError(final Shell shell) {
+        MessageBox messageBox = new MessageBox(shell, SWT.ERROR);
+        messageBox.setMessage("Too many objects selected for this function! Select only one!");
         messageBox.setText("Error");
         messageBox.open();
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 1094)
+++ /trunk/autoquest-ui-swt/src/main/java/de/ugoe/cs/autoquest/ui/swt/ShowTaskTreeDialog.java	(revision 1094)
@@ -0,0 +1,162 @@
+//   Copyright 2012 Georg-August-Universität Göttingen, Germany
+//
+//   Licensed under the Apache License, Version 2.0 (the "License");
+//   you may not use this file except in compliance with the License.
+//   You may obtain a copy of the License at
+//
+//       http://www.apache.org/licenses/LICENSE-2.0
+//
+//   Unless required by applicable law or agreed to in writing, software
+//   distributed under the License is distributed on an "AS IS" BASIS,
+//   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//   See the License for the specific language governing permissions and
+//   limitations under the License.
+
+package de.ugoe.cs.autoquest.ui.swt;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Dialog;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.swt.widgets.TreeItem;
+
+import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskTree;
+import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskTreeNode;
+
+import org.eclipse.swt.widgets.Label;
+
+/**
+ * <p>
+ * TODO comment
+ * </p>
+ * 
+ * @author Patrick Harms
+ */
+public class ShowTaskTreeDialog extends Dialog {
+
+    /** */
+    protected Shell shell;
+    
+    /** */
+    private Tree tree;
+
+    /** */
+    protected ITaskTree taskTree;
+
+    /**
+     * 
+     */
+    public ShowTaskTreeDialog(Shell parent, int style, ITaskTree taskTree, String taskTreeName) {
+        super(parent, style);
+        setText("Task Tree " + taskTreeName);
+        this.taskTree = taskTree;
+    }
+
+    /**
+     * 
+     */
+    public void open() {
+        createContents();
+        shell.open();
+        shell.layout();
+        Display display = getParent().getDisplay();
+        while (!shell.isDisposed()) {
+            if (!display.readAndDispatch()) {
+                display.sleep();
+            }
+        }
+    }
+
+    /**
+     * 
+     */
+    private void createContents() {
+        shell = new Shell(getParent(), SWT.SHELL_TRIM | SWT.BORDER | SWT.APPLICATION_MODAL);
+        shell.setSize(450, 300);
+        shell.setText(getText());
+
+        shell.setLayout(new GridLayout(4, false));
+
+        tree = new Tree(shell, SWT.BORDER | SWT.MULTI);
+        tree.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 4, 1));
+
+        buildTree();
+
+        Button btnExpandAll = new Button(shell, SWT.NONE);
+        btnExpandAll.addSelectionListener(new SelectionAdapter() {
+            @Override
+            public void widgetSelected(SelectionEvent e) {
+                expandAll(tree, true);
+            }
+        });
+        btnExpandAll.setText("Expand all");
+
+        Button btnCollapseAll = new Button(shell, SWT.NONE);
+        btnCollapseAll.addSelectionListener(new SelectionAdapter() {
+            @Override
+            public void widgetSelected(SelectionEvent e) {
+                expandAll(tree, false);
+            }
+        });
+        btnCollapseAll.setText("Collapse all");
+        
+        //new Label(shell, SWT.NONE);
+        new Label(shell, SWT.NONE);
+        new Label(shell, SWT.NONE);
+        new Label(shell, SWT.NONE);
+
+    }
+
+    /**
+     * 
+     */
+    private void buildTree() {
+        ITaskTreeNode root = taskTree.getRoot();
+        
+        TreeItem child = new TreeItem(tree, SWT.NULL);
+        child.setText(root.toString());
+        child.setData(root);
+        buildGuiTree(child, root);
+    }
+
+    /**
+     * 
+     */
+    private void buildGuiTree(TreeItem currentParent, ITaskTreeNode node) {
+        if (node.getChildren() != null) {
+            
+            for (ITaskTreeNode childTask : node.getChildren()) {
+                TreeItem child = new TreeItem(currentParent, SWT.NULL);
+                child.setText(childTask.toString());
+                child.setData(childTask);
+                buildGuiTree(child, childTask);
+            }
+        }
+    }
+
+    /**
+     * 
+     */
+    private void expandAll(Tree tree, boolean expanded) {
+        for (TreeItem item : tree.getItems()) {
+            expandAll(item, expanded);
+        }
+    }
+
+    /**
+     * 
+     */
+    private void expandAll(TreeItem item, boolean expanded) {
+        item.setExpanded(expanded);
+        for (TreeItem childItem : item.getItems()) {
+            expandAll(childItem, expanded);
+        }
+    }
+    
+}
