Index: unk/EventBenchConsole/src/de/ugoe/cs/eventbench/swt/CommandHistory.java
===================================================================
--- /trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/swt/CommandHistory.java	(revision 191)
+++ 	(revision )
@@ -1,72 +1,0 @@
-package de.ugoe.cs.eventbench.swt;
-
-import org.eclipse.swt.widgets.Dialog;
-import org.eclipse.swt.widgets.Display;
-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;
-
-public class CommandHistory extends Dialog {
-
-	protected Object result;
-	protected Shell shell;
-
-	/**
-	 * Create the dialog.
-	 * @param parent
-	 * @param style
-	 */
-	public CommandHistory(Shell parent, int style) {
-		super(parent, style);
-		setText("SWT Dialog");
-	}
-
-	/**
-	 * Open the dialog.
-	 * @return the result
-	 */
-	public Object open() {
-		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.DIALOG_TRIM);
-		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);
-		
-		List list = new List(shell, SWT.BORDER | SWT.V_SCROLL | SWT.MULTI);
-		list.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 3, 1));
-		
-		Button btnExec = new Button(shell, SWT.NONE);
-		btnExec.setText("Execute");
-		
-		Button btnCopyToClipboard = new Button(shell, SWT.NONE);
-		btnCopyToClipboard.setText("Copy to Clipboard");
-		
-		Button btnCreateBatchfile = new Button(shell, SWT.NONE);
-		btnCreateBatchfile.setText("Create Batchfile");
-
-	}
-}
Index: /trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/swt/CommandHistoryDialog.java
===================================================================
--- /trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/swt/CommandHistoryDialog.java	(revision 192)
+++ /trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/swt/CommandHistoryDialog.java	(revision 192)
@@ -0,0 +1,72 @@
+package de.ugoe.cs.eventbench.swt;
+
+import org.eclipse.swt.widgets.Dialog;
+import org.eclipse.swt.widgets.Display;
+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;
+
+public class CommandHistoryDialog extends Dialog {
+
+	protected Object result;
+	protected Shell shell;
+
+	/**
+	 * Create the dialog.
+	 * @param parent
+	 * @param style
+	 */
+	public CommandHistoryDialog(Shell parent, int style) {
+		super(parent, style);
+		setText("SWT Dialog");
+	}
+
+	/**
+	 * Open the dialog.
+	 * @return the result
+	 */
+	public Object open() {
+		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.DIALOG_TRIM);
+		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);
+		
+		List list = new List(shell, SWT.BORDER | SWT.V_SCROLL | SWT.MULTI);
+		list.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 3, 1));
+		
+		Button btnExec = new Button(shell, SWT.NONE);
+		btnExec.setText("Execute");
+		
+		Button btnCopyToClipboard = new Button(shell, SWT.NONE);
+		btnCopyToClipboard.setText("Copy to Clipboard");
+		
+		Button btnCreateBatchfile = new Button(shell, SWT.NONE);
+		btnCreateBatchfile.setText("Create Batchfile");
+
+	}
+}
Index: /trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/swt/ConsoleTabComposite.java
===================================================================
--- /trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/swt/ConsoleTabComposite.java	(revision 192)
+++ /trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/swt/ConsoleTabComposite.java	(revision 192)
@@ -0,0 +1,89 @@
+package de.ugoe.cs.eventbench.swt;
+
+import org.eclipse.swt.SWT;
+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.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 Text 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);
+		
+		Button btnEnter = new Button(this, SWT.NONE);
+		btnEnter.addSelectionListener(new SelectionAdapter() {
+			@Override
+			public void widgetSelected(SelectionEvent e) {
+				executeCommand();
+			}
+		});
+		btnEnter.setText("Enter");
+		
+		textConsoleOutput = new Text(this, SWT.BORDER | 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);
+	}
+	
+	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/EventBenchConsole/src/de/ugoe/cs/eventbench/swt/DataTabComposite.java
===================================================================
--- /trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/swt/DataTabComposite.java	(revision 192)
+++ /trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/swt/DataTabComposite.java	(revision 192)
@@ -0,0 +1,113 @@
+package de.ugoe.cs.eventbench.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.eventbench.data.GlobalDataContainer;
+import de.ugoe.cs.util.StringTools;
+import de.ugoe.cs.util.console.CommandExecuter;
+
+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 sequencesName : GlobalDataContainer.getInstance().getAllKeys() ) {
+			dataList.add(sequencesName);
+		}
+	}
+
+}
Index: /trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/swt/GetObjectNameDialog.java
===================================================================
--- /trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/swt/GetObjectNameDialog.java	(revision 192)
+++ /trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/swt/GetObjectNameDialog.java	(revision 192)
@@ -0,0 +1,99 @@
+package de.ugoe.cs.eventbench.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 Object result;
+	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.
+	 * @return the result
+	 */
+	public Object open() {
+		createContents();
+		shlObjectName.open();
+		shlObjectName.layout();
+		Display display = getParent().getDisplay();
+		while (!shlObjectName.isDisposed()) {
+			if (!display.readAndDispatch()) {
+				display.sleep();
+			}
+		}
+		return result;
+	}
+
+	/**
+	 * 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/EventBenchConsole/src/de/ugoe/cs/eventbench/swt/MainWindow.java
===================================================================
--- /trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/swt/MainWindow.java	(revision 191)
+++ /trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/swt/MainWindow.java	(revision 192)
@@ -1,5 +1,3 @@
 package de.ugoe.cs.eventbench.swt;
-
-import java.util.Collection;
 
 import org.eclipse.swt.widgets.Display;
@@ -9,10 +7,6 @@
 import org.eclipse.swt.widgets.MenuItem;
 import org.eclipse.swt.widgets.Text;
-import org.eclipse.swt.widgets.Label;
 import org.eclipse.swt.widgets.TabFolder;
 import org.eclipse.swt.widgets.TabItem;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.List;
 import org.eclipse.swt.layout.GridLayout;
 import org.eclipse.swt.layout.GridData;
@@ -20,47 +14,26 @@
 import org.eclipse.swt.events.SelectionEvent;
 
-import de.ugoe.cs.eventbench.data.Event;
-import de.ugoe.cs.eventbench.data.GlobalDataContainer;
-import de.ugoe.cs.util.console.CommandExecuter;
-import de.ugoe.cs.util.console.TextConsole;
-import org.eclipse.swt.events.KeyAdapter;
-import org.eclipse.swt.events.KeyEvent;
-
 public class MainWindow {
 
 	protected Shell shell;
-	private Text textCommand;
-	private Text textConsoleOutput;
-	private List list;
+	
+	protected TabItem consoleTab;
+	protected TabItem sequencesTab;
+	protected TabItem modelsTab;
+	protected TabItem dataTab;
+	protected ConsoleTabComposite consoleTabComposite;
+	protected SequencesTabComposite sequencesTabComposite;
+	protected ModelsTabComposite modelsTabComposite;
+	protected DataTabComposite dataTabComposite;
 
-	/**
-	 * Launch the application.
-	 * @param args
-	 */
-	public static void main(String[] args) {
-		// TODO this main method needs to be removed/remodeled when merging with other project
-		try {
-			CommandExecuter.getInstance().addCommandPackage(
-					"de.ugoe.cs.eventbench.commands");
-			CommandExecuter.getInstance().addCommandPackage(
-					"de.ugoe.cs.eventbench.windows.commands");
-			CommandExecuter.getInstance().addCommandPackage(
-					"de.ugoe.cs.eventbench.web.commands");
-			new TextConsole();
-			
-			MainWindow window = new MainWindow();
-			window.open();
-		} catch (Exception e) {
-			e.printStackTrace();
-		}
-	}
 
 	/**
 	 * Open the window.
+	 * @wbp.parser.entryPoint
 	 */
 	public void open() {
 		Display display = Display.getDefault();
 		createContents();
-		new SWTConsole(textConsoleOutput);
+		new SWTConsole(getTextConsoleOutput());
 		shell.open();
 		shell.layout();
@@ -119,138 +92,47 @@
 		
 		TabFolder tabFolder = new TabFolder(shell, SWT.NONE);
-		tabFolder.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
-		
-		TabItem tbtmConsoleMode = new TabItem(tabFolder, SWT.NONE);
-		tbtmConsoleMode.setText("Console");
-		
-		Composite composite = new Composite(tabFolder, SWT.NO_BACKGROUND);
-		tbtmConsoleMode.setControl(composite);
-		composite.setLayout(new GridLayout(3, false));
-		
-		Label lblCommand = new Label(composite, SWT.NONE);
-		lblCommand.setText("Command:");
-		
-		textCommand = new Text(composite, SWT.BORDER);
-		textCommand.addKeyListener(new KeyAdapter() {
+		tabFolder.addSelectionListener(new SelectionAdapter() {
 			@Override
-			public void keyReleased(KeyEvent e) {
-				if( e.keyCode==SWT.CR ) {
-					String command = textCommand.getText().trim();
-					CommandExecuter.getInstance().exec(command);
+			public void widgetSelected(SelectionEvent e) {
+				if( e.item == sequencesTab ) {
+					sequencesTabComposite.updateSequenceList();
+				}
+				else if(e.item == modelsTab ) {
+					modelsTabComposite.updateModelList();
+				}
+				else if(e.item == dataTab) {
+					dataTabComposite.updateDataList();
 				}
 			}
 		});
-		GridData gd_textCommand = new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1);
-		gd_textCommand.widthHint = 304;
-		textCommand.setLayoutData(gd_textCommand);
+		tabFolder.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
 		
-		Button btnEnter = new Button(composite, SWT.NONE);
-		btnEnter.addSelectionListener(new SelectionAdapter() {
-			@Override
-			public void widgetSelected(SelectionEvent e) {
-				// Event handler for executing commands
-				String command = textCommand.getText().trim();
-				CommandExecuter.getInstance().exec(command);
-			}
-		});
-		btnEnter.setText("Enter");
+		consoleTab = new TabItem(tabFolder, SWT.NONE);
+		consoleTab.setText("Console");
 		
-		textConsoleOutput = new Text(composite, SWT.BORDER | 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);
+		consoleTabComposite = new ConsoleTabComposite(tabFolder, SWT.NO_BACKGROUND);
+		consoleTab.setControl(consoleTabComposite);
 		
-		TabItem tbtmSequences = new TabItem(tabFolder, SWT.NONE);
-		tbtmSequences.setText("Sequences");
+		sequencesTab = new TabItem(tabFolder, SWT.NONE);
+		sequencesTab.setText("Sequences");
 		
-		Composite composite_2 = new Composite(tabFolder, SWT.NO_BACKGROUND);
-		tbtmSequences.setControl(composite_2);
-		composite_2.setLayout(new GridLayout(5, false));
+		sequencesTabComposite = new SequencesTabComposite(tabFolder, SWT.NO_BACKGROUND);
+		sequencesTab.setControl(sequencesTabComposite);
 		
-		list = new List(composite_2, SWT.BORDER | SWT.V_SCROLL | SWT.MULTI);
-		list.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 5, 1));
-		list.setItems(new String[] {});
-		for( String sequencesName : GlobalDataContainer.getInstance().getAllSequencesNames() ) {
-			list.add(sequencesName);
-		}
+		modelsTab = new TabItem(tabFolder, SWT.NONE);
+		modelsTab.setText("Models");
 		
-		Button btnEdit = new Button(composite_2, SWT.NONE);
-		btnEdit.addSelectionListener(new SelectionAdapter() {
-			@Override
-			public void widgetSelected(SelectionEvent e) {
-				// TODO edit sequences event handler
-			}
-		});
-		btnEdit.setText("Edit");
+		modelsTabComposite = new ModelsTabComposite(tabFolder, SWT.NO_BACKGROUND);
+		modelsTab.setControl(modelsTabComposite);
+				
+		dataTab = new TabItem(tabFolder, SWT.NONE);
+		dataTab.setText("Data");
 		
-		Button btnDelete = new Button(composite_2, SWT.NONE);
-		btnDelete.addSelectionListener(new SelectionAdapter() {
-			@Override
-			public void widgetSelected(SelectionEvent e) {
-				String[] selectedSequences = list.getSelection();
-				for( String selected : selectedSequences) {
-					GlobalDataContainer.getInstance().removeData(selected);
-				}
-			}
-		});
-		btnDelete.setText("Delete");
+		dataTabComposite = new DataTabComposite(tabFolder, SWT.NO_BACKGROUND);
+		dataTab.setControl(dataTabComposite);
 		
-		Button btnReplay = new Button(composite_2, SWT.NONE);
-		btnReplay.setText("Replay");
-		
-		Button btnTrainModel = new Button(composite_2, SWT.NONE);
-		btnTrainModel.setText("Train Model");
-		
-		Button btnParse = new Button(composite_2, SWT.NONE);
-		btnParse.setText("Parse");
-		
-		TabItem tbtmModels = new TabItem(tabFolder, SWT.NONE);
-		tbtmModels.setText("Models");
-		
-		Composite composite_1 = new Composite(tabFolder, SWT.NO_BACKGROUND);
-		tbtmModels.setControl(composite_1);
-		composite_1.setLayout(new GridLayout(5, false));
-		
-		List list_1 = new List(composite_1, SWT.BORDER | SWT.V_SCROLL | SWT.MULTI);
-		list_1.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 5, 1));
-		
-		Button btnShow = new Button(composite_1, SWT.NONE);
-		btnShow.setText("Visualize");
-		
-		Button btnDelete_1 = new Button(composite_1, SWT.NONE);
-		btnDelete_1.setText("Delete");
-		
-		Button btnGenSequences = new Button(composite_1, SWT.NONE);
-		btnGenSequences.setText("Gen. Sequences");
-		
-		Button btnProperties = new Button(composite_1, SWT.NONE);
-		btnProperties.setText("Properties");
-		
-		Button btnCreateDot = new Button(composite_1, SWT.NONE);
-		btnCreateDot.setText("Create DOT");
-		
-		TabItem tbtmData = new TabItem(tabFolder, SWT.NONE);
-		tbtmData.setText("Data");
-		
-		Composite composite_3 = new Composite(tabFolder, SWT.NO_BACKGROUND);
-		tbtmData.setControl(composite_3);
-		composite_3.setLayout(new GridLayout(3, false));
-		
-		List list_2 = new List(composite_3, SWT.BORDER | SWT.V_SCROLL);
-		list_2.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 3, 1));
-		
-		Button btnLoad = new Button(composite_3, SWT.NONE);
-		btnLoad.setText("Load");
-		
-		Button btnSave = new Button(composite_3, SWT.NONE);
-		btnSave.setText("Save");
-		
-		Button btnDelete_2 = new Button(composite_3, SWT.NONE);
-		btnDelete_2.setText("Delete");
-
 	}
 	public Text getTextConsoleOutput() {
-		return textConsoleOutput;
+		return consoleTabComposite.textConsoleOutput;
 	}
 }
