Package org.jboss.aesh.terminal

Examples of org.jboss.aesh.terminal.TerminalString


            return null;
    }

    public TerminalString getRenderedNameWithDashes() {
        if(renderer == null)
            return new TerminalString("--"+name, true);
        else
            return new TerminalString("--"+name, renderer.getColor(), renderer.getTextType());
    }
View Full Code Here


            output.out().println("Did you mean one of these?");
         }
         for (String plugin : similarCommands)
         {
            output.out().println(
                     new TerminalString("\t" + plugin,
                              new TerminalColor(Color.DEFAULT, Color.DEFAULT, Intensity.BRIGHT)));
         }
      }

   }
View Full Code Here

      {
         String name = manager.getCommandName(context.getUIContext(), controller.getCommand());
         UICommandMetadata metadata = controller.getMetadata();
         display.add(metadata.getCategory()
                  + " > "
                  + new TerminalString(name, new TerminalColor(controller.isEnabled() ? Color.CYAN : Color.RED,
                           Color.DEFAULT)).toString() + " - " + metadata.getDescription());
      }

      UIOutput output = context.getUIContext().getProvider().getOutput();
      PrintStream out = output.out();
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() || startWithWindowsDrive()) {
            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

            if(!possibleCompletions.get(0).isIgnoreStartsWith())
                startsWith = Parser.findStartsWithOperation(possibleCompletions);

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

            return null;
    }

    public TerminalString getRenderedNameWithDashes() {
        if(renderer == null)
            return new TerminalString("--"+name, true);
        else
            return new TerminalString("--"+name, renderer.getColor(), renderer.getTextType());
    }
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

*/
public abstract class ShellMessages
{
   public static void success(final PrintStream writer, final String message)
   {
      writer.print(new TerminalString("***SUCCESS*** ", new TerminalColor(Color.GREEN, Color.DEFAULT)));
      writer.println(message);
   }
View Full Code Here

      writer.println(message);
   }

   public static void error(final PrintStream writer, final String message)
   {
      writer.print(new TerminalString("***ERROR*** ", new TerminalColor(Color.RED, Color.DEFAULT)));
      writer.println(message);
   }
View Full Code Here

      writer.println(message);
   }

   public static void info(final PrintStream writer, final String message)
   {
      writer.print(new TerminalString("***INFO*** ", new TerminalColor(Color.BLUE, Color.DEFAULT)));
      writer.println(message);
   }
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.