- Timestamp:
- 03/08/12 10:10:42 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/Runner.java
r299 r396 30 30 text, swt 31 31 }; 32 33 public enum LOG4JTYPE { 34 enable, disable 35 } 32 36 33 37 /** … … 52 56 CommandExecuter.getInstance().addCommandPackage( 53 57 "de.ugoe.cs.eventbench.jfc.commands"); 54 new Log4JLogger();58 //new Log4JLogger(); 55 59 56 60 OptionParser parser = new OptionParser(); 61 OptionSpec<LOG4JTYPE> log4j = parser.accepts("log4j", "Allowed values: enable, disable").withRequiredArg() 62 .ofType(LOG4JTYPE.class).defaultsTo(LOG4JTYPE.enable); 57 63 OptionSpec<UITYPE> ui = parser.accepts("ui", "Allowed values: text, swt").withRequiredArg() 58 64 .ofType(UITYPE.class).defaultsTo(UITYPE.text); … … 61 67 List<String> startupCommands = options.nonOptionArguments(); 62 68 try { 63 switch (options.valueOf(ui)) { 64 case text: 65 TextConsole textConsole = new TextConsole(); 66 for (String command : startupCommands) { 67 CommandExecuter.getInstance().exec(command); 69 switch (options.valueOf(log4j)) { 70 case enable: 71 new Log4JLogger(); 72 break; 73 case disable: 74 // do nothing 75 break; 76 default: 77 throw new AssertionError("reached source code that should be unreachable impossible"); 68 78 } 69 textConsole.run(true); 70 break; 71 case swt: 72 MainWindow mainWindow = new MainWindow(startupCommands); 73 mainWindow.open(); 74 break; 75 } 79 80 switch (options.valueOf(ui)) { 81 case text: 82 TextConsole textConsole = new TextConsole(); 83 for (String command : startupCommands) { 84 CommandExecuter.getInstance().exec(command); 85 } 86 textConsole.run(true); 87 break; 88 case swt: 89 MainWindow mainWindow = new MainWindow(startupCommands); 90 mainWindow.open(); 91 break; 92 default: 93 throw new AssertionError("reached source code that should be unreachable impossible"); 94 } 76 95 } catch (OptionException e) { 77 96 System.err.println("Invalid Parameters: " + e.getMessage());
Note: See TracChangeset
for help on using the changeset viewer.