Package org.jboss.aesh.console

Examples of org.jboss.aesh.console.ConsoleOutput


            }
        };

        exampleConsole.addCompletion(completer);

        final ConsoleOutput line;
        final ConsoleCallback consoleCallback = new ConsoleCallback() {
            @Override
            public int readConsoleOutput(ConsoleOutput output) throws IOException{
                //To change body of implemented methods use File | Settings | File Templates.
View Full Code Here


            }
        };

        exampleConsole.addCompletion(completer);

        final ConsoleOutput line;
        final ConsoleCallback consoleCallback = new ConsoleCallback() {
            @Override
            public int readConsoleOutput(ConsoleOutput output) throws IOException{
                //To change body of implemented methods use File | Settings | File Templates.
View Full Code Here

            }
        };

        exampleConsole.addCompletion(completer);

        final ConsoleOutput line;
        final ConsoleCallback consoleCallback = new ConsoleCallback() {
            @Override
            public int readConsoleOutput(ConsoleOutput output) throws IOException{
                //To change body of implemented methods use File | Settings | File Templates.
View Full Code Here

            }
        };

        exampleConsole.addCompletion(completer);

        ConsoleOutput line;
        exampleConsole.pushToStdOut(ANSI.greenBackground());
        //while ((line = exampleConsole.read(prompt)) != null) {
        //while ((line = exampleConsole.read("[test@foo.bar]~> ")) != null) {
        while ((line = exampleConsole.read(prompt, null)) != null) {
            exampleConsole.pushToStdOut("======>\"" + line.getBuffer() + "\"\n");

            if (line.getBuffer().equalsIgnoreCase("quit") || line.getBuffer().equalsIgnoreCase("exit") ||
                    line.getBuffer().equalsIgnoreCase("reset")) {
                break;
            }
            if(line.getBuffer().equalsIgnoreCase("password")) {
                line = exampleConsole.read(new Prompt("password: "), Character.valueOf((char) 0));
                exampleConsole.pushToStdOut("password typed:" + line.getBuffer() + "\n");

            }
            //test stdErr
            if(line.getBuffer().startsWith("blah")) {
                exampleConsole.pushToStdErr("blah. command not found.\n");
            }
            if(line.getBuffer().equals("clear"))
                exampleConsole.clear();
            if(line.getBuffer().startsWith("man")) {
                //exampleConsole.attachProcess(test);
                test.attach(line);
            }
        }
        if(line != null && line.getBuffer().equals("reset")) {
            exampleConsole.stop();
            exampleConsole = new Console();

            while ((line = exampleConsole.read("> ")) != null) {
                exampleConsole.pushToStdOut("======>\"" + line + "\"\n");
                if (line.getBuffer().equalsIgnoreCase("quit") || line.getBuffer().equalsIgnoreCase("exit") ||
                        line.getBuffer().equalsIgnoreCase("reset")) {
                    break;
                }

            }
        }
View Full Code Here

            }
        };

        exampleConsole.addCompletion(completer);

        ConsoleOutput line;
        //console.pushToStdOut(ANSI.GREEN_TEXT());
        while ((line = exampleConsole.read("[test@foo.bar]~> ")) != null) {
            exampleConsole.pushToStdOut("======>\"" + line.getBuffer() + "\"\n");

            if (line.getBuffer().equalsIgnoreCase("quit") || line.getBuffer().equalsIgnoreCase("exit") ||
                    line.getBuffer().equalsIgnoreCase("reset")) {
                break;
            }
            if(line.getBuffer().equalsIgnoreCase("password")) {
                line = exampleConsole.read("password: ", Character.valueOf((char) 0));
                exampleConsole.pushToStdOut("password typed:" + line + "\n");

            }
            //test stdErr
            if(line.getBuffer().startsWith("blah")) {
                exampleConsole.pushToStdErr("blah. command not found.\n");
            }
            if(line.getBuffer().equals("clear"))
                exampleConsole.clear();
            if(line.getBuffer().startsWith("man")) {
                //exampleConsole.attachProcess(test);
                test.attach(line);
            }
        }
        if(line != null && line.getBuffer().equals("reset")) {
            exampleConsole.stop();
            exampleConsole = new Console();

            while ((line = exampleConsole.read("> ")) != null) {
                exampleConsole.pushToStdOut("======>\"" + line + "\"\n");
                if (line.getBuffer().equalsIgnoreCase("quit") || line.getBuffer().equalsIgnoreCase("exit") ||
                        line.getBuffer().equalsIgnoreCase("reset")) {
                    break;
                }

            }
        }
