Index: trunk/quest-ui-swt/src/main/java/de/ugoe/cs/quest/ui/swt/SequencesDialog.java
===================================================================
--- trunk/quest-ui-swt/src/main/java/de/ugoe/cs/quest/ui/swt/SequencesDialog.java	(revision 548)
+++ trunk/quest-ui-swt/src/main/java/de/ugoe/cs/quest/ui/swt/SequencesDialog.java	(revision 570)
@@ -1,2 +1,3 @@
+
 package de.ugoe.cs.quest.ui.swt;
 
@@ -24,131 +25,138 @@
 public class SequencesDialog extends Dialog {
 
-	private String sequencesName;
-	
-	private List sequenceList;
-	private Collection<java.util.List<Event>> sequences;
-	private SortedSet<String> targets;
-	
-	protected Shell shell;
+    private String sequencesName;
 
-	/**
-	 * Create the dialog.
-	 * @param parent
-	 * @param style
-	 */
-	public SequencesDialog(Shell parent, int style) {
-		super(parent, style);
-		setText("SWT Dialog");
-	}
+    private List sequenceList;
+    private Collection<java.util.List<Event>> sequences;
+    private SortedSet<String> targets;
 
-	/**
-	 * 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();
-			}
-		}
-	}
+    protected Shell shell;
 
-	/**
-	 * 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, targets);
-					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");
+    /**
+     * Create the dialog.
+     * 
+     * @param parent
+     * @param style
+     */
+    public SequencesDialog(Shell parent, int style) {
+        super(parent, style);
+        setText("SWT Dialog");
+    }
 
-	}
-	
-	@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");
-			targets = null;
-			if( targetObject instanceof SortedSet ) {
-				if( !((SortedSet<?>) targetObject).isEmpty() ) {
-					if( ((SortedSet<?>) targetObject).first() instanceof String ) {
-						targets = (SortedSet<String>) targetObject;
-					}
-				}
-			}
-			if( targets==null ) {
-				targets = new TreeSet<String>();
-				for( java.util.List<Event> sequence : sequences ) {
-					for( Event event : sequence ) {
-						String target = event.getTarget();
-						if( target!=null ) {
-							targets.add(target);
-						}
-					}
-				}
-			}
-		} else {
-			MessageBox messageBox = new MessageBox(shell, SWT.ERROR);
-			messageBox.setMessage("Internal error. Sequences object not of expected type!");
-			messageBox.setText("Error");
-			messageBox.open();
-		}
-	}
+    /**
+     * 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, targets);
+                    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");
+            targets = null;
+            if (targetObject instanceof SortedSet) {
+                if (!((SortedSet<?>) targetObject).isEmpty()) {
+                    if (((SortedSet<?>) targetObject).first() instanceof String) {
+                        targets = (SortedSet<String>) targetObject;
+                    }
+                }
+            }
+            if (targets == null) {
+                targets = new TreeSet<String>();
+                for (java.util.List<Event> sequence : sequences) {
+                    for (Event event : sequence) {
+                        // TODO check if toString() is sufficient
+                        String target = event.getTarget().toString();
+                        if (target != null) {
+                            targets.add(target);
+                        }
+                    }
+                }
+            }
+        }
+        else {
+            MessageBox messageBox = new MessageBox(shell, SWT.ERROR);
+            messageBox.setMessage("Internal error. Sequences object not of expected type!");
+            messageBox.setText("Error");
+            messageBox.open();
+        }
+    }
 
 }
