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 927)
+++ 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);
             }
