Package org.jboss.aesh.console.command

Examples of org.jboss.aesh.console.command.CommandOperation


                    parsing = false;
                }

                //if we have a command hooked in the input goes there
                if(command != null)
                    command.processOperation(new CommandOperation(input));
                //the input is parsed by æsh
                else {
                    Operation operation = editMode.parseInput(inc, buffer.getLine());
                    if(inc != Key.UNKNOWN)
                        operation.setInput(inc.getKeyValues());
View Full Code Here


            shell.out().print(Config.getLineSeparator());
    }

    private void readFromStdin(CommandInvocation commandInvocation) {
        try {
            CommandOperation input = commandInvocation.getInput();
            StringBuilder builder = new StringBuilder();
            while(input.getInputKey() != Key.CTRL_C) {
                if(input.getInputKey() == Key.ENTER) {
                    commandInvocation.getShell().out().println();
                    displayLine(builder.toString(), commandInvocation.getShell());
                    builder = new StringBuilder();
                }
                else {
                    builder.append(input.getInputKey().getAsChar());
                    commandInvocation.getShell().out().print(input.getInputKey().getAsChar());
                }

                input = commandInvocation.getInput();
            }
View Full Code Here

        @Override
        public CommandResult execute(CommandInvocation commandInvocation) throws IOException {
            this.shell = commandInvocation.getShell();
            if(bar) {
                shell.out().print("are you sure you want bar? (y/n) ");
                CommandOperation operation = null;
                try {
                    operation = commandInvocation.getInput();
                }
                catch (InterruptedException e) {
                    return CommandResult.FAILURE;
View Full Code Here

                    exampleConsole.clear();
                else if(output.getBuffer().startsWith("man")) {
                    //exampleConsole.attachProcess(test);
                    //man = new ExampleConsoleCommand(exampleConsole, output);
                    exampleConsole.getShell().out().println("trying to wait for input");
                    CommandOperation co = null;
                    try {
                        co = getInput();
                    }
                    catch (InterruptedException e) {
                        e.printStackTrace();
                        return -1;
                    }
                    exampleConsole.getShell().out().println("got: " + co.toString());
                    //exampleConsole.attachProcess(test);
                }
                else if(output.getBuffer().startsWith("login")) {
                    exampleConsole.setConsoleCallback(passwordCallback);
                    exampleConsole.setPrompt(new Prompt("Username: "));
View Full Code Here

                }
                else {
                    parsing = false;
                }

                inputQueue.put(new CommandOperation(inc, input, position));
            }
            return true;
        }
        catch (IOException ioe) {
            if(settings.isLogging())
View Full Code Here

            shell.out().print(Config.getLineSeparator());
    }

    private void readFromStdin(CommandInvocation commandInvocation) {
        try {
            CommandOperation input = commandInvocation.getInput();
            StringBuilder builder = new StringBuilder();
            while(input.getInputKey() != Key.CTRL_C) {
                if(input.getInputKey() == Key.ENTER) {
                    commandInvocation.getShell().out().println();
                    displayLine(builder.toString(), commandInvocation.getShell());
                    builder = new StringBuilder();
                }
                else {
                    builder.append(input.getInputKey().getAsChar());
                    commandInvocation.getShell().out().print(input.getInputKey().getAsChar());
                }

                input = commandInvocation.getInput();
            }
View Full Code Here

                }
                else {
                    parsing = false;
                }

                inputQueue.put(new CommandOperation(inc, input, position));
            }
            return true;
        }
        catch (IOException ioe) {
            ioe.printStackTrace();
View Full Code Here

TOP

Related Classes of org.jboss.aesh.console.command.CommandOperation

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.