コード例 #1
0
 public ToolSelectorCommandLine(CommandLineParameters params) {
   if (params.gMixTool != null
       && params.gMixTool != ToolName.NOT_SET) // start desired tool directly
   ToolName.execute(params);
   else displayCommandLineOptions();
   params.gMixTool = getUserInput();
   ToolName.execute(params);
 }
コード例 #2
0
 private static ToolName getUserInput() {
   ToolName t = ToolName.NOT_SET;
   do {
     displayUserInputOptions(null);
     String userInput = readString();
     if (userInput.equals("?") || userInput.equalsIgnoreCase("help")) displayCommandLineOptions();
     else if (userInput.equalsIgnoreCase("q")) System.exit(0);
     t = ToolName.getToolByIdentifier(userInput);
   } while (t == ToolName.NOT_SET);
   return t;
 }