Index: unk/EventBenchConsole/src/de/ugoe/cs/eventbench/swt/ModelProperties.java
===================================================================
--- /trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/swt/ModelProperties.java	(revision 191)
+++ 	(revision )
@@ -1,102 +1,0 @@
-package de.ugoe.cs.eventbench.swt;
-
-import org.eclipse.swt.widgets.Dialog;
-import org.eclipse.swt.widgets.Display;
-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;
-
-public class ModelProperties extends Dialog {
-
-	protected Object result;
-	protected Shell shlModelProperties;
-
-	/**
-	 * Create the dialog.
-	 * @param parent
-	 * @param style
-	 */
-	public ModelProperties(Shell parent, int style) {
-		super(parent, style);
-		setText("SWT Dialog");
-	}
-
-	/**
-	 * Open the dialog.
-	 * @return the result
-	 */
-	public Object open() {
-		createContents();
-		shlModelProperties.open();
-		shlModelProperties.layout();
-		Display display = getParent().getDisplay();
-		while (!shlModelProperties.isDisposed()) {
-			if (!display.readAndDispatch()) {
-				display.sleep();
-			}
-		}
-		return result;
-	}
-
-	/**
-	 * 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.V_SCROLL);
-		
-		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("####");
-		
-		Label lblNumTrieLeafs = new Label(grpStatistics, SWT.NONE);
-		lblNumTrieLeafs.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false, 1, 1));
-		lblNumTrieLeafs.setText("Size (#Trie Leafs)");
-		
-		Label label_1 = new Label(grpStatistics, SWT.RIGHT);
-		label_1.setLayoutData(new GridData(SWT.RIGHT, SWT.TOP, false, false, 1, 1));
-		label_1.setText("####");
-		
-		Label lblEntropy = new Label(grpStatistics, SWT.NONE);
-		lblEntropy.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false, 1, 1));
-		lblEntropy.setText("Entropy");
-		
-		Label label_2 = new Label(grpStatistics, SWT.RIGHT);
-		label_2.setLayoutData(new GridData(SWT.RIGHT, SWT.TOP, false, false, 1, 1));
-		label_2.setText("####");
-		
-		Button btnCalculateEntropy = new Button(shlModelProperties, SWT.NONE);
-		btnCalculateEntropy.setText("Calculate Entropy");
-		
-		Button btnClose = new Button(shlModelProperties, SWT.NONE);
-		btnClose.setText("Close");
-
-	}
-}
Index: /trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/swt/ModelPropertiesDialog.java
===================================================================
--- /trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/swt/ModelPropertiesDialog.java	(revision 192)
+++ /trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/swt/ModelPropertiesDialog.java	(revision 192)
@@ -0,0 +1,102 @@
+package de.ugoe.cs.eventbench.swt;
+
+import org.eclipse.swt.widgets.Dialog;
+import org.eclipse.swt.widgets.Display;
+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;
+
+public class ModelPropertiesDialog extends Dialog {
+
+	protected Object result;
+	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.
+	 * @return the result
+	 */
+	public Object open() {
+		createContents();
+		shlModelProperties.open();
+		shlModelProperties.layout();
+		Display display = getParent().getDisplay();
+		while (!shlModelProperties.isDisposed()) {
+			if (!display.readAndDispatch()) {
+				display.sleep();
+			}
+		}
+		return result;
+	}
+
+	/**
+	 * 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.V_SCROLL);
+		
+		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("####");
+		
+		Label lblNumTrieLeafs = new Label(grpStatistics, SWT.NONE);
+		lblNumTrieLeafs.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false, 1, 1));
+		lblNumTrieLeafs.setText("Size (#Trie Leafs)");
+		
+		Label label_1 = new Label(grpStatistics, SWT.RIGHT);
+		label_1.setLayoutData(new GridData(SWT.RIGHT, SWT.TOP, false, false, 1, 1));
+		label_1.setText("####");
+		
+		Label lblEntropy = new Label(grpStatistics, SWT.NONE);
+		lblEntropy.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false, 1, 1));
+		lblEntropy.setText("Entropy");
+		
+		Label label_2 = new Label(grpStatistics, SWT.RIGHT);
+		label_2.setLayoutData(new GridData(SWT.RIGHT, SWT.TOP, false, false, 1, 1));
+		label_2.setText("####");
+		
+		Button btnCalculateEntropy = new Button(shlModelProperties, SWT.NONE);
+		btnCalculateEntropy.setText("Calculate Entropy");
+		
+		Button btnClose = new Button(shlModelProperties, SWT.NONE);
+		btnClose.setText("Close");
+
+	}
+}
Index: /trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/swt/ModelsTabComposite.java
===================================================================
--- /trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/swt/ModelsTabComposite.java	(revision 192)
+++ /trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/swt/ModelsTabComposite.java	(revision 192)
@@ -0,0 +1,72 @@
+package de.ugoe.cs.eventbench.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.layout.GridLayout;
+import org.eclipse.swt.layout.GridData;
+
+import de.ugoe.cs.eventbench.data.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 | SWT.MULTI);
+		modelList.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 5, 1));
+		
+		Button btnShow = new Button(this, SWT.NONE);
+		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.setText("Gen. Sequences");
+		
+		Button btnProperties = new Button(this, SWT.NONE);
+		btnProperties.setText("Properties");
+		
+		Button btnCreateDot = new Button(this, SWT.NONE);
+		btnCreateDot.setText("Create DOT");
+	}
+
+	@Override
+	protected void checkSubclass() {
+		// Disable the check that prevents subclassing of SWT components
+	}
+	
+	public void updateModelList() {
+		modelList.removeAll();
+		for( String sequencesName : GlobalDataContainer.getInstance().getAllModelNames() ) {
+			modelList.add(sequencesName);
+		}
+	}
+
+}
Index: /trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/swt/SWTConsole.java
===================================================================
--- /trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/swt/SWTConsole.java	(revision 191)
+++ /trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/swt/SWTConsole.java	(revision 192)
@@ -3,4 +3,5 @@
 import org.eclipse.swt.widgets.Text;
 
+import de.ugoe.cs.util.StringTools;
 import de.ugoe.cs.util.console.Console;
 import de.ugoe.cs.util.console.ConsoleObserver;
@@ -38,5 +39,5 @@
 	@Override
 	public void commandNotification(String command) {
-		output.append("> " + command);	
+		output.append("> " + command + StringTools.ENDLINE);	
 	}
 }
Index: /trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/swt/SWTHelpers.java
===================================================================
--- /trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/swt/SWTHelpers.java	(revision 192)
+++ /trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/swt/SWTHelpers.java	(revision 192)
@@ -0,0 +1,32 @@
+package de.ugoe.cs.eventbench.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/EventBenchConsole/src/de/ugoe/cs/eventbench/swt/SequencesTabComposite.java
===================================================================
--- /trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/swt/SequencesTabComposite.java	(revision 192)
+++ /trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/swt/SequencesTabComposite.java	(revision 192)
@@ -0,0 +1,108 @@
+package de.ugoe.cs.eventbench.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.layout.GridLayout;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+
+import de.ugoe.cs.eventbench.data.GlobalDataContainer;
+import de.ugoe.cs.util.console.CommandExecuter;
+
+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.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.setText("Parse");
+	}
+	
+	public void updateSequenceList() {
+		sequenceList.removeAll();
+		for( String sequencesName : GlobalDataContainer.getInstance().getAllSequencesNames() ) {
+			sequenceList.add(sequencesName);
+		}
+	}
+	
+	@Override
+	protected void checkSubclass() {
+		// Disable the check that prevents subclassing of SWT components
+	}
+
+}
Index: /trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/swt/TrainModelDialog.java
===================================================================
--- /trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/swt/TrainModelDialog.java	(revision 191)
+++ /trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/swt/TrainModelDialog.java	(revision 192)
@@ -3,4 +3,5 @@
 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;
@@ -12,4 +13,9 @@
 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;
+import de.ugoe.cs.util.console.Console;
 
 public class TrainModelDialog extends Dialog {
@@ -17,5 +23,17 @@
 	protected Object result;
 	protected Shell shlTrainUsageModel;
-	private Text text_1;
+	
+	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;
 
 	/**
@@ -51,5 +69,5 @@
 	private void createContents() {
 		shlTrainUsageModel = new Shell(getParent(), SWT.DIALOG_TRIM | SWT.MIN | SWT.APPLICATION_MODAL);
-		shlTrainUsageModel.setSize(219, 279);
+		shlTrainUsageModel.setSize(219, 330);
 		shlTrainUsageModel.setText("Train Usage Model");
 		shlTrainUsageModel.setLayout(new GridLayout(2, false));
@@ -60,26 +78,68 @@
 		grpGeneralInformation.setLayout(new GridLayout(1, false));
 		
-		text_1 = new Text(grpGeneralInformation, SWT.BORDER);
-		text_1.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1));
+		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(1, false));
-		
-		Button btnFirstorderMarkovModel = new Button(grpType, SWT.RADIO);
-		btnFirstorderMarkovModel.setLayoutData(new GridData(SWT.LEFT, SWT.FILL, false, false, 1, 1));
+		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");
-		
-		Button btnHighorderMarkovModel = new Button(grpType, SWT.RADIO);
-		btnHighorderMarkovModel.setLayoutData(new GridData(SWT.LEFT, SWT.FILL, false, false, 1, 1));
+		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");
 		
-		Button btnPredictionByPartial = new Button(grpType, SWT.RADIO);
-		btnPredictionByPartial.setLayoutData(new GridData(SWT.LEFT, SWT.FILL, false, false, 1, 1));
+		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");
 		
-		Button btnDeterministicFiniteAutomaton = new Button(grpType, SWT.RADIO);
-		btnDeterministicFiniteAutomaton.setLayoutData(new GridData(SWT.LEFT, SWT.FILL, false, false, 1, 1));
+		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");
 		
@@ -92,21 +152,78 @@
 		lblMin.setText("Min.");
 		
-		Spinner spinner_1 = new Spinner(grpModelProperties, SWT.BORDER);
+		minOrderSpinner = new Spinner(grpModelProperties, SWT.BORDER);
+		minOrderSpinner.setEnabled(false);
 		
 		Label lblMax = new Label(grpModelProperties, SWT.NONE);
 		lblMax.setText("Max.");
 		
-		Spinner spinner = new Spinner(grpModelProperties, SWT.BORDER);
-		new Label(grpModelProperties, SWT.NONE);
-		new Label(grpModelProperties, SWT.NONE);
-		new Label(grpModelProperties, SWT.NONE);
-		new Label(grpModelProperties, SWT.NONE);
+		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!");
+					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!");
+						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]!");
+						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 = sequenceNames;
+	}
 }
