package de.ugoe.cs.eventbench.commands; import java.security.InvalidParameterException; import java.util.Collection; import java.util.List; import de.ugoe.cs.eventbench.swing.DlgSequences; import de.ugoe.cs.util.console.Command; import de.ugoe.cs.util.console.Console; import de.ugoe.cs.eventbench.data.GlobalDataContainer; import de.ugoe.cs.eventbench.data.Event; /** *

* Command to show sequences. *

* * @author Jeffrey Hall, Steffen Herbold */ public class CMDshowSequences implements Command { /* * (non-Javadoc) * * @see de.ugoe.cs.util.console.Command#help() */ @Override public void help() { Console.println("Usage: showSequences"); } /* * (non-Javadoc) * * @see de.ugoe.cs.util.console.Command#run(java.util.List) */ @SuppressWarnings("unchecked") @Override public void run(List parameters) { if (parameters.size() > 0) throw new InvalidParameterException(); Collection>> containedSequences = null; try { containedSequences = (Collection>>) GlobalDataContainer .getInstance().getData("sequences"); } catch (ClassCastException e) { Console.println("Unable to cast Data in GlobalDataContainer to List of Sequences"); } if (containedSequences == null) { Console.printerrln("No sequences found."); } else { // TODO use SWT-GUI instead DlgSequences.showDialog(); synchronized (Console.getInstance()) { try { Console.getInstance().wait(); } catch (InterruptedException e) { e.printStackTrace(); } } } } }