Package org.fusesource.jansi

Examples of org.fusesource.jansi.Ansi


        }

        cursorMove = 0;
        try {
            if (isAnsiEnabled()) {
                Ansi ansi = outputErrorLabel(userInputActive ? moveDownToSkipPrompt()  : ansi(), label).a(message).reset();

                if (message.endsWith(LINE_SEPARATOR)) {
                    out.print(ansi);
                }
                else {
View Full Code Here


        }

        private static String color(Ansi.Color color, String text, boolean bright) {
            StringBuffer sb = new StringBuffer();

            Ansi colorSequence = getColorAnsiSequence(color, bright);

            sb.append(colorSequence).append(text);

            if (bright) {
                sb.append(Ansi.ansi().a(Ansi.Attribute.INTENSITY_BOLD_OFF));
View Full Code Here

        public static String revertToDefaultColor() {
            return Ansi.ansi().fg(Ansi.Color.DEFAULT).toString();
        }

        private static Ansi getColorAnsiSequence(Ansi.Color color, boolean bright) {
            Ansi ansi = Ansi.ansi();
            if (bright) {
                ansi.a(Ansi.Attribute.INTENSITY_BOLD);
            }
            return ansi.fg(color);
        }
View Full Code Here

        } else {
            throw new IllegalStateException("The [" + stepResult+ "] step result is not supported by the reporter");
        }

        try {
            final Ansi stepReportOutput = ansi().fg(color).a("        " + stepOutput.getDescription()).reset().newline();
            writer.append(stepReportOutput.toString());
            if (stepResult instanceof StepResult.Error || stepResult instanceof StepResult.Failure) {
                for (final String issue : issues) {
                    final String issueTrackerUrlPattern = Configuration.getConfig("issueTrackerUrlPattern", "%s");
                    writer.append("Issue: " + String.format(issueTrackerUrlPattern, issue) + "\n");
                }
View Full Code Here

        } else {
            throw new IllegalStateException("The [" + stepResult+ "] step result is not supported by the reporter");
        }

        try {
            final Ansi stepReportOutput = ansi().fg(color).a("        " + stepOutput.getDescription()).reset().newline();
            writer.append(stepReportOutput.toString());
            if (stepResult instanceof StepResult.Error || stepResult instanceof StepResult.Failure) {
                for (final String issue : issues) {
                    final String issueTrackerUrlPattern = Configuration.getConfig("issueTrackerUrlPattern", "%s");
                    writer.append("Issue: " + String.format(issueTrackerUrlPattern, issue) + "\n");
                }
View Full Code Here

    }

    @Override
    protected void printClear() {
        AnsiConsole.systemInstall();
        Ansi ansi = Ansi.ansi();
        System.out.println( ansi.eraseScreen() );
        System.out.println( ansi.cursor(0, 0) );
        AnsiConsole.systemUninstall();
    }
View Full Code Here

   }

   @Override
   public void clearLine()
   {
      print(new Ansi().eraseLine(Ansi.Erase.ALL).toString());
   }
View Full Code Here

   }

   @Override
   public void cursorLeft(final int x)
   {
      print(new Ansi().cursorLeft(x).toString());
   }
View Full Code Here

      if (!colorEnabled)
      {
         return output;
      }

      Ansi ansi = new Ansi();

      switch (color)
      {
      case BLACK:
         ansi.fg(Ansi.Color.BLACK);
         break;
      case BLUE:
         ansi.fg(Ansi.Color.BLUE);
         break;
      case CYAN:
         ansi.fg(Ansi.Color.CYAN);
         break;
      case GREEN:
         ansi.fg(Ansi.Color.GREEN);
         break;
      case MAGENTA:
         ansi.fg(Ansi.Color.MAGENTA);
         break;
      case RED:
         ansi.fg(Ansi.Color.RED);
         break;
      case WHITE:
         ansi.fg(Ansi.Color.WHITE);
         break;
      case YELLOW:
         ansi.fg(Ansi.Color.YELLOW);
         break;
      case BOLD:
         ansi.a(Ansi.Attribute.INTENSITY_BOLD);
         break;
      case ITALIC:
         ansi.a(Ansi.Attribute.ITALIC);
         ansi.a(Ansi.Attribute.INTENSITY_FAINT);
         break;

      default:
         return output;
      }

      return ansi.render(output).reset().toString();
   }
View Full Code Here

   }

   @Override
   public void clear()
   {
      print(new Ansi().cursor(0, 0).eraseScreen().toString());
   }
View Full Code Here

TOP

Related Classes of org.fusesource.jansi.Ansi

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.