View Full Code Here

            }
        };

        exampleConsole.addCompletion(completer);

        ConsoleOutput line;
        //exampleConsole.pushToStdOut(ANSI.greenBackground());
        //while ((line = exampleConsole.read(prompt)) != null) {
        while ((line = exampleConsole.read("[test@foo.bar]~> ")) != null) {
            exampleConsole.pushToStdOut("======>\"" + line.getBuffer() + "\"\n");

            if (line.getBuffer().equalsIgnoreCase("quit") || line.getBuffer().equalsIgnoreCase("exit") ||
                    line.getBuffer().equalsIgnoreCase("reset")) {
                break;
            }
            if(line.getBuffer().equalsIgnoreCase("password")) {
                line = exampleConsole.read("password: ", Character.valueOf((char) 0));
                exampleConsole.pushToStdOut("password typed:" + line + "\n");

            }
            //test stdErr
            if(line.getBuffer().startsWith("blah")) {
                exampleConsole.pushToStdErr("blah. command not found.\n");
            }
            if(line.getBuffer().equals("clear"))
                exampleConsole.clear();
            if(line.getBuffer().startsWith("man")) {
                //exampleConsole.attachProcess(test);
                test.attach(line);
            }
        }
        if(line != null && line.getBuffer().equals("reset")) {
            exampleConsole.stop();
            exampleConsole = new Console();

            while ((line = exampleConsole.read("> ")) != null) {
                exampleConsole.pushToStdOut("======>\"" + line + "\"\n");
                if (line.getBuffer().equalsIgnoreCase("quit") || line.getBuffer().equalsIgnoreCase("exit") ||
                        line.getBuffer().equalsIgnoreCase("reset")) {
                    break;
                }

            }
        }
View Full Code Here

            }
        };

        exampleConsole.addCompletion(completer);

        ConsoleOutput line;
        //console.pushToStdOut(ANSI.GREEN_TEXT());
        while ((line = exampleConsole.read("[test@foo.bar]~> ")) != null) {
            exampleConsole.pushToStdOut("======>\"" + line.getBuffer() + "\"\n");

            if (line.getBuffer().equalsIgnoreCase("quit") || line.getBuffer().equalsIgnoreCase("exit") ||
                    line.getBuffer().equalsIgnoreCase("reset")) {
                break;
            }
            if(line.getBuffer().equalsIgnoreCase("password")) {
                line = exampleConsole.read("password: ", Character.valueOf((char) 0));
                exampleConsole.pushToStdOut("password typed:" + line + "\n");

            }
            //test stdErr
            if(line.getBuffer().startsWith("blah")) {
                exampleConsole.pushToStdErr("blah. command not found.\n");
            }
            if(line.getBuffer().equals("clear"))
                exampleConsole.clear();
            if(line.getBuffer().startsWith("man")) {
                //exampleConsole.attachProcess(test);
                test.attach(line);
            }
        }
        if(line != null && line.getBuffer().equals("reset")) {
            exampleConsole.stop();
            exampleConsole = new Console();

            while ((line = exampleConsole.read("> ")) != null) {
                exampleConsole.pushToStdOut("======>\"" + line + "\"\n");
                if (line.getBuffer().equalsIgnoreCase("quit") || line.getBuffer().equalsIgnoreCase("exit") ||
                        line.getBuffer().equalsIgnoreCase("reset")) {
                    break;
                }

            }
        }
