Examples of CommandInfo


Examples of org.impalaframework.command.framework.CommandInfo

        foundClasses = handler.foundFiles;
        return true;
    }

    public CommandDefinition getCommandDefinition() {
        CommandInfo commandInfo = new CommandInfo("class", "Type (class or interface)", "Please specify class search text",
                null, null, true, false, false, false) {

            @Override
            public String validate(String input) {
                String superValidate = super.validate(input);
View Full Code Here

Examples of org.impalaframework.command.framework.CommandInfo

    public void addTestListener(TestCommandListener listener) {
        this.listeners.add(listener);
    }
   
    public CommandDefinition getCommandDefinition() {
        CommandInfo commandInfo = new CommandInfo("commandText", "Command text", "Please enter your command text",
                null, null, false, false, false, false);

        CommandDefinition commandDefinititon = new CommandDefinition();
        commandDefinititon.add(commandInfo);
        return commandDefinititon; 
View Full Code Here

Examples of org.impalaframework.command.framework.CommandInfo

    public CommandDefinition getCommandDefinition() {

        // note that globalOverrides is true, so that the user will not be
        // prompted for the module name if it already there
        CommandInfo info = new CommandInfo(DIRECTORY_NAME, "Directory name",
                "Please enter directory to use as current working directory.", null, null, false, false, true, false);

        CommandDefinition definition = new CommandDefinition("Changes working directory");
        definition.add(info);
        return definition;
View Full Code Here

Examples of org.impalaframework.command.framework.CommandInfo

    public void addTestListener(TestCommandListener listener) {
        this.listeners.add(listener);
    }
   
    public CommandDefinition getCommandDefinition() {
        CommandInfo commandInfo = new CommandInfo("commandText", "Command text", "Please enter your command text",
                null, null, false, false, false, false);

        CommandDefinition commandDefinititon = new CommandDefinition();
        commandDefinititon.add(commandInfo);
        return commandDefinititon; 
View Full Code Here

Examples of org.impalaframework.command.framework.CommandInfo

        for (int i = 0; i < extraLines.length; i++) {
            extraLines[i] = (i + 1) + " " + alternatives[i];
        }

        CommandInfo ci1 = new CommandInfo("selection", "Selected value", "More than one alternative was found.\nPlease choose option by entering digit corresponding with selection",
                null,
                extraLines, true, false, false, false) {
            @Override
            public String validate(String input) {
                int selection = -1;
View Full Code Here

Examples of org.impalaframework.command.framework.CommandInfo

  public CommandDefinition getCommandDefinition() {

    // note that globalOverrides is true, so that the user will not be
    // prompted for the module name if it already there
    CommandInfo info = new CommandInfo(DIRECTORY_NAME, "Directory name",
        "Please enter directory to use as current working directory.", null, null, false, false, true, false);

    CommandDefinition definition = new CommandDefinition("Changes working directory");
    definition.add(info);
    return definition;
View Full Code Here

Examples of org.impalaframework.command.framework.CommandInfo

  public void addTestListener(TestCommandListener listener) {
    this.listeners.add(listener);
  }
 
  public CommandDefinition getCommandDefinition() {
    CommandInfo commandInfo = new CommandInfo("commandText", "Command text", "Please enter your command text",
        null, null, false, false, false, false);

    CommandDefinition commandDefinititon = new CommandDefinition();
    commandDefinititon.add(commandInfo);
    return commandDefinititon; 
View Full Code Here

Examples of org.impalaframework.command.framework.CommandInfo

    for (int i = 0; i < extraLines.length; i++) {
      extraLines[i] = (i + 1) + " " + alternatives[i];
    }

    CommandInfo ci1 = new CommandInfo("selection", "Selected value", "More than one alternative was found.\nPlease choose option by entering digit corresponding with selection",
        null,
        extraLines, true, false, false, false) {
      @Override
      public String validate(String input) {
        int selection = -1;
View Full Code Here

Examples of org.impalaframework.command.framework.CommandInfo

    foundClasses = handler.foundFiles;
    return true;
  }

  public CommandDefinition getCommandDefinition() {
    CommandInfo commandInfo = new CommandInfo("class", "Type (class or interface)", "Please specify class search text",
        null, null, true, false, false, false) {

      @Override
      public String validate(String input) {
        String superValidate = super.validate(input);
View Full Code Here

Examples of org.jnode.shell.CommandInfo

                new OptionSyntax("fileArg", 'f'), new OptionSyntax("flagArg1", 'x'),
                new OptionSyntax("flagArg2", 'y'), new OptionSyntax("flagArg3", 'z'),
                new OptionSyntax("flagArg4", "boring")));

        CommandLine cl;
        CommandInfo cmdInfo;
        Command cmd;

        cl = new CommandLine(new Token("cmd"), new Token[] {}, null);
        cmdInfo = cl.parseCommandLine(shell);
        cmd = cmdInfo.createCommandInstance();
        Assert.assertEquals(0, cmd.getArgumentBundle().getArgument("fileArg").getValues().length);
        Assert.assertEquals(0, cmd.getArgumentBundle().getArgument("intArg").getValues().length);

        cl =
                new CommandLine(new Token("cmd"), new Token[] {new Token("-f"), new Token("F1")},
                        null);
        cmdInfo = cl.parseCommandLine(shell);
        cmd = cmdInfo.createCommandInstance();
        Assert.assertEquals(1, cmd.getArgumentBundle().getArgument("fileArg").getValues().length);
        Assert.assertEquals(0, cmd.getArgumentBundle().getArgument("intArg").getValues().length);
        Assert.assertEquals("F1", cmd.getArgumentBundle().getArgument("fileArg").getValue()
                .toString());

        cl =
                new CommandLine(new Token("cmd"), new Token[] {new Token("-f"), new Token("F1"),
                    new Token("-x"), new Token("-yz")}, null);
        cmdInfo = cl.parseCommandLine(shell);
        cmd = cmdInfo.createCommandInstance();
        Assert.assertEquals(1, cmd.getArgumentBundle().getArgument("fileArg").getValues().length);
        Assert.assertEquals(0, cmd.getArgumentBundle().getArgument("intArg").getValues().length);
        Assert.assertEquals(1, cmd.getArgumentBundle().getArgument("flagArg1").getValues().length);
        Assert.assertEquals(1, cmd.getArgumentBundle().getArgument("flagArg2").getValues().length);
        Assert.assertEquals(1, cmd.getArgumentBundle().getArgument("flagArg3").getValues().length);

        cl = new CommandLine(new Token("cmd"), new Token[] {new Token("-yz")}, null);
        cmdInfo = cl.parseCommandLine(shell);
        cmd = cmdInfo.createCommandInstance();
        Assert.assertEquals(0, cmd.getArgumentBundle().getArgument("fileArg").getValues().length);
        Assert.assertEquals(0, cmd.getArgumentBundle().getArgument("intArg").getValues().length);
        Assert.assertEquals(0, cmd.getArgumentBundle().getArgument("flagArg1").getValues().length);
        Assert.assertEquals(1, cmd.getArgumentBundle().getArgument("flagArg2").getValues().length);
        Assert.assertEquals(1, cmd.getArgumentBundle().getArgument("flagArg3").getValues().length);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.