[1] | 1 | package de.ugoe.cs.eventbench;
|
---|
| 2 |
|
---|
[207] | 3 | import de.ugoe.cs.eventbench.log4j.Log4JLogger;
|
---|
[188] | 4 | import de.ugoe.cs.eventbench.swt.MainWindow;
|
---|
[1] | 5 | import de.ugoe.cs.util.console.CommandExecuter;
|
---|
[171] | 6 | import de.ugoe.cs.util.console.Console;
|
---|
[1] | 7 | import de.ugoe.cs.util.console.TextConsole;
|
---|
| 8 |
|
---|
[171] | 9 | /**
|
---|
| 10 | * <p>
|
---|
| 11 | * Start-up class of the application.
|
---|
| 12 | * </p>
|
---|
| 13 | * <p>
|
---|
| 14 | * It sets up and starts the {@link Console}.
|
---|
| 15 | * </p>
|
---|
| 16 | *
|
---|
| 17 | * @author Steffen Herbold
|
---|
| 18 | * @version 1.0
|
---|
| 19 | */
|
---|
[1] | 20 | public class Runner {
|
---|
| 21 |
|
---|
| 22 | /**
|
---|
[171] | 23 | * <p>
|
---|
| 24 | * Main method of the application.
|
---|
| 25 | * </p>
|
---|
| 26 | *
|
---|
[1] | 27 | * @param args
|
---|
[171] | 28 | * if parameters are defined, they are interpreted as commands
|
---|
| 29 | * for the {@link Console} and executed before the user can use
|
---|
| 30 | * the console; can be used to perform batch operations
|
---|
[1] | 31 | */
|
---|
| 32 | public static void main(String[] args) {
|
---|
[171] | 33 | CommandExecuter.getInstance().addCommandPackage(
|
---|
| 34 | "de.ugoe.cs.eventbench.commands");
|
---|
| 35 | CommandExecuter.getInstance().addCommandPackage(
|
---|
| 36 | "de.ugoe.cs.eventbench.windows.commands");
|
---|
| 37 | CommandExecuter.getInstance().addCommandPackage(
|
---|
| 38 | "de.ugoe.cs.eventbench.web.commands");
|
---|
[196] | 39 | CommandExecuter.getInstance().addCommandPackage(
|
---|
| 40 | "de.ugoe.cs.eventbench.efg.commands");
|
---|
[1] | 41 | TextConsole textConsole = new TextConsole();
|
---|
[207] | 42 | new Log4JLogger();
|
---|
[188] | 43 | boolean swtGuiRunning = false;
|
---|
[171] | 44 | if (args.length >= 1) {
|
---|
[188] | 45 | if( args[0].equals("-swt") ) {
|
---|
| 46 | MainWindow mainWindow = new MainWindow();
|
---|
| 47 | mainWindow.open();
|
---|
| 48 | swtGuiRunning = true;
|
---|
| 49 | } else {
|
---|
| 50 | for (String command : args) {
|
---|
| 51 | CommandExecuter.getInstance().exec(command);
|
---|
| 52 | }
|
---|
[112] | 53 | }
|
---|
| 54 | }
|
---|
[188] | 55 | if( !swtGuiRunning ) {
|
---|
| 56 | textConsole.run(true);
|
---|
| 57 | }
|
---|
[1] | 58 | }
|
---|
| 59 |
|
---|
| 60 | }
|
---|