View Full Code Here

            }
        };

        exampleConsole.addCompletion(completer);

        ConsoleOutput line;
        exampleConsole.pushToStdOut(ANSI.greenBackground());
        //while ((line = exampleConsole.read(prompt)) != null) {
        //while ((line = exampleConsole.read("[test@foo.bar]~> ")) != null) {
        while ((line = exampleConsole.read(prompt, null)) != null) {
            exampleConsole.pushToStdOut("======>\"" + line.getBuffer() + "\"\n");

            if (line.getBuffer().equalsIgnoreCase("quit") || line.getBuffer().equalsIgnoreCase("exit") ||
                    line.getBuffer().equalsIgnoreCase("reset")) {
                break;
            }
            if(line.getBuffer().equalsIgnoreCase("password")) {
                line = exampleConsole.read(new Prompt("password: "), Character.valueOf((char) 0));
                exampleConsole.pushToStdOut("password typed:" + line + "\n");

            }
            //test stdErr
            if(line.getBuffer().startsWith("blah")) {
                exampleConsole.pushToStdErr("blah. command not found.\n");
            }
            if(line.getBuffer().equals("clear"))
                exampleConsole.clear();
            if(line.getBuffer().startsWith("man")) {
                //exampleConsole.attachProcess(test);
                test.attach(line);
            }
        }
        if(line != null && line.getBuffer().equals("reset")) {
            exampleConsole.stop();
            exampleConsole = new Console();

            while ((line = exampleConsole.read("> ")) != null) {
                exampleConsole.pushToStdOut("======>\"" + line + "\"\n");
                if (line.getBuffer().equalsIgnoreCase("quit") || line.getBuffer().equalsIgnoreCase("exit") ||
                        line.getBuffer().equalsIgnoreCase("reset")) {
                    break;
                }

            }
        }
View Full Code Here

            }
        };

        exampleConsole.addCompletion(completer);

        ConsoleOutput line;
        exampleConsole.pushToStdOut(ANSI.greenBackground());
        //while ((line = exampleConsole.read(prompt)) != null) {
        //while ((line = exampleConsole.read("[test@foo.bar]~> ")) != null) {
        while ((line = exampleConsole.read(prompt, null)) != null) {
            exampleConsole.pushToStdOut("======>\"" + line.getBuffer() + "\"\n");

            if (line.getBuffer().equalsIgnoreCase("quit") || line.getBuffer().equalsIgnoreCase("exit") ||
                    line.getBuffer().equalsIgnoreCase("reset")) {
                break;
            }
            if(line.getBuffer().equalsIgnoreCase("password")) {
                line = exampleConsole.read(new Prompt("password: "), Character.valueOf((char) 0));
                exampleConsole.pushToStdOut("password typed:" + line + "\n");

            }
            //test stdErr
            if(line.getBuffer().startsWith("blah")) {
                exampleConsole.pushToStdErr("blah. command not found.\n");
            }
            if(line.getBuffer().equals("clear"))
                exampleConsole.clear();
            if(line.getBuffer().startsWith("man")) {
                //exampleConsole.attachProcess(test);
                test.attach(line);
            }
        }
        if(line != null && line.getBuffer().equals("reset")) {
            exampleConsole.stop();
            exampleConsole = new Console();

            while ((line = exampleConsole.read("> ")) != null) {
                exampleConsole.pushToStdOut("======>\"" + line + "\"\n");
                if (line.getBuffer().equalsIgnoreCase("quit") || line.getBuffer().equalsIgnoreCase("exit") ||
                        line.getBuffer().equalsIgnoreCase("reset")) {
                    break;
                }

            }
        }
View Full Code Here

TOP

Related Classes of org.jboss.aesh.console.ConsoleOutput

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.