Package org.jboss.aesh.terminal

Examples of org.jboss.aesh.terminal.TerminalString


    }

    @Override
    public void setCompleterValues(List<String> completerValues) {
        for(String s : completerValues)
            this.completerValues.add(new TerminalString(s, true));
    }
View Full Code Here


    }

    @Override
    public void addAllCompleterValues(List<String> completerValues) {
        for(String s : completerValues)
            this.completerValues.add(new TerminalString(s, true));
    }
View Full Code Here

            this.completerValues.add(new TerminalString(s, true));
    }

    @Override
    public void addCompleterValue(String value) {
        this.completerValues.add(new TerminalString(value, true));
    }
View Full Code Here

                }
            }
            else if(isCwdAndTokenAFile()) {
                listPossibleDirectories(completion);
                if(completion.getCompletionCandidates().size() == 1) {
                    completion.getCompletionCandidates().set(0, new TerminalString("", true));
                    //append when we have a file
                    completion.doAppendSeparator(true);
                }
                else if(completion.getCompletionCandidates().size() == 0) {
                    completion.addCompletionCandidate("");
                    //append when we have a file
                    completion.doAppendSeparator(true);
                }
            }
            //not a directory or file, list what we find
            else {
               listPossibleDirectories(completion);
            }
        }
        else if(startWithSlash()) {
            if(isTokenADirectory()) {
                if(tokenEndsWithSlash()) {
                    completion.addCompletionCandidates(
                            listDirectory(new File(token), null));
                }
                else
                    completion.addCompletionCandidate(Config.getPathSeparator());
            }
            else if(isTokenAFile()) {
                listPossibleDirectories(completion);
                if(completion.getCompletionCandidates().size() == 1) {
                    completion.getCompletionCandidates().set(0, new TerminalString("", true));
                    //completion.addCompletionCandidate("");
                    //append when we have a file
                    completion.doAppendSeparator(true);
                }
            }
View Full Code Here

            logger.info("Starts with: "+startsWith);

            if(startsWith.length() > 0) {
                if(startsWith.contains(" "))
                    displayCompletion(new TerminalString(Parser.switchSpacesToEscapedSpacesInWord(startsWith), true),
                            false, possibleCompletions.get(0).getSeparator());
                else
                    displayCompletion(new TerminalString(startsWith, true), false, possibleCompletions.get(0).getSeparator());
            }
                // display all
                // check size
            else {
                List<TerminalString> completions = new ArrayList<>();
View Full Code Here

        AeshConsole aeshConsole = new AeshConsoleBuilder()
                .commandRegistry(registry)
                .manProvider(new ManProviderExample())
                .settings(settings)
                .validatorInvocationProvider(new ExampleValidatorInvocationProvider())
                .prompt(new Prompt(new TerminalString("[aesh@rules]$ ",
                        new TerminalColor(Color.GREEN, Color.DEFAULT, Color.Intensity.BRIGHT))))
                .create();

        aeshConsole.start();
    }
View Full Code Here

        //show how we can change the prompt async
        try {
            Thread.sleep(4000);
            exampleConsole.setPrompt(new Prompt(
                    new TerminalString("[FOO]» ", new TerminalColor( Color.RED, Color.DEFAULT), new TerminalTextStyle(CharacterType.BOLD))));
        } catch (InterruptedException e) {
            e.printStackTrace();
        }

    }
View Full Code Here

    }

    @Override
    public void setCompleterValues(List<String> completerValues) {
        for(String s : completerValues)
            this.completerValues.add(new TerminalString(s, true));
    }
View Full Code Here

    }

    @Override
    public void addAllCompleterValues(List<String> completerValues) {
        for(String s : completerValues)
            this.completerValues.add(new TerminalString(s, true));
    }
View Full Code Here

            this.completerValues.add(new TerminalString(s, true));
    }

    @Override
    public void addCompleterValue(String value) {
        this.completerValues.add(new TerminalString(value, true));
    }
View Full Code Here

TOP

Related Classes of org.jboss.aesh.terminal.TerminalString

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.