Index: trunk/autoquest-ui-swt/src/main/java/de/ugoe/cs/autoquest/ui/swt/AboutDialog.java
===================================================================
--- trunk/autoquest-ui-swt/src/main/java/de/ugoe/cs/autoquest/ui/swt/AboutDialog.java	(revision 922)
+++ trunk/autoquest-ui-swt/src/main/java/de/ugoe/cs/autoquest/ui/swt/AboutDialog.java	(revision 922)
@@ -0,0 +1,76 @@
+package de.ugoe.cs.autoquest.ui.swt;
+
+import org.eclipse.swt.program.Program;
+import org.eclipse.swt.widgets.Dialog;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.SWT;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.Hyperlink;
+import org.eclipse.swt.events.MouseAdapter;
+import org.eclipse.swt.events.MouseEvent;
+
+public class AboutDialog extends Dialog {
+
+    protected Shell shlAboutEventbenchconsole;
+    private final FormToolkit formToolkit = new FormToolkit(Display.getDefault());
+
+    /**
+     * Create the dialog.
+     * 
+     * @param parent
+     * @param style
+     */
+    public AboutDialog(Shell parent, int style) {
+        super(parent, style);
+        setText("SWT Dialog");
+    }
+
+    /**
+     * Open the dialog.
+     */
+    public void open() {
+        createContents();
+        shlAboutEventbenchconsole.open();
+        shlAboutEventbenchconsole.layout();
+        Display display = getParent().getDisplay();
+        while (!shlAboutEventbenchconsole.isDisposed()) {
+            if (!display.readAndDispatch()) {
+                display.sleep();
+            }
+        }
+    }
+
+    /**
+     * Create contents of the dialog.
+     */
+    private void createContents() {
+        shlAboutEventbenchconsole = new Shell(getParent(), SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL);
+        shlAboutEventbenchconsole.setSize(283, 113);
+        shlAboutEventbenchconsole.setText("About EventBenchConsole");
+
+        Label lblEventbenchconsole = new Label(shlAboutEventbenchconsole, SWT.CENTER);
+        lblEventbenchconsole.setBounds(10, 10, 267, 15);
+        lblEventbenchconsole.setText("EventBenchConsole");
+
+        Label lblFurtherInformationAbout = new Label(shlAboutEventbenchconsole, SWT.WRAP);
+        lblFurtherInformationAbout.setBounds(10, 31, 267, 31);
+        lblFurtherInformationAbout
+            .setText("Further information about this software is provided on our homepage.");
+
+        final Hyperlink hprlnkHttpeventbenchinformatikunigoettingende =
+            formToolkit.createHyperlink(shlAboutEventbenchconsole,
+                                        "http://eventbench.informatik.uni-goettingen.de", SWT.NONE);
+        hprlnkHttpeventbenchinformatikunigoettingende.addMouseListener(new MouseAdapter() {
+            @Override
+            public void mouseDown(MouseEvent e) {
+                Program.launch(hprlnkHttpeventbenchinformatikunigoettingende.getText());
+            }
+        });
+        hprlnkHttpeventbenchinformatikunigoettingende.setBounds(10, 68, 267, 17);
+        formToolkit.paintBordersFor(hprlnkHttpeventbenchinformatikunigoettingende);
+        hprlnkHttpeventbenchinformatikunigoettingende.setBackground(null);
+
+    }
+}
Index: trunk/autoquest-ui-swt/src/main/java/de/ugoe/cs/autoquest/ui/swt/AbstractInsertEventComposite.java
===================================================================
--- trunk/autoquest-ui-swt/src/main/java/de/ugoe/cs/autoquest/ui/swt/AbstractInsertEventComposite.java	(revision 922)
+++ trunk/autoquest-ui-swt/src/main/java/de/ugoe/cs/autoquest/ui/swt/AbstractInsertEventComposite.java	(revision 922)
@@ -0,0 +1,19 @@
+package de.ugoe.cs.autoquest.ui.swt;
+
+import org.eclipse.swt.widgets.Composite;
+
+import de.ugoe.cs.autoquest.eventcore.Event;
+import de.ugoe.cs.autoquest.eventcore.guimodel.GUIModel;
+
+abstract public class AbstractInsertEventComposite extends Composite {
+
+    protected GUIModel guiModel;
+
+    public AbstractInsertEventComposite(Composite parent, int style, GUIModel guiModel) {
+        super(parent, style);
+        this.guiModel = guiModel;
+    }
+
+    public abstract Event getEvent();
+
+}
Index: trunk/autoquest-ui-swt/src/main/java/de/ugoe/cs/autoquest/ui/swt/CommandHistoryDialog.java
===================================================================
--- trunk/autoquest-ui-swt/src/main/java/de/ugoe/cs/autoquest/ui/swt/CommandHistoryDialog.java	(revision 922)
+++ trunk/autoquest-ui-swt/src/main/java/de/ugoe/cs/autoquest/ui/swt/CommandHistoryDialog.java	(revision 922)
@@ -0,0 +1,185 @@
+package de.ugoe.cs.autoquest.ui.swt;
+
+import java.awt.Toolkit;
+import java.awt.datatransfer.Clipboard;
+import java.awt.datatransfer.StringSelection;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.OutputStreamWriter;
+import java.util.LinkedList;
+import java.util.logging.Level;
+
+import org.eclipse.swt.widgets.Dialog;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.FileDialog;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.List;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.layout.GridData;
+
+import de.ugoe.cs.util.StringTools;
+import de.ugoe.cs.util.console.CommandExecuter;
+import de.ugoe.cs.util.console.Console;
+import de.ugoe.cs.util.console.listener.ICommandListener;
+
+import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+
+public class CommandHistoryDialog extends Dialog implements ICommandListener {
+
+    protected java.util.List<String> history = new LinkedList<String>();
+
+    protected List commandHistoryList;
+    protected Shell shell;
+
+    boolean isOpen;
+
+    /**
+     * Create the dialog.
+     * 
+     * @param parent
+     * @param style
+     */
+    public CommandHistoryDialog(Shell parent, int style) {
+        super(parent, style);
+        setText("Command History");
+        isOpen = false;
+        Console.getInstance().registerCommandListener(this);
+    }
+
+    /**
+     * Open the dialog.
+     */
+    public void open() {
+        createContents();
+        shell.open();
+        shell.layout();
+        isOpen = true;
+        Display display = getParent().getDisplay();
+        while (!shell.isDisposed()) {
+            if (!display.readAndDispatch()) {
+                display.sleep();
+            }
+        }
+    }
+
+    /**
+     * Create contents of the dialog.
+     */
+    private void createContents() {
+        shell = new Shell(getParent(), SWT.DIALOG_TRIM | SWT.RESIZE);
+        shell.addDisposeListener(new DisposeListener() {
+            public void widgetDisposed(DisposeEvent arg0) {
+                isOpen = false;
+            }
+        });
+        shell.setSize(450, 300);
+        shell.setText(getText());
+        shell.setLayout(new GridLayout(3, false));
+
+        Label lblRecentCommands = new Label(shell, SWT.NONE);
+        lblRecentCommands.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 2, 1));
+        lblRecentCommands.setText("Recent Commands:");
+        new Label(shell, SWT.NONE);
+
+        commandHistoryList = new List(shell, SWT.BORDER | SWT.V_SCROLL | SWT.MULTI);
+        commandHistoryList.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 3, 1));
+        for (String command : history) {
+            commandHistoryList.add(command);
+        }
+
+        Button btnExec = new Button(shell, SWT.NONE);
+        btnExec.addSelectionListener(new SelectionAdapter() {
+            @Override
+            public void widgetSelected(SelectionEvent e) {
+                for (String command : commandHistoryList.getSelection()) {
+                    CommandExecuter.getInstance().exec(command);
+                }
+            }
+        });
+        btnExec.setText("Execute");
+
+        Button btnCopyToClipboard = new Button(shell, SWT.NONE);
+        btnCopyToClipboard.addSelectionListener(new SelectionAdapter() {
+            @Override
+            public void widgetSelected(SelectionEvent e) {
+                Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
+                StringSelection content = new StringSelection(getSelectedCommands());
+                clipboard.setContents(content, null);
+            }
+        });
+        btnCopyToClipboard.setText("Copy to Clipboard");
+
+        Button btnCreateBatchfile = new Button(shell, SWT.NONE);
+        btnCreateBatchfile.addSelectionListener(new SelectionAdapter() {
+            @Override
+            public void widgetSelected(SelectionEvent event) {
+                FileDialog fileDialog = new FileDialog(shell, SWT.SAVE);
+                String filename = fileDialog.open();
+                if (filename != null) {
+                    File file = new File(filename);
+                    boolean fileCreated;
+                    try {
+                        fileCreated = file.createNewFile();
+                        if (!fileCreated) {
+                            Console.traceln(Level.INFO, "Created batchfile " + filename);
+                        }
+                        else {
+                            Console.traceln(Level.INFO, "Overwrote file " + filename);
+                        }
+                    }
+                    catch (IOException e) {
+                        Console.printerrln("Unable to create file " + filename);
+                        Console.logException(e);
+                    }
+                    OutputStreamWriter writer = null;
+                    try {
+                        writer = new OutputStreamWriter(new FileOutputStream(file), "UTF-8");
+                    }
+                    catch (IOException e) {
+                        Console.printerrln("Unable to open file for writing (read-only file):" +
+                            filename);
+                        Console.logException(e);
+                        return;
+                    }
+                    try {
+                        writer.write(getSelectedCommands());
+                        writer.close();
+                    }
+                    catch (IOException e) {
+                        Console.printerrln("Unable to write to file.");
+                        Console.logException(e);
+                    }
+                }
+            }
+        });
+        btnCreateBatchfile.setText("Create Batchfile");
+
+    }
+
+    @Override
+    public void commandNotification(String command) {
+        history.add(command);
+        if (isOpen) {
+            commandHistoryList.add(command);
+        }
+    }
+
+    public boolean isOpen() {
+        return isOpen;
+    }
+
+    private String getSelectedCommands() {
+        StringBuilder commands = new StringBuilder();
+        for (String command : commandHistoryList.getSelection()) {
+            commands.append(command + StringTools.ENDLINE);
+        }
+        return commands.toString();
+    }
+}
Index: trunk/autoquest-ui-swt/src/main/java/de/ugoe/cs/autoquest/ui/swt/ConsoleTabComposite.java
===================================================================
--- trunk/autoquest-ui-swt/src/main/java/de/ugoe/cs/autoquest/ui/swt/ConsoleTabComposite.java	(revision 922)
+++ trunk/autoquest-ui-swt/src/main/java/de/ugoe/cs/autoquest/ui/swt/ConsoleTabComposite.java	(revision 922)
@@ -0,0 +1,101 @@
+package de.ugoe.cs.autoquest.ui.swt;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.custom.StyledText;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+
+import org.eclipse.swt.events.KeyAdapter;
+import org.eclipse.swt.events.KeyEvent;
+
+import de.ugoe.cs.util.console.CommandExecuter;
+
+/**
+ * <p>
+ * Implements the composite for the console tab in the applications main window.
+ * </p>
+ * 
+ * @author Steffen Herbold
+ * @version 1.0
+ */
+public class ConsoleTabComposite extends Composite {
+
+    protected Text textCommand;
+
+    protected StyledText textConsoleOutput;
+
+    /**
+     * Create the composite.
+     * 
+     * @param parent
+     * @param style
+     */
+    public ConsoleTabComposite(Composite parent, int style) {
+        super(parent, style);
+        createContents();
+    }
+
+    private void createContents() {
+        setLayout(new GridLayout(3, false));
+
+        Label lblCommand = new Label(this, SWT.NONE);
+        lblCommand.setText("Command:");
+
+        textCommand = new Text(this, SWT.BORDER);
+        textCommand.addKeyListener(new KeyAdapter() {
+            @Override
+            public void keyReleased(KeyEvent e) {
+                if (e.keyCode == SWT.CR) {
+                    executeCommand();
+                }
+            }
+        });
+        GridData gd_textCommand = new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1);
+        gd_textCommand.widthHint = 304;
+        textCommand.setLayoutData(gd_textCommand);
+        textCommand.setFocus();
+
+        Button btnEnter = new Button(this, SWT.NONE);
+        btnEnter.addSelectionListener(new SelectionAdapter() {
+            @Override
+            public void widgetSelected(SelectionEvent e) {
+                executeCommand();
+            }
+        });
+        btnEnter.setText("Enter");
+
+        textConsoleOutput =
+            new StyledText(this, SWT.BORDER | SWT.READ_ONLY | SWT.H_SCROLL | SWT.V_SCROLL |
+                SWT.CANCEL);
+        GridData gd_textConsoleOutput = new GridData(SWT.FILL, SWT.FILL, true, true, 3, 1);
+        gd_textConsoleOutput.heightHint = 102;
+        gd_textConsoleOutput.widthHint = 456;
+        textConsoleOutput.setLayoutData(gd_textConsoleOutput);
+        textConsoleOutput.addListener(SWT.Modify, new Listener() {
+            public void handleEvent(Event e) {
+                textConsoleOutput.setTopIndex(textConsoleOutput.getLineCount() - 1);
+            }
+        });
+
+    }
+
+    private void executeCommand() {
+        String command = textCommand.getText().trim();
+        CommandExecuter.getInstance().exec(command);
+        textCommand.setText("");
+    }
+
+    @Override
+    protected void checkSubclass() {
+        // Disable the check that prevents subclassing of SWT components
+    }
+
+}
Index: trunk/autoquest-ui-swt/src/main/java/de/ugoe/cs/autoquest/ui/swt/DataTabComposite.java
===================================================================
--- trunk/autoquest-ui-swt/src/main/java/de/ugoe/cs/autoquest/ui/swt/DataTabComposite.java	(revision 922)
+++ trunk/autoquest-ui-swt/src/main/java/de/ugoe/cs/autoquest/ui/swt/DataTabComposite.java	(revision 922)
@@ -0,0 +1,117 @@
+package de.ugoe.cs.autoquest.ui.swt;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.FileDialog;
+import org.eclipse.swt.widgets.List;
+import org.eclipse.swt.widgets.MessageBox;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.layout.GridData;
+
+import de.ugoe.cs.util.StringTools;
+import de.ugoe.cs.util.console.CommandExecuter;
+import de.ugoe.cs.util.console.GlobalDataContainer;
+
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+
+public class DataTabComposite extends Composite {
+
+    List dataList;
+
+    /**
+     * Create the composite.
+     * 
+     * @param parent
+     * @param style
+     */
+    public DataTabComposite(Composite parent, int style) {
+        super(parent, style);
+        createContent();
+    }
+
+    private void createContent() {
+        setLayout(new GridLayout(3, false));
+
+        dataList = new List(this, SWT.BORDER | SWT.V_SCROLL);
+        dataList.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 3, 1));
+
+        Button btnLoad = new Button(this, SWT.NONE);
+        btnLoad.addSelectionListener(new SelectionAdapter() {
+            @Override
+            public void widgetSelected(SelectionEvent e) {
+                GetObjectNameDialog getObjectNameDialog =
+                    new GetObjectNameDialog(getShell(), SWT.NONE);
+                getObjectNameDialog.open();
+                String objectName = getObjectNameDialog.getObjectName();
+                if ("".equals(objectName)) {
+                    return;
+                }
+                FileDialog fileDialog = new FileDialog(getShell(), SWT.OPEN);
+                String filename = fileDialog.open();
+                if (filename == null) {
+                    return;
+                }
+                String command = "loadObject " + filename + " " + objectName;
+                CommandExecuter.getInstance().exec(command);
+                updateDataList();
+            }
+        });
+        btnLoad.setText("Load");
+
+        Button btnSave = new Button(this, SWT.NONE);
+        btnSave.addSelectionListener(new SelectionAdapter() {
+            @Override
+            public void widgetSelected(SelectionEvent e) {
+                String[] selectedStrings = dataList.getSelection();
+                if (selectedStrings.length == 0) {
+                    SWTHelpers.noSelectionError(getShell());
+                    return;
+                }
+                if (selectedStrings.length > 1) {
+                    MessageBox messageBox = new MessageBox(getShell(), SWT.ERROR);
+                    messageBox.setText("Error");
+                    messageBox.setMessage("Only one object storable at a time." +
+                        StringTools.ENDLINE + "Please select only one object.");
+                    return;
+                }
+                FileDialog fileDialog = new FileDialog(getShell(), SWT.SAVE);
+                String filename = fileDialog.open();
+                if (filename == null) {
+                    return;
+                }
+                String command = "saveObject " + filename + " " + selectedStrings[0];
+                CommandExecuter.getInstance().exec(command);
+            }
+        });
+        btnSave.setText("Save");
+
+        Button btnDelete_2 = new Button(this, SWT.NONE);
+        btnDelete_2.addSelectionListener(new SelectionAdapter() {
+            @Override
+            public void widgetSelected(SelectionEvent e) {
+                if (SWTHelpers.deleteSelectedFromStorage(dataList)) {
+                    updateDataList();
+                }
+                else {
+                    SWTHelpers.noSelectionError(getShell());
+                }
+            }
+        });
+        btnDelete_2.setText("Delete");
+    }
+
+    @Override
+    protected void checkSubclass() {
+        // Disable the check that prevents subclassing of SWT components
+    }
+
+    public void updateDataList() {
+        dataList.removeAll();
+        for (String key : GlobalDataContainer.getInstance().getAllKeys()) {
+            dataList.add(key + " (" + GlobalDataContainer.getInstance().getData(key).getClass().toString() + ")");
+        }
+    }
+
+}
Index: trunk/autoquest-ui-swt/src/main/java/de/ugoe/cs/autoquest/ui/swt/EditSequenceDialog.java
===================================================================
--- trunk/autoquest-ui-swt/src/main/java/de/ugoe/cs/autoquest/ui/swt/EditSequenceDialog.java	(revision 922)
+++ trunk/autoquest-ui-swt/src/main/java/de/ugoe/cs/autoquest/ui/swt/EditSequenceDialog.java	(revision 922)
@@ -0,0 +1,209 @@
+package de.ugoe.cs.autoquest.ui.swt;
+
+import org.eclipse.swt.widgets.Dialog;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.MessageBox;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.TableItem;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Point;
+
+import de.ugoe.cs.autoquest.eventcore.Event;
+import de.ugoe.cs.autoquest.eventcore.guimodel.GUIModel;
+
+public class EditSequenceDialog extends Dialog {
+
+    protected Shell shell;
+    private Table table;
+    private TableColumn tblclmnEventIndex;
+    private TableColumn tblclmnEventType;
+    private TableColumn tblclmnEventTarget;
+
+    private java.util.List<Event> sequence;
+    private GUIModel guiModel;
+
+    /**
+     * Create the dialog.
+     * 
+     * @param parent
+     * @param style
+     */
+    public EditSequenceDialog(Shell parent, int style, GUIModel guiModel) {
+        super(parent, style);
+        setText("SWT Dialog");
+        this.guiModel = guiModel;
+    }
+
+    /**
+     * Open the dialog.
+     */
+    public void open(java.util.List<Event> sequence) {
+        this.sequence = sequence;
+        createContents();
+        shell.open();
+        shell.layout();
+        Display display = getParent().getDisplay();
+        while (!shell.isDisposed()) {
+            if (!display.readAndDispatch()) {
+                display.sleep();
+            }
+        }
+    }
+
+    /**
+     * Create contents of the dialog.
+     */
+    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(3, false));
+
+        table = new Table(shell, SWT.BORDER | SWT.FULL_SELECTION);
+        table.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 3, 1));
+        table.setHeaderVisible(true);
+        table.setLinesVisible(true);
+        
+        tblclmnEventIndex = new TableColumn(table, SWT.NONE);
+        tblclmnEventIndex.setAlignment(20);
+        
+
+        tblclmnEventType = new TableColumn(table, SWT.NONE);
+        tblclmnEventType.setWidth(100);
+        tblclmnEventType.setText("Event Type");
+
+        tblclmnEventTarget = new TableColumn(table, SWT.NONE);
+        tblclmnEventTarget.setWidth(100);
+        tblclmnEventTarget.setText("Event Target");
+
+        // this listener makes the table entries multiline
+        Listener paintListener = new Listener() {
+            public void handleEvent(org.eclipse.swt.widgets.Event event) {
+                switch (event.type)
+                {
+                    case SWT.MeasureItem: {
+                        TableItem item = (TableItem) event.item;
+                        String text = item.getText(event.index);
+                        Point size = event.gc.textExtent(text);
+                        event.width = size.x;
+                        event.height = Math.max(event.height, size.y);
+                        break;
+                    }
+                    case SWT.PaintItem: {
+                        TableItem item = (TableItem) event.item;
+                        String text = item.getText(event.index);
+                        Point size = event.gc.textExtent(text);
+                        int offset =
+                            event.index == 0 ? Math.max(0, (event.height - size.y) / 2) : 0;
+                        event.gc.drawText(text, event.x, event.y + offset, true);
+                        break;
+                    }
+                    case SWT.EraseItem:
+                        event.detail &= ~SWT.FOREGROUND;
+                        break;
+                    default:
+                        break;
+                }
+            }
+
+        };
+        table.addListener(SWT.MeasureItem, paintListener);
+        table.addListener(SWT.PaintItem, paintListener);
+        table.addListener(SWT.EraseItem, paintListener);
+
+        updateTableContents();
+
+        Button btnInsertBefore = new Button(shell, SWT.NONE);
+        btnInsertBefore.addSelectionListener(new SelectionAdapter() {
+            @Override
+            public void widgetSelected(SelectionEvent e) {
+                int index = table.getSelectionIndex();
+                if (index == -1) {
+                    MessageBox messageBox = new MessageBox(shell, SWT.ERROR);
+                    messageBox.setMessage("No event selected!");
+                    messageBox.setText("Error");
+                    messageBox.open();
+                }
+                else {
+                    openInsertDialog(index);
+                }
+            }
+        });
+        btnInsertBefore.setText("Insert Before");
+
+        Button btnInsertAfter = new Button(shell, SWT.NONE);
+        btnInsertAfter.addSelectionListener(new SelectionAdapter() {
+            @Override
+            public void widgetSelected(SelectionEvent e) {
+                int index = table.getSelectionIndex();
+                if (index == -1) {
+                    MessageBox messageBox = new MessageBox(shell, SWT.ERROR);
+                    messageBox.setMessage("No event selected!");
+                    messageBox.setText("Error");
+                    messageBox.open();
+                }
+                else {
+                    openInsertDialog(index + 1);
+                }
+            }
+        });
+        btnInsertAfter.setText("Insert After");
+
+        Button btnClose = new Button(shell, SWT.NONE);
+        btnClose.addSelectionListener(new SelectionAdapter() {
+            @Override
+            public void widgetSelected(SelectionEvent e) {
+                shell.dispose();
+            }
+        });
+        btnClose.setText("Close");
+
+    }
+
+    private void updateTableContents() {
+        table.removeAll();
+        int index = 1;
+        for (Event event : sequence) {
+            TableItem tableItem = new TableItem(table, SWT.NONE);
+            String target = null;
+            if( event.getTarget()!=null ) {
+                target = event.getTarget().toString();
+            }
+            if (target != null) {
+                // the target is split into multiple lines, as one line may
+                // only be 259 characters in tables with Windows
+                target = target.replace("].", "].\n");
+            }
+            tableItem.setText(new String[]
+                { ""+(index++), event.getType().toString(), target });
+        }
+        for (int i = 0; i < table.getColumnCount(); i++) {
+            table.getColumn(i).pack();
+        }
+    }
+
+    private void openInsertDialog(int position) {
+        if (guiModel == null) {
+            MessageBox messageBox = new MessageBox(shell, SWT.ERROR);
+            messageBox.setMessage("Operation not supported!\nOnly works for GUI sequences.");
+            messageBox.setText("Error");
+            messageBox.open();
+        } else {
+            InsertAssertionDialog insertDialog = new InsertAssertionDialog(shell, SWT.NONE, guiModel);
+            Event event = insertDialog.open();
+            if (event != null) {
+                sequence.add(position, event);
+                updateTableContents();
+            }
+        }
+    }
+
+}
Index: trunk/autoquest-ui-swt/src/main/java/de/ugoe/cs/autoquest/ui/swt/GenerateSequencesDialog.java
===================================================================
--- trunk/autoquest-ui-swt/src/main/java/de/ugoe/cs/autoquest/ui/swt/GenerateSequencesDialog.java	(revision 922)
+++ trunk/autoquest-ui-swt/src/main/java/de/ugoe/cs/autoquest/ui/swt/GenerateSequencesDialog.java	(revision 922)
@@ -0,0 +1,214 @@
+package de.ugoe.cs.autoquest.ui.swt;
+
+import org.eclipse.swt.widgets.Dialog;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.MessageBox;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Spinner;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.layout.GridData;
+
+import de.ugoe.cs.util.console.CommandExecuter;
+
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+
+public class GenerateSequencesDialog extends Dialog {
+
+    private String processName;
+
+    protected Button btnNumberAll;
+    protected Button btnLengthAll;
+    protected Spinner numberSpinner;
+    protected Spinner iterationsSpinner;
+    protected Spinner minLengthSpinner;
+    protected Spinner maxLengthSpinner;
+
+    protected Shell shlGenerateSequences;
+    private Text sequencesNameText;
+    private final FormToolkit formToolkit = new FormToolkit(Display.getDefault());
+
+    /**
+     * Create the dialog.
+     * 
+     * @param parent
+     * @param style
+     */
+    public GenerateSequencesDialog(Shell parent, int style) {
+        super(parent, style);
+        setText("SWT Dialog");
+    }
+
+    /**
+     * Open the dialog.
+     */
+    public void open() {
+        createContents();
+        shlGenerateSequences.open();
+        shlGenerateSequences.layout();
+        Display display = getParent().getDisplay();
+        while (!shlGenerateSequences.isDisposed()) {
+            if (!display.readAndDispatch()) {
+                display.sleep();
+            }
+        }
+    }
+
+    /**
+     * Create contents of the dialog.
+     */
+    private void createContents() {
+        shlGenerateSequences = new Shell(getParent(), SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL);
+        shlGenerateSequences.setSize(201, 303);
+        shlGenerateSequences.setText("Generate Sequences");
+        shlGenerateSequences.setLayout(new GridLayout(2, false));
+
+        Group group = new Group(shlGenerateSequences, SWT.NONE);
+        group.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 2, 1));
+        group.setText("Name");
+        group.setLayout(new GridLayout(1, false));
+
+        sequencesNameText = new Text(group, SWT.BORDER);
+        sequencesNameText.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
+
+        Group grpNumber = new Group(shlGenerateSequences, SWT.NONE);
+        grpNumber.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
+        grpNumber.setText("Number");
+        grpNumber.setLayout(new GridLayout(2, false));
+
+        numberSpinner = new Spinner(grpNumber, SWT.BORDER);
+        numberSpinner.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
+        numberSpinner.setMinimum(1);
+        numberSpinner.setMaximum(Integer.MAX_VALUE);
+
+        btnNumberAll = new Button(grpNumber, SWT.CHECK);
+        btnNumberAll.addSelectionListener(new SelectionAdapter() {
+            @Override
+            public void widgetSelected(SelectionEvent e) {
+                numberSpinner.setEnabled(!btnNumberAll.getSelection());
+                btnLengthAll.setEnabled(!btnNumberAll.getSelection());
+                iterationsSpinner.setEnabled(!btnNumberAll.getSelection());
+            }
+        });
+        btnNumberAll.setText("All");
+
+        Group grpIterations = new Group(shlGenerateSequences, SWT.NONE);
+        grpIterations.setLayout(new GridLayout(1, false));
+        grpIterations.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 2, 1));
+        grpIterations.setText("Iterations");
+
+        iterationsSpinner = new Spinner(grpIterations, SWT.BORDER);
+        iterationsSpinner.setMinimum(1);
+        iterationsSpinner.setMaximum(Integer.MAX_VALUE);
+        iterationsSpinner.setSelection(100000);
+        iterationsSpinner.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
+
+        Group grpLength = new Group(shlGenerateSequences, SWT.NONE);
+        grpLength.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 2, 1));
+        grpLength.setText("Length");
+        grpLength.setLayout(new GridLayout(4, false));
+
+        btnLengthAll = new Button(grpLength, SWT.CHECK);
+        btnLengthAll.addSelectionListener(new SelectionAdapter() {
+            @Override
+            public void widgetSelected(SelectionEvent e) {
+                minLengthSpinner.setEnabled(!btnLengthAll.getSelection());
+                maxLengthSpinner.setEnabled(!btnLengthAll.getSelection());
+            }
+        });
+        btnLengthAll.setText("All");
+        new Label(grpLength, SWT.NONE);
+        new Label(grpLength, SWT.NONE);
+        new Label(grpLength, SWT.NONE);
+
+        Label label = new Label(grpLength, SWT.NONE);
+        label.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
+        label.setText("Min.");
+
+        minLengthSpinner = new Spinner(grpLength, SWT.BORDER);
+        minLengthSpinner.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
+        minLengthSpinner.setMinimum(1);
+
+        Label label_1 = new Label(grpLength, SWT.NONE);
+        label_1.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, true, 1, 1));
+        label_1.setText("Max.");
+
+        maxLengthSpinner = new Spinner(grpLength, SWT.BORDER);
+        maxLengthSpinner.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
+        maxLengthSpinner.setToolTipText("0 means no limitations");
+        maxLengthSpinner.setMinimum(1);
+
+        Button btnGenerate = formToolkit.createButton(shlGenerateSequences, "Generate!", SWT.NONE);
+        btnGenerate.addSelectionListener(new SelectionAdapter() {
+            @Override
+            public void widgetSelected(SelectionEvent e) {
+                if ("".equals(sequencesNameText.getText())) {
+                    MessageBox messageBox = new MessageBox(shlGenerateSequences, SWT.ERROR);
+                    messageBox.setText("Error");
+                    messageBox.setMessage("Sequences name not defined!");
+                    messageBox.open();
+                    return;
+                }
+                String sequencesName = sequencesNameText.getText();
+                int number = numberSpinner.getSelection();
+                int minLength = minLengthSpinner.getSelection();
+                int maxLength = maxLengthSpinner.getSelection();
+                int maxIter = iterationsSpinner.getSelection();
+                if (maxIter <= number) {
+                    maxIter = number;
+                }
+                String command = "";
+                if (btnNumberAll.getSelection()) {
+                    if (minLength > maxLength) {
+                        MessageBox messageBox = new MessageBox(shlGenerateSequences, SWT.ERROR);
+                        messageBox.setText("Error");
+                        messageBox
+                            .setMessage("Min. length must be smaller than or equal to max. length!");
+                        messageBox.open();
+                        return;
+                    }
+                    command =
+                        "generateFixedLengthSequences " + processName + " " + sequencesName + " " +
+                            minLength + " " + maxLength + " true";
+                }
+                else {
+                    command =
+                        "generateRandomSequences " + processName + " " + sequencesName + " " +
+                            number + " " + maxIter;
+                    if (!btnLengthAll.getSelection()) {
+                        if (minLength > maxLength) {
+                            MessageBox messageBox = new MessageBox(shlGenerateSequences, SWT.ERROR);
+                            messageBox.setText("Error");
+                            messageBox
+                                .setMessage("Min. length must be smaller than or equal to max. length!");
+                            messageBox.open();
+                            return;
+                        }
+                        command += " " + minLength + " " + maxLength;
+                    }
+                }
+                CommandExecuter.getInstance().exec(command);
+                shlGenerateSequences.dispose();
+            }
+        });
+
+        Button btnAbort = formToolkit.createButton(shlGenerateSequences, "Abort", SWT.NONE);
+        btnAbort.addSelectionListener(new SelectionAdapter() {
+            @Override
+            public void widgetSelected(SelectionEvent e) {
+                shlGenerateSequences.dispose();
+            }
+        });
+
+    }
+
+    public void setProcessName(String name) {
+        this.processName = name;
+    }
+}
Index: trunk/autoquest-ui-swt/src/main/java/de/ugoe/cs/autoquest/ui/swt/GetObjectNameDialog.java
===================================================================
--- trunk/autoquest-ui-swt/src/main/java/de/ugoe/cs/autoquest/ui/swt/GetObjectNameDialog.java	(revision 922)
+++ trunk/autoquest-ui-swt/src/main/java/de/ugoe/cs/autoquest/ui/swt/GetObjectNameDialog.java	(revision 922)
@@ -0,0 +1,97 @@
+package de.ugoe.cs.autoquest.ui.swt;
+
+import org.eclipse.swt.widgets.Dialog;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.MessageBox;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+
+public class GetObjectNameDialog extends Dialog {
+
+    String objectName = "";
+
+    protected Shell shlObjectName;
+    private Text text;
+
+    /**
+     * Create the dialog.
+     * 
+     * @param parent
+     * @param style
+     */
+    public GetObjectNameDialog(Shell parent, int style) {
+        super(parent, style);
+        setText("SWT Dialog");
+    }
+
+    /**
+     * Open the dialog.
+     */
+    public void open() {
+        createContents();
+        shlObjectName.open();
+        shlObjectName.layout();
+        Display display = getParent().getDisplay();
+        while (!shlObjectName.isDisposed()) {
+            if (!display.readAndDispatch()) {
+                display.sleep();
+            }
+        }
+    }
+
+    /**
+     * Create contents of the dialog.
+     */
+    private void createContents() {
+        shlObjectName = new Shell(getParent(), SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL);
+        shlObjectName.setSize(171, 109);
+        shlObjectName.setText("Object Name");
+        shlObjectName.setLayout(new GridLayout(2, false));
+
+        Label lblPleaseEnterThe = new Label(shlObjectName, SWT.NONE);
+        lblPleaseEnterThe.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 2, 1));
+        lblPleaseEnterThe.setText("Please enter the object name:");
+
+        text = new Text(shlObjectName, SWT.BORDER);
+        text.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
+
+        Button btnOk = new Button(shlObjectName, SWT.NONE);
+        btnOk.addSelectionListener(new SelectionAdapter() {
+            @Override
+            public void widgetSelected(SelectionEvent e) {
+                if (text.getText().equals("")) {
+                    MessageBox messageBox = new MessageBox(shlObjectName, SWT.ERROR);
+                    messageBox.setText("Error");
+                    messageBox.setMessage("No name entered!");
+                    return;
+                }
+                objectName = text.getText();
+                shlObjectName.dispose();
+            }
+        });
+        btnOk.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
+        btnOk.setText("Ok");
+
+        Button btnAbort = new Button(shlObjectName, SWT.NONE);
+        btnAbort.addSelectionListener(new SelectionAdapter() {
+            @Override
+            public void widgetSelected(SelectionEvent e) {
+                shlObjectName.dispose();
+            }
+        });
+        btnAbort.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
+        btnAbort.setText("Abort");
+
+    }
+
+    public String getObjectName() {
+        return objectName;
+    }
+}
Index: trunk/autoquest-ui-swt/src/main/java/de/ugoe/cs/autoquest/ui/swt/GuiModelTabComposite.java
===================================================================
--- trunk/autoquest-ui-swt/src/main/java/de/ugoe/cs/autoquest/ui/swt/GuiModelTabComposite.java	(revision 922)
+++ trunk/autoquest-ui-swt/src/main/java/de/ugoe/cs/autoquest/ui/swt/GuiModelTabComposite.java	(revision 922)
@@ -0,0 +1,94 @@
+
+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.Composite;
+import org.eclipse.swt.widgets.List;
+
+import de.ugoe.cs.autoquest.eventcore.guimodel.GUIModel;
+import de.ugoe.cs.util.console.GlobalDataContainer;
+
+/**
+ * <p>
+ * TODO comment
+ * </p>
+ * 
+ * @version $Revision: $ $Date: Aug 28, 2012$
+ * @author 2012, last modified by $Author: sherbold$
+ */
+public class GuiModelTabComposite extends Composite {
+
+    List guiModelList;
+
+    /**
+     * Create the composite.
+     * 
+     * @param parent
+     * @param style
+     */
+    public GuiModelTabComposite(Composite parent, int style) {
+        super(parent, style);
+        createContents();
+    }
+
+    private void createContents() {
+        setLayout(new GridLayout(5, false));
+
+        guiModelList = new List(this, SWT.BORDER | SWT.V_SCROLL);
+        guiModelList.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 5, 1));
+
+        Button btnShow = new Button(this, SWT.NONE);
+        btnShow.addSelectionListener(new SelectionAdapter() {
+            @Override
+            public void widgetSelected(SelectionEvent e) {
+                // TODO
+                String[] selectedStrings = guiModelList.getSelection();
+                if (selectedStrings.length == 0) {
+                    SWTHelpers.noSelectionError(getShell());
+                    return;
+                }
+                String modelName = selectedStrings[0];
+                GUIModel model = (GUIModel) GlobalDataContainer.getInstance().getData(modelName);
+
+                ShowGuiModelDialog showGuiModelDialog =
+                    new ShowGuiModelDialog(getShell(), SWT.NONE, model, modelName);
+                showGuiModelDialog.open();
+            }
+        });
+        btnShow.setText("Show");
+
+        Button btnDelete_1 = new Button(this, SWT.NONE);
+        btnDelete_1.addSelectionListener(new SelectionAdapter() {
+            @Override
+            public void widgetSelected(SelectionEvent e) {
+                if (SWTHelpers.deleteSelectedFromStorage(guiModelList)) {
+                    updateModelList();
+                }
+                else {
+                    SWTHelpers.noSelectionError(getShell());
+                }
+            }
+        });
+        btnDelete_1.setText("Delete");
+    }
+
+    @Override
+    protected void checkSubclass() {
+        // Disable the check that prevents subclassing of SWT components
+    }
+
+    public void updateModelList() {
+        guiModelList.removeAll();
+        for(String key : GlobalDataContainer.getInstance().getAllKeys()) {
+            if( GlobalDataContainer.getInstance().getData(key) instanceof GUIModel ) {
+                guiModelList.add(key);
+            }
+        }
+    }
+
+}
Index: trunk/autoquest-ui-swt/src/main/java/de/ugoe/cs/autoquest/ui/swt/InsertAssertionDialog.java
===================================================================
--- trunk/autoquest-ui-swt/src/main/java/de/ugoe/cs/autoquest/ui/swt/InsertAssertionDialog.java	(revision 922)
+++ trunk/autoquest-ui-swt/src/main/java/de/ugoe/cs/autoquest/ui/swt/InsertAssertionDialog.java	(revision 922)
@@ -0,0 +1,109 @@
+package de.ugoe.cs.autoquest.ui.swt;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.swt.widgets.Dialog;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.TabFolder;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.TabItem;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Button;
+
+import de.ugoe.cs.autoquest.eventcore.Event;
+import de.ugoe.cs.autoquest.eventcore.guimodel.GUIModel;
+
+public class InsertAssertionDialog extends Dialog {
+
+    protected Event result;
+    protected Shell shell;
+
+    private TabFolder tabFolder;
+
+    List<AbstractInsertEventComposite> insertEventComposites;
+    GUIModel guiModel;
+
+    /**
+     * Create the dialog.
+     * 
+     * @param parent
+     * @param style
+     */
+    public InsertAssertionDialog(Shell parent, int style, GUIModel guiModel) {
+        super(parent, style);
+        setText("SWT Dialog");
+        this.guiModel = guiModel;
+    }
+
+    /**
+     * Open the dialog.
+     * 
+     * @return the result
+     */
+    public Event open() {
+        result = null;
+        insertEventComposites = new ArrayList<AbstractInsertEventComposite>();
+        createContents();
+        shell.open();
+        shell.layout();
+        Display display = getParent().getDisplay();
+        while (!shell.isDisposed()) {
+            if (!display.readAndDispatch()) {
+                display.sleep();
+            }
+        }
+        return result;
+    }
+
+    /**
+     * Create contents of the dialog.
+     */
+    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(2, false));
+
+        tabFolder = new TabFolder(shell, SWT.NONE);
+        tabFolder.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1));
+
+        TabItem tbtmTextEquals = new TabItem(tabFolder, SWT.NONE);
+        tbtmTextEquals.setText("TextEquals");
+        AbstractInsertEventComposite compTextEquals =
+            new InsertTextEquals(tabFolder, SWT.NO_BACKGROUND, guiModel);
+        tbtmTextEquals.setControl(compTextEquals);
+        insertEventComposites.add(compTextEquals);
+
+        TabItem tbtmFileEquals = new TabItem(tabFolder, SWT.NONE);
+        tbtmFileEquals.setText("FileEquals");
+        AbstractInsertEventComposite compFileEquals =
+            new InsertFileEquals(tabFolder, SWT.NO_BACKGROUND, guiModel);
+        tbtmFileEquals.setControl(compFileEquals);
+        insertEventComposites.add(compFileEquals);
+
+        Button btnInsert = new Button(shell, SWT.NONE);
+        btnInsert.setText("Insert");
+        btnInsert.addSelectionListener(new SelectionAdapter() {
+            @Override
+            public void widgetSelected(SelectionEvent e) {
+                int index = tabFolder.getSelectionIndex();
+                result = insertEventComposites.get(index).getEvent();
+                shell.dispose();
+            }
+        });
+
+        Button btnAbort = new Button(shell, SWT.NONE);
+        btnAbort.setText("Abort");
+        btnAbort.addSelectionListener(new SelectionAdapter() {
+            @Override
+            public void widgetSelected(SelectionEvent e) {
+                shell.dispose();
+            }
+        });
+    }
+}
Index: trunk/autoquest-ui-swt/src/main/java/de/ugoe/cs/autoquest/ui/swt/InsertFileEquals.java
===================================================================
--- trunk/autoquest-ui-swt/src/main/java/de/ugoe/cs/autoquest/ui/swt/InsertFileEquals.java	(revision 922)
+++ trunk/autoquest-ui-swt/src/main/java/de/ugoe/cs/autoquest/ui/swt/InsertFileEquals.java	(revision 922)
@@ -0,0 +1,83 @@
+package de.ugoe.cs.autoquest.ui.swt;
+
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.FileDialog;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Button;
+
+import de.ugoe.cs.autoquest.assertions.FileEqualsAssertEventType;
+import de.ugoe.cs.autoquest.assertions.FileEqualsReplay;
+import de.ugoe.cs.autoquest.eventcore.Event;
+import de.ugoe.cs.autoquest.eventcore.guimodel.GUIModel;
+
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+
+public class InsertFileEquals extends AbstractInsertEventComposite {
+    private Text actualText;
+    private Text expectedText;
+
+    public InsertFileEquals(Composite parent, int style) {
+        this(parent, style, null);
+    }
+
+    /**
+     * Create the composite.
+     * 
+     * @param parent
+     * @param style
+     */
+    public InsertFileEquals(Composite parent, int style, GUIModel guiModel) {
+        super(parent, style, guiModel);
+        setLayout(new GridLayout(3, false));
+
+        Label lblExpectedFile = new Label(this, SWT.NONE);
+        lblExpectedFile.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
+        lblExpectedFile.setText("Expected file:");
+
+        expectedText = new Text(this, SWT.BORDER);
+        expectedText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
+
+        Button btnSearch = new Button(this, SWT.NONE);
+        btnSearch.addSelectionListener(new SelectionAdapter() {
+            @Override
+            public void widgetSelected(SelectionEvent e) {
+                FileDialog fileDialog = new FileDialog(getShell(), SWT.OPEN);
+                String filename = fileDialog.open();
+                if (filename != null) {
+                    expectedText.setText(filename);
+                }
+            }
+        });
+        btnSearch.setText("Search...");
+
+        Label lblActualFile = new Label(this, SWT.NONE);
+
+        lblActualFile.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
+        lblActualFile.setText("Actual file:");
+
+        actualText = new Text(this, SWT.BORDER);
+        actualText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
+        new Label(this, SWT.NONE);
+
+    }
+
+    @Override
+    protected void checkSubclass() {
+        // Disable the check that prevents subclassing of SWT components
+    }
+
+    @Override
+    public Event getEvent() {
+        FileEqualsReplay replay =
+            new FileEqualsReplay(expectedText.getText(), actualText.getText());
+        Event event = new Event(new FileEqualsAssertEventType());
+        event.addReplayable(replay);
+        return event;
+    }
+
+}
Index: trunk/autoquest-ui-swt/src/main/java/de/ugoe/cs/autoquest/ui/swt/InsertTextEquals.java
===================================================================
--- trunk/autoquest-ui-swt/src/main/java/de/ugoe/cs/autoquest/ui/swt/InsertTextEquals.java	(revision 922)
+++ trunk/autoquest-ui-swt/src/main/java/de/ugoe/cs/autoquest/ui/swt/InsertTextEquals.java	(revision 922)
@@ -0,0 +1,129 @@
+
+package de.ugoe.cs.autoquest.ui.swt;
+
+import java.util.List;
+
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.TreeItem;
+
+import de.ugoe.cs.autoquest.assertions.TextEqualsAssertEventType;
+import de.ugoe.cs.autoquest.assertions.TextEqualsReplay;
+import de.ugoe.cs.autoquest.eventcore.Event;
+import de.ugoe.cs.autoquest.eventcore.IEventTarget;
+import de.ugoe.cs.autoquest.eventcore.guimodel.GUIModel;
+import de.ugoe.cs.autoquest.eventcore.guimodel.IGUIElement;
+
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+
+public class InsertTextEquals extends AbstractInsertEventComposite {
+    private Text expectedText;
+    private Tree guiTree;
+
+    /**
+     * Create the composite.
+     * 
+     * @param parent
+     * @param style
+     */
+    public InsertTextEquals(Composite parent, int style, GUIModel guiModel) {
+        super(parent, style, guiModel);
+        setLayout(new GridLayout(3, false));
+
+        Label lblExpectedValue = new Label(this, SWT.NONE);
+        lblExpectedValue.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
+        lblExpectedValue.setText("Expected Value:");
+
+        expectedText = new Text(this, SWT.BORDER);
+        expectedText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
+
+        guiTree = new Tree(this, SWT.BORDER);
+        guiTree.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1));
+        buildGuiTree();
+        new Label(this, SWT.NONE);
+
+        Button btnExpandAll = new Button(this, SWT.NONE);
+        btnExpandAll.addSelectionListener(new SelectionAdapter() {
+            @Override
+            public void widgetSelected(SelectionEvent e) {
+                expandAll(guiTree, true);
+            }
+        });
+        btnExpandAll.setText("Expand all");
+
+        Button btnCollapseAll = new Button(this, SWT.NONE);
+        btnCollapseAll.addSelectionListener(new SelectionAdapter() {
+            @Override
+            public void widgetSelected(SelectionEvent e) {
+                expandAll(guiTree, false);
+            }
+        });
+        btnCollapseAll.setText("Collapse all");
+
+    }
+
+    @Override
+    protected void checkSubclass() {
+        // Disable the check that prevents subclassing of SWT components
+    }
+
+    @Override
+    public Event getEvent() {
+        // TODO possibly display error if no target is selected
+        TreeItem[] selection = guiTree.getSelection();
+        IEventTarget target = null;
+        TextEqualsReplay replay = null;
+        if (selection.length == 1) {
+            target = (IEventTarget) selection[0].getData();
+            replay = new TextEqualsReplay(expectedText.getText(), target.toString());
+        }
+
+        Event event = new Event(new TextEqualsAssertEventType(), target);
+
+        event.setTarget(target);
+        if (replay != null) {
+            event.addReplayable(replay);
+        }
+
+        return event;
+    }
+
+    private void buildGuiTree() {
+        for (IGUIElement element : guiModel.getRootElements()) {
+            TreeItem child = new TreeItem(guiTree, SWT.NULL);
+            child.setText(element.toString());
+            child.setData(element);
+            buildGuiTree(child, guiModel.getChildren(element));
+        }
+    }
+
+    private void buildGuiTree(TreeItem currentParent, List<IGUIElement> elements) {
+        for (IGUIElement element : elements) {
+            TreeItem child = new TreeItem(currentParent, SWT.NULL);
+            child.setText(element.toString());
+            child.setData(element);
+            buildGuiTree(child, guiModel.getChildren(element));
+        }
+    }
+
+    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);
+        }
+    }
+
+}
Index: trunk/autoquest-ui-swt/src/main/java/de/ugoe/cs/autoquest/ui/swt/MainWindow.java
===================================================================
--- trunk/autoquest-ui-swt/src/main/java/de/ugoe/cs/autoquest/ui/swt/MainWindow.java	(revision 922)
+++ trunk/autoquest-ui-swt/src/main/java/de/ugoe/cs/autoquest/ui/swt/MainWindow.java	(revision 922)
@@ -0,0 +1,246 @@
+package de.ugoe.cs.autoquest.ui.swt;
+
+import java.util.List;
+import java.util.logging.Level;
+
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.FileDialog;
+import org.eclipse.swt.widgets.MenuItem;
+import org.eclipse.swt.widgets.TabFolder;
+import org.eclipse.swt.widgets.TabItem;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+
+import de.ugoe.cs.util.console.CommandExecuter;
+
+/**
+ * <p>
+ * Main window of the SWT GUI.
+ * </p>
+ * 
+ * @author Steffen Herbold
+ * @version 1.0
+ */
+public class MainWindow {
+
+    private List<String> startupCommands;
+    
+    private final Level traceLevel;
+
+    protected Shell shlEventbenchConsole;
+
+    protected TabItem consoleTab;
+    protected TabItem sequencesTab;
+    protected TabItem modelsTab;
+    protected TabItem guiModelsTab;
+    protected TabItem dataTab;
+    protected ConsoleTabComposite consoleTabComposite;
+    protected SequencesTabComposite sequencesTabComposite;
+    protected ModelsTabComposite modelsTabComposite;
+    protected GuiModelTabComposite guiModelTabComposite;
+    protected DataTabComposite dataTabComposite;
+
+    protected CommandHistoryDialog historyDialog;
+
+    public MainWindow(List<String> startupCommands, Level traceLevel) {
+        this.startupCommands = startupCommands;
+        this.traceLevel = traceLevel;
+    }
+
+    /**
+     * <p>
+     * Open the window.
+     * </p>
+     * 
+     * @wbp.parser.entryPoint
+     */
+    public void open() {
+        Display display = Display.getDefault();
+        createContents();
+        new SWTConsole(consoleTabComposite.textConsoleOutput, traceLevel);
+        historyDialog = new CommandHistoryDialog(shlEventbenchConsole, SWT.NONE);
+        shlEventbenchConsole.open();
+        shlEventbenchConsole.layout();
+        for (String command : startupCommands) {
+            CommandExecuter.getInstance().exec(command);
+        }
+        while (!shlEventbenchConsole.isDisposed()) {
+            if (!display.readAndDispatch()) {
+                display.sleep();
+            }
+        }
+    }
+
+    /**
+     * <p>
+     * Create contents of the window.
+     * </p>
+     */
+    protected void createContents() {
+        shlEventbenchConsole = new Shell();
+        shlEventbenchConsole.setSize(800, 600);
+        shlEventbenchConsole.setText("EventBench Console");
+        shlEventbenchConsole.setLayout(new GridLayout(1, false));
+
+        createMenu();
+        createTabs();
+    }
+
+    /**
+     * </p> Creates the menu of the window. </p>
+     */
+    private void createMenu() {
+        Menu menu = new Menu(shlEventbenchConsole, SWT.BAR);
+        shlEventbenchConsole.setMenuBar(menu);
+
+        MenuItem mntmFile = new MenuItem(menu, SWT.CASCADE);
+        mntmFile.setText("File");
+
+        Menu menu_1 = new Menu(mntmFile);
+        mntmFile.setMenu(menu_1);
+
+        MenuItem mntmShowHistory = new MenuItem(menu_1, SWT.NONE);
+        mntmShowHistory.addSelectionListener(new SelectionAdapter() {
+            @Override
+            public void widgetSelected(SelectionEvent e) {
+                if (!historyDialog.isOpen()) {
+                    historyDialog.open();
+                }
+            }
+        });
+        mntmShowHistory.setText("Show History");
+
+        MenuItem mntmExecBatchFile = new MenuItem(menu_1, SWT.NONE);
+        mntmExecBatchFile.addSelectionListener(new SelectionAdapter() {
+            @Override
+            public void widgetSelected(SelectionEvent e) {
+                FileDialog fileDialog = new FileDialog(shlEventbenchConsole, SWT.OPEN);
+                String filename = fileDialog.open();
+                if (filename != null) {
+                    String command = "exec '" + filename + "'";
+                    CommandExecuter.getInstance().exec(command);
+                }
+            }
+        });
+        mntmExecBatchFile.setText("Exec. Batch File");
+
+        new MenuItem(menu_1, SWT.SEPARATOR);
+
+        MenuItem mntmLoad = new MenuItem(menu_1, SWT.NONE);
+        mntmLoad.addSelectionListener(new SelectionAdapter() {
+            @Override
+            public void widgetSelected(SelectionEvent e) {
+                FileDialog fileDialog = new FileDialog(shlEventbenchConsole, SWT.OPEN);
+                String filename = fileDialog.open();
+                if (filename != null) {
+                    String command = "load '" + filename + "'";
+                    CommandExecuter.getInstance().exec(command);
+                }
+            }
+        });
+        mntmLoad.setText("Load...");
+
+        MenuItem mntmSave = new MenuItem(menu_1, SWT.NONE);
+        mntmSave.addSelectionListener(new SelectionAdapter() {
+            @Override
+            public void widgetSelected(SelectionEvent e) {
+                FileDialog fileDialog = new FileDialog(shlEventbenchConsole, SWT.SAVE);
+                String filename = fileDialog.open();
+                if (filename != null) {
+                    String command = "save '" + filename + "'";
+                    CommandExecuter.getInstance().exec(command);
+                }
+            }
+        });
+        mntmSave.setText("Save...");
+
+        new MenuItem(menu_1, SWT.SEPARATOR);
+
+        MenuItem mntmExit = new MenuItem(menu_1, SWT.NONE);
+        mntmExit.addSelectionListener(new SelectionAdapter() {
+            @Override
+            public void widgetSelected(SelectionEvent e) {
+                shlEventbenchConsole.dispose();
+            }
+        });
+        mntmExit.setText("Exit");
+
+        MenuItem mntmHelp = new MenuItem(menu, SWT.CASCADE);
+        mntmHelp.setText("Help");
+
+        Menu menu_2 = new Menu(mntmHelp);
+        mntmHelp.setMenu(menu_2);
+
+        MenuItem mntmAbout = new MenuItem(menu_2, SWT.NONE);
+        mntmAbout.addSelectionListener(new SelectionAdapter() {
+            @Override
+            public void widgetSelected(SelectionEvent e) {
+                AboutDialog aboutDialog = new AboutDialog(shlEventbenchConsole, SWT.NONE);
+                aboutDialog.open();
+            }
+        });
+        mntmAbout.setText("About");
+    }
+
+    /**
+     * <p>
+     * Creates the central TabFolder of the window.
+     * </p>
+     */
+    private void createTabs() {
+        TabFolder tabFolder = new TabFolder(shlEventbenchConsole, SWT.NONE);
+        tabFolder.addSelectionListener(new SelectionAdapter() {
+            @Override
+            public void widgetSelected(SelectionEvent e) {
+                if (e.item == sequencesTab) {
+                    sequencesTabComposite.updateSequenceList();
+                }
+                else if (e.item == modelsTab) {
+                    modelsTabComposite.updateModelList();
+                }
+                else if (e.item == guiModelsTab) {
+                    guiModelTabComposite.updateModelList();
+                }
+                else if (e.item == dataTab) {
+                    dataTabComposite.updateDataList();
+                }
+            }
+        });
+        tabFolder.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
+
+        consoleTab = new TabItem(tabFolder, SWT.NONE);
+        consoleTab.setText("Console");
+
+        consoleTabComposite = new ConsoleTabComposite(tabFolder, SWT.NO_BACKGROUND);
+        consoleTab.setControl(consoleTabComposite);
+
+        sequencesTab = new TabItem(tabFolder, SWT.NONE);
+        sequencesTab.setText("Sequences");
+
+        sequencesTabComposite = new SequencesTabComposite(tabFolder, SWT.NO_BACKGROUND);
+        sequencesTab.setControl(sequencesTabComposite);
+
+        modelsTab = new TabItem(tabFolder, SWT.NONE);
+        modelsTab.setText("Models");
+
+        modelsTabComposite = new ModelsTabComposite(tabFolder, SWT.NO_BACKGROUND);
+        modelsTab.setControl(modelsTabComposite);
+        
+        guiModelsTab = new TabItem(tabFolder, SWT.NONE);
+        guiModelsTab.setText("GUI Models");
+
+        guiModelTabComposite = new GuiModelTabComposite(tabFolder, SWT.NO_BACKGROUND);
+        guiModelsTab.setControl(guiModelTabComposite);
+
+        dataTab = new TabItem(tabFolder, SWT.NONE);
+        dataTab.setText("Data");
+
+        dataTabComposite = new DataTabComposite(tabFolder, SWT.NO_BACKGROUND);
+        dataTab.setControl(dataTabComposite);
+    }
+}
Index: trunk/autoquest-ui-swt/src/main/java/de/ugoe/cs/autoquest/ui/swt/ModelPropertiesDialog.java
===================================================================
--- trunk/autoquest-ui-swt/src/main/java/de/ugoe/cs/autoquest/ui/swt/ModelPropertiesDialog.java	(revision 922)
+++ trunk/autoquest-ui-swt/src/main/java/de/ugoe/cs/autoquest/ui/swt/ModelPropertiesDialog.java	(revision 922)
@@ -0,0 +1,142 @@
+package de.ugoe.cs.autoquest.ui.swt;
+
+import org.eclipse.swt.widgets.Dialog;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.MessageBox;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.List;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.FillLayout;
+
+import de.ugoe.cs.autoquest.usageprofiles.FirstOrderMarkovModel;
+import de.ugoe.cs.autoquest.usageprofiles.IStochasticProcess;
+
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+
+public class ModelPropertiesDialog extends Dialog {
+
+    private IStochasticProcess process;
+
+    protected Shell shlModelProperties;
+
+    /**
+     * Create the dialog.
+     * 
+     * @param parent
+     * @param style
+     */
+    public ModelPropertiesDialog(Shell parent, int style) {
+        super(parent, style);
+        setText("SWT Dialog");
+    }
+
+    /**
+     * Open the dialog.
+     */
+    public void open() {
+        createContents();
+        shlModelProperties.open();
+        shlModelProperties.layout();
+        Display display = getParent().getDisplay();
+        while (!shlModelProperties.isDisposed()) {
+            if (!display.readAndDispatch()) {
+                display.sleep();
+            }
+        }
+    }
+
+    /**
+     * Create contents of the dialog.
+     */
+    private void createContents() {
+        shlModelProperties = new Shell(getParent(), SWT.DIALOG_TRIM | SWT.RESIZE);
+        shlModelProperties.setSize(230, 318);
+        shlModelProperties.setText("Model Properties");
+        shlModelProperties.setLayout(new GridLayout(2, false));
+
+        Group grpEvents = new Group(shlModelProperties, SWT.NONE);
+        FillLayout fl_grpEvents = new FillLayout(SWT.HORIZONTAL);
+        fl_grpEvents.marginHeight = 5;
+        fl_grpEvents.marginWidth = 5;
+        grpEvents.setLayout(fl_grpEvents);
+        grpEvents.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1));
+        grpEvents.setText("Events");
+
+        List list = new List(grpEvents, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
+        for (String symbol : process.getSymbolStrings()) {
+            if (symbol == null) {
+                list.add("null");
+            }
+            else {
+                list.add(symbol);
+            }
+        }
+
+        Group grpStatistics = new Group(shlModelProperties, SWT.NONE);
+        grpStatistics.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 2, 1));
+        grpStatistics.setText("Statistics");
+        grpStatistics.setLayout(new GridLayout(2, false));
+
+        Label lblNumEvents = new Label(grpStatistics, SWT.NONE);
+        lblNumEvents.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false, 1, 1));
+        lblNumEvents.setText("Num. Events");
+
+        Label label = new Label(grpStatistics, SWT.RIGHT);
+        label.setLayoutData(new GridData(SWT.RIGHT, SWT.TOP, false, false, 1, 1));
+        label.setText("" + process.getNumSymbols());
+
+        Label lblNumTrieLeafs = new Label(grpStatistics, SWT.NONE);
+        lblNumTrieLeafs.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false, 1, 1));
+        lblNumTrieLeafs.setText("Size (Flattend FOM)");
+
+        Label label_1 = new Label(grpStatistics, SWT.RIGHT);
+        label_1.setLayoutData(new GridData(SWT.RIGHT, SWT.TOP, false, false, 1, 1));
+        label_1.setText("" + process.getNumFOMStates());
+
+        Label lblEntropy = new Label(grpStatistics, SWT.NONE);
+        lblEntropy.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false, 1, 1));
+        lblEntropy.setText("Entropy");
+
+        final Label label_2 = new Label(grpStatistics, SWT.RIGHT);
+        label_2.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false, 1, 1));
+        label_2.setText("####");
+
+        Button btnCalculateEntropy = new Button(shlModelProperties, SWT.NONE);
+        btnCalculateEntropy.addSelectionListener(new SelectionAdapter() {
+            @Override
+            public void widgetSelected(SelectionEvent e) {
+                if (process instanceof FirstOrderMarkovModel) {
+                    label_2.setText("" + ((FirstOrderMarkovModel) process).calcEntropy());
+                }
+                else {
+                    MessageBox messageBox = new MessageBox(shlModelProperties, SWT.NONE);
+                    messageBox.setText("Feature Not Available");
+                    messageBox
+                        .setMessage("The feature is currently only available for first-order Markov models.");
+                    messageBox.open();
+                }
+            }
+        });
+        btnCalculateEntropy.setText("Calculate Entropy");
+
+        Button btnClose = new Button(shlModelProperties, SWT.NONE);
+        btnClose.addSelectionListener(new SelectionAdapter() {
+            @Override
+            public void widgetSelected(SelectionEvent e) {
+                shlModelProperties.dispose();
+            }
+        });
+        btnClose.setText("Close");
+
+    }
+
+    public void setStochasticProcess(IStochasticProcess process) {
+        this.process = process;
+    }
+}
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 922)
+++ trunk/autoquest-ui-swt/src/main/java/de/ugoe/cs/autoquest/ui/swt/ModelsTabComposite.java	(revision 922)
@@ -0,0 +1,159 @@
+package de.ugoe.cs.autoquest.ui.swt;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.List;
+import org.eclipse.swt.widgets.MessageBox;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.layout.GridData;
+
+import de.ugoe.cs.autoquest.usageprofiles.FirstOrderMarkovModel;
+import de.ugoe.cs.autoquest.usageprofiles.IDotCompatible;
+import de.ugoe.cs.autoquest.usageprofiles.IStochasticProcess;
+import de.ugoe.cs.util.console.CommandExecuter;
+import de.ugoe.cs.util.console.GlobalDataContainer;
+
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+
+public class ModelsTabComposite extends Composite {
+
+    List modelList;
+
+    /**
+     * Create the composite.
+     * 
+     * @param parent
+     * @param style
+     */
+    public ModelsTabComposite(Composite parent, int style) {
+        super(parent, style);
+        createContents();
+    }
+
+    private void createContents() {
+        setLayout(new GridLayout(5, false));
+
+        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);
+        btnShow.addSelectionListener(new SelectionAdapter() {
+            @Override
+            public void widgetSelected(SelectionEvent e) {
+                String[] selectedStrings = modelList.getSelection();
+                if (selectedStrings.length == 0) {
+                    SWTHelpers.noSelectionError(getShell());
+                    return;
+                }
+                IStochasticProcess process =
+                    (IStochasticProcess) GlobalDataContainer.getInstance()
+                        .getData(selectedStrings[0]);
+                if (process instanceof FirstOrderMarkovModel) {
+                    String command = "showMarkovModel " + 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 first-order Markov models.");
+                    messageBox.open();
+                }
+            }
+        });
+        btnShow.setText("Visualize");
+
+        Button btnDelete_1 = new Button(this, SWT.NONE);
+        btnDelete_1.addSelectionListener(new SelectionAdapter() {
+            @Override
+            public void widgetSelected(SelectionEvent e) {
+                if (SWTHelpers.deleteSelectedFromStorage(modelList)) {
+                    updateModelList();
+                }
+                else {
+                    SWTHelpers.noSelectionError(getShell());
+                }
+            }
+        });
+        btnDelete_1.setText("Delete");
+
+        Button btnGenSequences = new Button(this, SWT.NONE);
+        btnGenSequences.addSelectionListener(new SelectionAdapter() {
+            @Override
+            public void widgetSelected(SelectionEvent e) {
+                String[] selectedStrings = modelList.getSelection();
+                if (selectedStrings.length == 0) {
+                    SWTHelpers.noSelectionError(getShell());
+                    return;
+                }
+                GenerateSequencesDialog generateSequencesDialog =
+                    new GenerateSequencesDialog(getShell(), SWT.NONE);
+                generateSequencesDialog.setProcessName(selectedStrings[0]);
+                generateSequencesDialog.open();
+            }
+        });
+        btnGenSequences.setText("Gen. Sequences");
+
+        Button btnProperties = new Button(this, SWT.NONE);
+        btnProperties.addSelectionListener(new SelectionAdapter() {
+            @Override
+            public void widgetSelected(SelectionEvent e) {
+                String[] selectedStrings = modelList.getSelection();
+                if (selectedStrings.length == 0) {
+                    SWTHelpers.noSelectionError(getShell());
+                    return;
+                }
+                IStochasticProcess process =
+                    (IStochasticProcess) GlobalDataContainer.getInstance()
+                        .getData(selectedStrings[0]);
+                ModelPropertiesDialog modelPropertiesDialog =
+                    new ModelPropertiesDialog(getShell(), SWT.NONE);
+                modelPropertiesDialog.setStochasticProcess(process);
+                modelPropertiesDialog.open();
+            }
+        });
+        btnProperties.setText("Properties");
+
+        Button btnCreateDot = new Button(this, SWT.NONE);
+        btnCreateDot.addSelectionListener(new SelectionAdapter() {
+            @Override
+            public void widgetSelected(SelectionEvent e) {
+                String[] selectedStrings = modelList.getSelection();
+                if (selectedStrings.length == 0) {
+                    SWTHelpers.noSelectionError(getShell());
+                    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);
+            }
+        });
+        btnCreateDot.setText("Create DOT");
+    }
+
+    @Override
+    protected void checkSubclass() {
+        // Disable the check that prevents subclassing of SWT components
+    }
+
+    public void updateModelList() {
+        modelList.removeAll();
+        for(String key : GlobalDataContainer.getInstance().getAllKeys()) {
+            if( GlobalDataContainer.getInstance().getData(key) instanceof IStochasticProcess ) {
+                modelList.add(key);
+            }
+        }
+    }
+
+}
Index: trunk/autoquest-ui-swt/src/main/java/de/ugoe/cs/autoquest/ui/swt/SWTConsole.java
===================================================================
--- trunk/autoquest-ui-swt/src/main/java/de/ugoe/cs/autoquest/ui/swt/SWTConsole.java	(revision 922)
+++ trunk/autoquest-ui-swt/src/main/java/de/ugoe/cs/autoquest/ui/swt/SWTConsole.java	(revision 922)
@@ -0,0 +1,97 @@
+package de.ugoe.cs.autoquest.ui.swt;
+
+import java.io.ByteArrayOutputStream;
+import java.io.PrintStream;
+import java.io.UnsupportedEncodingException;
+import java.util.logging.Level;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.StyleRange;
+import org.eclipse.swt.custom.StyledText;
+import org.eclipse.swt.widgets.MessageBox;
+
+import de.ugoe.cs.util.StringTools;
+import de.ugoe.cs.util.console.Console;
+import de.ugoe.cs.util.console.listener.ICommandListener;
+import de.ugoe.cs.util.console.listener.IErrorListener;
+import de.ugoe.cs.util.console.listener.IExceptionListener;
+import de.ugoe.cs.util.console.listener.IOutputListener;
+import de.ugoe.cs.util.console.listener.ITraceListener;
+
+public class SWTConsole implements IOutputListener, IErrorListener, ITraceListener,
+    ICommandListener, IExceptionListener
+{
+
+    private StyledText output;
+    
+    private Level traceLevel;
+
+    public SWTConsole(StyledText styledText, Level traceLevel) {
+        Console.getInstance().registerOutputListener(this);
+        Console.getInstance().registerErrorListener(this);
+        Console.getInstance().registerTraceListener(this);
+        Console.getInstance().registerCommandListener(this);
+        Console.getInstance().registerExceptionListener(this);
+        this.output = styledText;
+        this.traceLevel = traceLevel;
+    }
+
+    @Override
+    public void outputMsg(String newMessage) {
+        output.append(newMessage);
+    }
+
+    @Override
+    public void errorMsg(String errMessage) {
+        appendColored("[ERROR] " + errMessage, SWT.COLOR_RED);
+    }
+
+    @Override
+    public void traceMsg(String traceMessage, Level level) {
+        if( level.intValue()>=traceLevel.intValue()) {
+            int color = SWT.COLOR_BLUE;
+            if( level==Level.SEVERE ) {
+                color = SWT.COLOR_RED;
+            }
+            appendColored("[" + level.toString() + "] " + traceMessage, color);
+        }
+    }
+
+    @Override
+    public void commandNotification(String command) {
+        output.append("> " + command + StringTools.ENDLINE);
+    }
+
+    private void appendColored(String str, int id) {
+        StyleRange styleRange = new StyleRange();
+        styleRange.start = output.getText().length();
+        styleRange.length = str.length();
+        styleRange.foreground = output.getDisplay().getSystemColor(id);
+        output.append(str);
+        output.setStyleRange(styleRange);
+    }
+
+    @Override
+    public void logException(Exception e) {
+        MessageBox messageBox = new MessageBox(output.getShell(), SWT.ERROR);
+        messageBox.setText("Error");
+        messageBox.setMessage(e.getMessage());
+        messageBox.open();
+        
+        ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        PrintStream ps = new PrintStream(baos);
+        e.printStackTrace(ps);        
+        String stackTrace = null;
+        try {
+            stackTrace = baos.toString("UTF-8");
+        }
+        catch (UnsupportedEncodingException e1) {
+        }
+        if( stackTrace!=null ) {
+            appendColored(stackTrace, SWT.COLOR_RED);
+        } else {
+            appendColored(e.getMessage(), SWT.COLOR_RED);
+        }
+        
+    }
+}
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 922)
+++ trunk/autoquest-ui-swt/src/main/java/de/ugoe/cs/autoquest/ui/swt/SWTHelpers.java	(revision 922)
@@ -0,0 +1,33 @@
+package de.ugoe.cs.autoquest.ui.swt;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.List;
+import org.eclipse.swt.widgets.MessageBox;
+import org.eclipse.swt.widgets.Shell;
+
+import de.ugoe.cs.util.console.CommandExecuter;
+
+public class SWTHelpers {
+
+    public static boolean deleteSelectedFromStorage(final List list) {
+        String[] selectedStrings = list.getSelection();
+        if (selectedStrings.length == 0) {
+            return false;
+        }
+        else {
+            for (String selected : selectedStrings) {
+                String command = "deleteObject " + selected;
+                CommandExecuter.getInstance().exec(command);
+            }
+            return true;
+        }
+    }
+
+    public static void noSelectionError(final Shell shell) {
+        MessageBox messageBox = new MessageBox(shell, SWT.ERROR);
+        messageBox.setMessage("No objects selected!");
+        messageBox.setText("Error");
+        messageBox.open();
+    }
+
+}
Index: trunk/autoquest-ui-swt/src/main/java/de/ugoe/cs/autoquest/ui/swt/SequencesDialog.java
===================================================================
--- trunk/autoquest-ui-swt/src/main/java/de/ugoe/cs/autoquest/ui/swt/SequencesDialog.java	(revision 922)
+++ trunk/autoquest-ui-swt/src/main/java/de/ugoe/cs/autoquest/ui/swt/SequencesDialog.java	(revision 922)
@@ -0,0 +1,144 @@
+package de.ugoe.cs.autoquest.ui.swt;
+
+import java.util.Collection;
+
+import org.eclipse.swt.widgets.Dialog;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.MessageBox;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.List;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.layout.GridData;
+
+import de.ugoe.cs.autoquest.SequenceInstanceOf;
+import de.ugoe.cs.autoquest.eventcore.Event;
+import de.ugoe.cs.autoquest.eventcore.guimodel.GUIModel;
+import de.ugoe.cs.util.console.GlobalDataContainer;
+
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+
+public class SequencesDialog extends Dialog {
+
+    private String sequencesName;
+
+    private List sequenceList;
+    private Collection<java.util.List<Event>> sequences;
+    private GUIModel guiModel;
+
+    protected Shell shell;
+
+    /**
+     * Create the dialog.
+     * 
+     * @param parent
+     * @param style
+     */
+    public SequencesDialog(Shell parent, int style) {
+        super(parent, style);
+        setText("SWT Dialog");
+    }
+
+    /**
+     * Open the dialog.
+     */
+    public void open(String sequencesName) {
+        this.sequencesName = sequencesName;
+        sequences = null;
+        createContents();
+        shell.open();
+        shell.layout();
+        Display display = getParent().getDisplay();
+        while (!shell.isDisposed()) {
+            if (!display.readAndDispatch()) {
+                display.sleep();
+            }
+        }
+    }
+
+    /**
+     * Create contents of the dialog.
+     */
+    private void createContents() {
+        shell = new Shell(getParent(), SWT.SHELL_TRIM | SWT.BORDER | SWT.APPLICATION_MODAL);
+        shell.setSize(248, 299);
+        shell.setText(getText());
+        shell.setLayout(new GridLayout(2, false));
+
+        sequenceList = new List(shell, SWT.BORDER | SWT.V_SCROLL);
+        sequenceList.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1));
+        updateSequenceList();
+
+        Button btnShow = new Button(shell, SWT.NONE);
+        btnShow.addSelectionListener(new SelectionAdapter() {
+            @Override
+            public void widgetSelected(SelectionEvent e) {
+                int index = sequenceList.getSelectionIndex();
+                if (index == -1) {
+                    MessageBox messageBox = new MessageBox(shell, SWT.ERROR);
+                    messageBox.setMessage("No sequence selected!");
+                    messageBox.setText("Error");
+                    messageBox.open();
+                }
+                else {
+                    EditSequenceDialog editSequenceDialog =
+                        new EditSequenceDialog(shell, SWT.NONE, guiModel);
+                    int counter = 0;
+                    java.util.List<Event> selectedSequence = null;
+                    for (java.util.List<Event> sequence : sequences) {
+                        if (counter == index) {
+                            selectedSequence = sequence;
+                            break;
+                        }
+                        counter++;
+                    }
+                    editSequenceDialog.open(selectedSequence);
+                    updateSequenceList();
+                }
+            }
+        });
+        btnShow.setText("Show");
+
+        Button btnClose = new Button(shell, SWT.NONE);
+        btnClose.addSelectionListener(new SelectionAdapter() {
+            @Override
+            public void widgetSelected(SelectionEvent e) {
+                shell.dispose();
+            }
+        });
+        btnClose.setText("Close");
+
+    }
+
+    @SuppressWarnings("unchecked")
+    private void updateSequenceList() {
+        sequenceList.removeAll();
+        Object dataObject = GlobalDataContainer.getInstance().getData(sequencesName);
+        if (SequenceInstanceOf.isCollectionOfSequences(dataObject)) {
+            sequences = (Collection<java.util.List<Event>>) dataObject;
+            int seqDigits = Integer.toString(sequences.size()).length();
+            int counter = 1;
+            for (java.util.List<Event> sequence : sequences) {
+                String seqName =
+                    "#" + String.format("%0" + seqDigits + "d", counter) + ": " + sequence.size();
+                sequenceList.add(seqName);
+                counter++;
+            }
+            Object targetObject =
+                GlobalDataContainer.getInstance().getData(sequencesName + "_targets");
+            guiModel = null;
+            if (targetObject instanceof GUIModel) {
+                guiModel = (GUIModel) targetObject;
+            }
+        }
+        else {
+            MessageBox messageBox = new MessageBox(shell, SWT.ERROR);
+            messageBox.setMessage("Internal error. Sequences object not of expected type!");
+            messageBox.setText("Error");
+            messageBox.open();
+        }
+    }
+
+}
Index: trunk/autoquest-ui-swt/src/main/java/de/ugoe/cs/autoquest/ui/swt/SequencesTabComposite.java
===================================================================
--- trunk/autoquest-ui-swt/src/main/java/de/ugoe/cs/autoquest/ui/swt/SequencesTabComposite.java	(revision 922)
+++ trunk/autoquest-ui-swt/src/main/java/de/ugoe/cs/autoquest/ui/swt/SequencesTabComposite.java	(revision 922)
@@ -0,0 +1,144 @@
+package de.ugoe.cs.autoquest.ui.swt;
+
+import org.eclipse.swt.widgets.Composite;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.FileDialog;
+import org.eclipse.swt.widgets.List;
+import org.eclipse.swt.widgets.MessageBox;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+
+import de.ugoe.cs.autoquest.SequenceInstanceOf;
+import de.ugoe.cs.util.console.CommandExecuter;
+import de.ugoe.cs.util.console.GlobalDataContainer;
+
+public class SequencesTabComposite extends Composite {
+
+    protected List sequenceList;
+
+    /**
+     * Create the composite.
+     * 
+     * @param parent
+     * @param style
+     */
+    public SequencesTabComposite(Composite parent, int style) {
+        super(parent, style);
+        createContents();
+    }
+
+    private void createContents() {
+        setLayout(new GridLayout(5, false));
+
+        sequenceList = new List(this, SWT.BORDER | SWT.V_SCROLL | SWT.MULTI);
+        sequenceList.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 5, 1));
+        sequenceList.setItems(new String[] { });
+
+        Button btnEdit = new Button(this, SWT.NONE);
+        btnEdit.addSelectionListener(new SelectionAdapter() {
+            @Override
+            public void widgetSelected(SelectionEvent e) {
+                String[] selectedSequences = sequenceList.getSelection();
+                if (selectedSequences.length == 0) {
+                    SWTHelpers.noSelectionError(getShell());
+                }
+                else if (selectedSequences.length > 1) {
+                    MessageBox messageBox = new MessageBox(getShell(), SWT.ERROR);
+                    messageBox.setMessage("Only one sequence can be edited at a time!");
+                    messageBox.setText("Error");
+                    messageBox.open();
+                }
+                else {
+                    SequencesDialog sequencesDialog = new SequencesDialog(getShell(), SWT.NONE);
+                    sequencesDialog.open(selectedSequences[0]);
+                }
+            }
+        });
+        btnEdit.setText("Edit");
+
+        Button btnDelete = new Button(this, SWT.NONE);
+        btnDelete.addSelectionListener(new SelectionAdapter() {
+            @Override
+            public void widgetSelected(SelectionEvent e) {
+                if (SWTHelpers.deleteSelectedFromStorage(sequenceList)) {
+                    updateSequenceList();
+                }
+                else {
+                    SWTHelpers.noSelectionError(getShell());
+                }
+            }
+        });
+        btnDelete.setText("Delete");
+
+        Button btnReplay = new Button(this, SWT.NONE);
+        btnReplay.addSelectionListener(new SelectionAdapter() {
+            @Override
+            public void widgetSelected(SelectionEvent e) {
+                String[] selectedSequences = sequenceList.getSelection();
+                if (selectedSequences.length == 0) {
+                    SWTHelpers.noSelectionError(getShell());
+                }
+                else {
+                    StringBuilder commandString = new StringBuilder("generateReplayfile ");
+                    FileDialog fileDialog = new FileDialog(getShell());
+                    String filename = fileDialog.open();
+                    commandString.append(filename + " ");
+                    for (String selected : selectedSequences) {
+                        commandString.append(selected + " ");
+                    }
+                    CommandExecuter.getInstance().exec(commandString.toString().trim());
+                }
+            }
+        });
+        btnReplay.setText("Replay");
+
+        Button btnTrainModel = new Button(this, SWT.NONE);
+        btnTrainModel.addSelectionListener(new SelectionAdapter() {
+            @Override
+            public void widgetSelected(SelectionEvent e) {
+                String[] selectedSequences = sequenceList.getSelection();
+                if (selectedSequences.length == 0) {
+                    SWTHelpers.noSelectionError(getShell());
+                }
+                else {
+                    TrainModelDialog trainDialog = new TrainModelDialog(getShell(), SWT.NONE);
+                    trainDialog.setSequenceNames(selectedSequences);
+                    trainDialog.open();
+                }
+            }
+        });
+        btnTrainModel.setText("Train Model");
+
+        Button btnParse = new Button(this, SWT.NONE);
+        btnParse.addSelectionListener(new SelectionAdapter() {
+            @Override
+            public void widgetSelected(SelectionEvent e) {
+                // TODO implement parsing of sequences
+                MessageBox messageBox = new MessageBox(getShell(), SWT.ICON_INFORMATION);
+                messageBox.setText("Not implemented!");
+                messageBox.setMessage("Sorry! This functionality has not been implemented yet!");
+                messageBox.open();
+            }
+        });
+        btnParse.setText("Parse");
+    }
+
+    public void updateSequenceList() {
+        sequenceList.removeAll();
+        for(String key : GlobalDataContainer.getInstance().getAllKeys()) {
+            if( SequenceInstanceOf.isCollectionOfSequences(GlobalDataContainer.getInstance().getData(key)) ) {
+                sequenceList.add(key);
+            }
+        }
+    }
+
+    @Override
+    protected void checkSubclass() {
+        // Disable the check that prevents subclassing of SWT components
+    }
+
+}
Index: trunk/autoquest-ui-swt/src/main/java/de/ugoe/cs/autoquest/ui/swt/ShowGuiModelDialog.java
===================================================================
--- trunk/autoquest-ui-swt/src/main/java/de/ugoe/cs/autoquest/ui/swt/ShowGuiModelDialog.java	(revision 922)
+++ trunk/autoquest-ui-swt/src/main/java/de/ugoe/cs/autoquest/ui/swt/ShowGuiModelDialog.java	(revision 922)
@@ -0,0 +1,175 @@
+
+package de.ugoe.cs.autoquest.ui.swt;
+
+import java.util.List;
+
+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.MessageBox;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.swt.widgets.TreeItem;
+
+import de.ugoe.cs.autoquest.eventcore.guimodel.GUIModel;
+import de.ugoe.cs.autoquest.eventcore.guimodel.IGUIElement;
+import de.ugoe.cs.util.console.Console;
+
+import org.eclipse.swt.widgets.Label;
+
+public class ShowGuiModelDialog extends Dialog {
+
+    protected Shell shell;
+    private Tree guiTree;
+
+    protected GUIModel model;
+
+    public ShowGuiModelDialog(Shell parent, int style, GUIModel model, String modelName) {
+        super(parent, style);
+        setText("GUI Model " + modelName);
+        this.model = model;
+    }
+
+    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));
+
+        guiTree = new Tree(shell, SWT.BORDER | SWT.MULTI);
+        guiTree.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 4, 1));
+
+        buildGuiTree();
+
+        Button btnExpandAll = new Button(shell, SWT.NONE);
+        btnExpandAll.addSelectionListener(new SelectionAdapter() {
+            @Override
+            public void widgetSelected(SelectionEvent e) {
+                expandAll(guiTree, true);
+            }
+        });
+        btnExpandAll.setText("Expand all");
+
+        Button btnCollapseAll = new Button(shell, SWT.NONE);
+        btnCollapseAll.addSelectionListener(new SelectionAdapter() {
+            @Override
+            public void widgetSelected(SelectionEvent e) {
+                expandAll(guiTree, false);
+            }
+        });
+        btnCollapseAll.setText("Collapse all");
+        
+        Button btnCondense = new Button(shell, SWT.NONE);
+        btnCondense.addSelectionListener(new SelectionAdapter() {
+            @Override
+            public void widgetSelected(SelectionEvent e) {
+                model.condenseModel();
+                guiTree.removeAll();
+                buildGuiTree();
+            }
+        });
+        btnCondense.setText("Condense");
+        
+        Button btnMerge = new Button(shell, SWT.NONE);
+        btnMerge.addSelectionListener(new SelectionAdapter() {
+            @Override
+            public void widgetSelected(SelectionEvent e) {
+                mergeSelectedNode(guiTree);
+            }
+        });
+        btnMerge.setText("Merge nodes");
+        
+        //new Label(shell, SWT.NONE);
+        new Label(shell, SWT.NONE);
+        new Label(shell, SWT.NONE);
+        new Label(shell, SWT.NONE);
+
+    }
+
+    private void buildGuiTree() {
+        for (IGUIElement element : model.getRootElements()) {
+            TreeItem child = new TreeItem(guiTree, SWT.NULL);
+            child.setText(element.toString());
+            child.setData(element);
+            buildGuiTree(child, model.getChildren(element));
+        }
+    }
+
+    private void buildGuiTree(TreeItem currentParent, List<IGUIElement> elements) {
+        for (IGUIElement element : elements) {
+            TreeItem child = new TreeItem(currentParent, SWT.NULL);
+            child.setText(element.toString());
+            child.setData(element);
+            buildGuiTree(child, model.getChildren(element));
+        }
+    }
+
+    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);
+        }
+    }
+    
+    private void mergeSelectedNode(Tree tree) {
+        TreeItem[] selectedNodes = tree.getSelection();
+        if( selectedNodes.length<2 ) {
+            MessageBox messageBox = new MessageBox(shell, SWT.ERROR);
+            messageBox.setMessage("Must select at least two nodes to merge!");
+            messageBox.setText("Error");
+            messageBox.open();
+            return;
+        }
+        
+        TreeItem firstParent = selectedNodes[0].getParentItem();
+        for( int i=1 ; i<selectedNodes.length ; i++ ) {
+            if( firstParent!=selectedNodes[i].getParentItem() ) {
+                MessageBox messageBox = new MessageBox(shell, SWT.ERROR);
+                messageBox.setMessage("All selected nodes must have the same parent!");
+                messageBox.setText("Error");
+                messageBox.open();
+                return;
+            }
+        }
+        
+        try {
+            // try to merge the elements
+            IGUIElement firstElement = (IGUIElement) selectedNodes[0].getData();
+            for( int i=1 ; i<selectedNodes.length ; i++ ) {
+                model.mergeGUIElements(firstElement, (IGUIElement) selectedNodes[i].getData());
+            }
+        } catch( IllegalArgumentException e) {
+            Console.logException(e);
+        }
+        
+        // update visualization of the model
+        firstParent.removeAll();
+        buildGuiTree(firstParent, model.getChildren((IGUIElement) firstParent.getData()));
+        firstParent.setExpanded(true);
+    }
+
+}
Index: trunk/autoquest-ui-swt/src/main/java/de/ugoe/cs/autoquest/ui/swt/TrainModelDialog.java
===================================================================
--- trunk/autoquest-ui-swt/src/main/java/de/ugoe/cs/autoquest/ui/swt/TrainModelDialog.java	(revision 922)
+++ trunk/autoquest-ui-swt/src/main/java/de/ugoe/cs/autoquest/ui/swt/TrainModelDialog.java	(revision 922)
@@ -0,0 +1,238 @@
+package de.ugoe.cs.autoquest.ui.swt;
+
+import java.util.Arrays;
+
+import org.eclipse.swt.widgets.Dialog;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.MessageBox;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.swt.widgets.Spinner;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+
+import de.ugoe.cs.util.console.CommandExecuter;
+
+public class TrainModelDialog extends Dialog {
+
+    protected Shell shlTrainUsageModel;
+
+    private Button btnFirstorderMarkovModel;
+    private Button btnHighorderMarkovModel;
+    private Button btnPredictionByPartial;
+    private Button btnDeterministicFiniteAutomaton;
+
+    private Spinner minOrderSpinner;
+    private Spinner maxOrderSpinner;
+    private Text modelnameText;
+
+    private String[] sequenceNames;
+    private Text probEscapeText;
+    private Label lblEscapeProbability;
+
+    /**
+     * Create the dialog.
+     * 
+     * @param parent
+     * @param style
+     */
+    public TrainModelDialog(Shell parent, int style) {
+        super(parent, style);
+        setText("SWT Dialog");
+    }
+
+    /**
+     * Open the dialog.
+     */
+    public void open() {
+        createContents();
+        shlTrainUsageModel.open();
+        shlTrainUsageModel.layout();
+        Display display = getParent().getDisplay();
+        while (!shlTrainUsageModel.isDisposed()) {
+            if (!display.readAndDispatch()) {
+                display.sleep();
+            }
+        }
+    }
+
+    /**
+     * Create contents of the dialog.
+     */
+    private void createContents() {
+        shlTrainUsageModel =
+            new Shell(getParent(), SWT.DIALOG_TRIM | SWT.MIN | SWT.APPLICATION_MODAL);
+        shlTrainUsageModel.setSize(219, 330);
+        shlTrainUsageModel.setText("Train Usage Model");
+        shlTrainUsageModel.setLayout(new GridLayout(2, false));
+
+        Group grpGeneralInformation = new Group(shlTrainUsageModel, SWT.NONE);
+        grpGeneralInformation.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false, 2, 1));
+        grpGeneralInformation.setText("Name");
+        grpGeneralInformation.setLayout(new GridLayout(1, false));
+
+        modelnameText = new Text(grpGeneralInformation, SWT.BORDER);
+        modelnameText.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1));
+
+        Group grpType = new Group(shlTrainUsageModel, SWT.NONE);
+        grpType.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false, 2, 1));
+        grpType.setText("Type");
+        grpType.setLayout(new GridLayout(2, false));
+
+        btnFirstorderMarkovModel = new Button(grpType, SWT.RADIO);
+        btnFirstorderMarkovModel.addSelectionListener(new SelectionAdapter() {
+            @Override
+            public void widgetSelected(SelectionEvent e) {
+                minOrderSpinner.setEnabled(false);
+                maxOrderSpinner.setEnabled(false);
+                probEscapeText.setEnabled(false);
+            }
+        });
+        btnFirstorderMarkovModel
+            .setLayoutData(new GridData(SWT.LEFT, SWT.FILL, false, false, 2, 1));
+        btnFirstorderMarkovModel.setText("First-Order Markov Model");
+        btnFirstorderMarkovModel.setSelection(true);
+
+        btnHighorderMarkovModel = new Button(grpType, SWT.RADIO);
+        btnHighorderMarkovModel.addSelectionListener(new SelectionAdapter() {
+            @Override
+            public void widgetSelected(SelectionEvent e) {
+                minOrderSpinner.setEnabled(false);
+                maxOrderSpinner.setEnabled(true);
+                probEscapeText.setEnabled(false);
+            }
+        });
+        btnHighorderMarkovModel.setLayoutData(new GridData(SWT.LEFT, SWT.FILL, false, false, 2, 1));
+        btnHighorderMarkovModel.setText("High-Order Markov Model");
+
+        btnPredictionByPartial = new Button(grpType, SWT.RADIO);
+        btnPredictionByPartial.addSelectionListener(new SelectionAdapter() {
+            @Override
+            public void widgetSelected(SelectionEvent e) {
+                minOrderSpinner.setEnabled(true);
+                maxOrderSpinner.setEnabled(true);
+                probEscapeText.setEnabled(true);
+            }
+        });
+        btnPredictionByPartial.setLayoutData(new GridData(SWT.LEFT, SWT.FILL, true, false, 2, 1));
+        btnPredictionByPartial.setText("Prediction by Partial Match");
+
+        lblEscapeProbability = new Label(grpType, SWT.NONE);
+        lblEscapeProbability.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, false, 1, 1));
+        lblEscapeProbability.setText("Escape Probability:");
+
+        probEscapeText = new Text(grpType, SWT.BORDER);
+        probEscapeText.setText("0.1");
+        probEscapeText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
+        probEscapeText.setEnabled(false);
+
+        btnDeterministicFiniteAutomaton = new Button(grpType, SWT.RADIO);
+        btnDeterministicFiniteAutomaton.addSelectionListener(new SelectionAdapter() {
+            @Override
+            public void widgetSelected(SelectionEvent e) {
+                minOrderSpinner.setEnabled(false);
+                maxOrderSpinner.setEnabled(false);
+                probEscapeText.setEnabled(false);
+            }
+        });
+        btnDeterministicFiniteAutomaton.setLayoutData(new GridData(SWT.LEFT, SWT.FILL, false,
+                                                                   false, 2, 1));
+        btnDeterministicFiniteAutomaton.setText("Deterministic Finite Automaton");
+
+        Group grpModelProperties = new Group(shlTrainUsageModel, SWT.NONE);
+        grpModelProperties.setLayout(new GridLayout(4, false));
+        grpModelProperties.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, true, 2, 1));
+        grpModelProperties.setText("Order");
+
+        Label lblMin = new Label(grpModelProperties, SWT.NONE);
+        lblMin.setText("Min.");
+
+        minOrderSpinner = new Spinner(grpModelProperties, SWT.BORDER);
+        minOrderSpinner.setEnabled(false);
+
+        Label lblMax = new Label(grpModelProperties, SWT.NONE);
+        lblMax.setText("Max.");
+
+        maxOrderSpinner = new Spinner(grpModelProperties, SWT.BORDER);
+        maxOrderSpinner.setEnabled(false);
+        maxOrderSpinner.setMinimum(2);
+
+        Button btnTrain = new Button(shlTrainUsageModel, SWT.NONE);
+        btnTrain.addSelectionListener(new SelectionAdapter() {
+            @Override
+            public void widgetSelected(SelectionEvent e) {
+                String command = "";
+                String modelname = modelnameText.getText();
+                if (modelname.equals("")) {
+                    MessageBox messageBox = new MessageBox(shlTrainUsageModel, SWT.ERROR);
+                    messageBox.setText("Error");
+                    messageBox.setMessage("No modelname defined!");
+                    messageBox.open();
+                    return;
+                }
+                if (btnFirstorderMarkovModel.getSelection()) {
+                    command = "trainMarkovModel " + modelname + " " + sequenceNames[0];
+
+                }
+                else if (btnHighorderMarkovModel.getSelection()) {
+                    int modelOrder = maxOrderSpinner.getSelection();
+                    command =
+                        "trainMarkovModel " + modelname + " " + sequenceNames[0] + " " + modelOrder;
+                }
+                else if (btnPredictionByPartial.getSelection()) {
+                    int minOrder = minOrderSpinner.getSelection();
+                    int maxOrder = maxOrderSpinner.getSelection();
+                    if (minOrder > maxOrder) {
+                        MessageBox messageBox = new MessageBox(shlTrainUsageModel, SWT.ERROR);
+                        messageBox.setText("Error");
+                        messageBox
+                            .setMessage("Min. Order must be smaller than or equal to max. order!");
+                        messageBox.open();
+                        return;
+                    }
+                    double probEscape = Double.parseDouble(probEscapeText.getText());
+                    if (probEscape < 0.0 || probEscape > 1.0) {
+                        MessageBox messageBox = new MessageBox(shlTrainUsageModel, SWT.ERROR);
+                        messageBox.setText("Error");
+                        messageBox.setMessage("Escape probability must be in [0,1]!");
+                        messageBox.open();
+                        return;
+                    }
+                    command =
+                        "trainPPM " + modelname + " " + sequenceNames[0] + " " + probEscape + " " +
+                            maxOrder + " " + minOrder;
+                }
+                else if (btnDeterministicFiniteAutomaton.getSelection()) {
+                    command = "trainDFA " + modelname + " " + sequenceNames[0];
+                }
+                CommandExecuter.getInstance().exec(command);
+                for (int i = 1; i < sequenceNames.length; i++) {
+                    command = "updateModel " + sequenceNames[i];
+                    CommandExecuter.getInstance().exec(command);
+                }
+                shlTrainUsageModel.dispose();
+            }
+        });
+        btnTrain.setText("Train!");
+
+        Button btnAbort = new Button(shlTrainUsageModel, SWT.NONE);
+        btnAbort.addSelectionListener(new SelectionAdapter() {
+            @Override
+            public void widgetSelected(SelectionEvent e) {
+                shlTrainUsageModel.dispose();
+            }
+        });
+        btnAbort.setText("Abort");
+
+    }
+
+    public void setSequenceNames(String[] sequenceNames) {
+        this.sequenceNames = Arrays.copyOf(sequenceNames, sequenceNames.length);
+    }
+}
Index: trunk/autoquest-ui-swt/src/main/java/de/ugoe/cs/autoquest/ui/swt/commands/CMDshowSequences.java
===================================================================
--- trunk/autoquest-ui-swt/src/main/java/de/ugoe/cs/autoquest/ui/swt/commands/CMDshowSequences.java	(revision 922)
+++ trunk/autoquest-ui-swt/src/main/java/de/ugoe/cs/autoquest/ui/swt/commands/CMDshowSequences.java	(revision 922)
@@ -0,0 +1,66 @@
+package de.ugoe.cs.autoquest.ui.swt.commands;
+
+import java.util.List;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Shell;
+
+import de.ugoe.cs.autoquest.CommandHelpers;
+import de.ugoe.cs.autoquest.SequenceInstanceOf;
+import de.ugoe.cs.autoquest.ui.swt.SequencesDialog;
+import de.ugoe.cs.util.console.Command;
+import de.ugoe.cs.util.console.GlobalDataContainer;
+
+/**
+ * <p>
+ * Command to show sequences.
+ * </p>
+ * 
+ * @author Jeffrey Hall, Steffen Herbold
+ */
+public class CMDshowSequences implements Command {
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see de.ugoe.cs.util.console.Command#help()
+     */
+    @Override
+    public String help() {
+        return "showSequences <sequencesName>";
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see de.ugoe.cs.util.console.Command#run(java.util.List)
+     */
+    @Override
+    public void run(List<Object> parameters) {
+        String sequencesName;
+        try {
+            sequencesName = (String) parameters.get(0);
+        }
+        catch (Exception e) {
+            throw new IllegalArgumentException();
+        }
+
+        Object dataObject = GlobalDataContainer.getInstance().getData(sequencesName);
+        if (dataObject == null) {
+            CommandHelpers.objectNotFoundMessage(sequencesName);
+            return;
+        }
+        if (!SequenceInstanceOf.isCollectionOfSequences(dataObject)) {
+            CommandHelpers.objectNotType(sequencesName, "Collection<List<Event<?>>>");
+            return;
+        }
+
+        Shell shell = new Shell(SWT.NONE);
+        shell.open();
+        shell.layout();
+        shell.setSize(0, 0);
+        SequencesDialog sequencesDialog = new SequencesDialog(shell, SWT.NONE);
+        sequencesDialog.open(sequencesName);
+        shell.dispose();
+    }
+}
