Package net.sourceforge.javautil.ui.command

Examples of net.sourceforge.javautil.ui.command.UICommand


   * @param commandInfo The command line array
   * @return The results of the command, null on errors
   */
  public Object execute (String... commandInfo) {
    try {
      UICommand command = set.createCommand(commandInfo[0]);
     
      if (command != null) {
        CommandLineArgumentsStandard cla = null;
        if (commandInfo.length > 1) {
          if (command instanceof CommandLineArgumentParser) {
            cla = ((CommandLineArgumentParser)command).createArguments(StringUtil.join(CollectionUtil.shift(commandInfo), ' '));
          } else {
            cla = new CommandLineArgumentsStandard(CollectionUtil.shift(commandInfo));
          }
        }
        return command.execute(context, cla);
      } else {
        if ("exit".equalsIgnoreCase(commandInfo[0]) || "quit".equalsIgnoreCase(commandInfo[0])) {
          running = false;
          return new CommandLineExitException(this);
        } else
View Full Code Here

TOP

Related Classes of net.sourceforge.javautil.ui.command.UICommand

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.