Package org.jboss.aesh.terminal

Examples of org.jboss.aesh.terminal.TerminalString


   public static String colorizeResource(FileResource<?> resource)
   {
      String name = resource.getName();
      if (resource.isDirectory())
      {
         name = new TerminalString(name, new TerminalColor(Color.BLUE, Color.DEFAULT)).toString();
      }
      else if (resource.isExecutable())
      {
         name = new TerminalString(name, new TerminalColor(Color.GREEN, Color.DEFAULT)).toString();
      }
      return name;
   }
View Full Code Here


   public static String colorizeResource(FileResource<?> resource)
   {
      String name = resource.getName();
      if (resource.isDirectory())
      {
         name = new TerminalString(name, Color.DEFAULT_BG, Color.BLUE_TEXT, CharacterType.PLAIN).toString();
      }
      else if (resource.isExecutable())
      {
         name = new TerminalString(name, Color.DEFAULT_BG, Color.GREEN_TEXT, CharacterType.PLAIN).toString();
      }
      return name;
   }
View Full Code Here

*/
public abstract class ShellMessages
{
   public static void success(final AeshPrintStream writer, final String message)
   {
      writer.print(new TerminalString("***SUCCESS*** ", Color.DEFAULT_BG, Color.GREEN_TEXT, CharacterType.PLAIN));
      writer.println(message);
   }
View Full Code Here

      writer.println(message);
   }

   public static void error(final AeshPrintStream writer, final String message)
   {
      writer.print(new TerminalString("***ERROR*** ", Color.DEFAULT_BG, Color.RED_TEXT, CharacterType.PLAIN));
      writer.println(message);
   }
View Full Code Here

      writer.println(message);
   }

   public static void info(final AeshPrintStream writer, final String message)
   {
      writer.print(new TerminalString("***INFO*** ", Color.DEFAULT_BG, Color.BLUE_TEXT, CharacterType.PLAIN));
      writer.println(message);
   }
View Full Code Here

      writer.println(message);
   }

   public static void warn(final AeshPrintStream writer, final String message)
   {
      writer.print(new TerminalString("***WARNING*** ", Color.DEFAULT_BG, Color.YELLOW_TEXT, CharacterType.PLAIN));
      writer.println(message);
   }
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

            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

                }
            }
            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

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.