org.objectweb.cjdbc.console.text
Class ColorPrinter

java.lang.Object
  extended byorg.objectweb.cjdbc.console.text.ColorPrinter

public class ColorPrinter
extends java.lang.Object

This class defines a ColorPrinter

Version:
1.0
Author:
Nicolas Modrzyk , Mathieu Peltier *

Field Summary
private static int ATTR_BRIGHT
           
private static int ATTR_DIM
           
private static java.lang.String END_COLOR
           
private static java.lang.String ERR_COLOR
           
static int ERROR
          Error color
private static int FG_BLACK
           
private static int FG_BLUE
           
private static int FG_GREEN
           
private static int FG_MAGENTA
           
private static int FG_RED
           
static int INFO
          Info color for commands
private static java.lang.String INFO_COLOR
           
private static java.lang.String PREFIX
           
static int PROMPT
          status color for commands
private static java.lang.String PROMPT_COLOR
           
private static char SEPARATOR
           
static int STATUS
          status color for commands
private static java.lang.String STATUS_COLOR
           
static int STD
          Standard color
private static java.lang.String STD_COLOR
           
private static java.lang.String SUFFIX
           
 
Constructor Summary
ColorPrinter()
           
 
Method Summary
static java.lang.String getColoredMessage(java.lang.String message, int color)
          Get colored message.
static void printMessage(java.lang.String message, java.io.PrintStream stream, int color)
          Print a message in color
static void printMessage(java.lang.String message, java.io.PrintStream stream, int color, boolean endline)
          Print a message in color
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ATTR_BRIGHT

private static final int ATTR_BRIGHT
See Also:
Constant Field Values

ATTR_DIM

private static final int ATTR_DIM
See Also:
Constant Field Values

FG_BLACK

private static final int FG_BLACK
See Also:
Constant Field Values

FG_RED

private static final int FG_RED
See Also:
Constant Field Values

FG_GREEN

private static final int FG_GREEN
See Also:
Constant Field Values

FG_BLUE

private static final int FG_BLUE
See Also:
Constant Field Values

FG_MAGENTA

private static final int FG_MAGENTA
See Also:
Constant Field Values

PREFIX

private static final java.lang.String PREFIX
See Also:
Constant Field Values

SUFFIX

private static final java.lang.String SUFFIX
See Also:
Constant Field Values

SEPARATOR

private static final char SEPARATOR
See Also:
Constant Field Values

END_COLOR

private static final java.lang.String END_COLOR
See Also:
Constant Field Values

STD_COLOR

private static final java.lang.String STD_COLOR
See Also:
Constant Field Values

ERR_COLOR

private static final java.lang.String ERR_COLOR
See Also:
Constant Field Values

INFO_COLOR

private static final java.lang.String INFO_COLOR
See Also:
Constant Field Values

STATUS_COLOR

private static final java.lang.String STATUS_COLOR
See Also:
Constant Field Values

PROMPT_COLOR

private static final java.lang.String PROMPT_COLOR
See Also:
Constant Field Values

STD

public static final int STD
Standard color

See Also:
Constant Field Values

ERROR

public static final int ERROR
Error color

See Also:
Constant Field Values

INFO

public static final int INFO
Info color for commands

See Also:
Constant Field Values

STATUS

public static final int STATUS
status color for commands

See Also:
Constant Field Values

PROMPT

public static final int PROMPT
status color for commands

See Also:
Constant Field Values
Constructor Detail

ColorPrinter

public ColorPrinter()
Method Detail

printMessage

public static final void printMessage(java.lang.String message,
                                      java.io.PrintStream stream,
                                      int color)
Print a message in color

Parameters:
message - Message to print
stream - Stream where to send the message
color - Color for the message

printMessage

public static final void printMessage(java.lang.String message,
                                      java.io.PrintStream stream,
                                      int color,
                                      boolean endline)
Print a message in color

Parameters:
message - Message to print
stream - Stream where to send the message
color - Color for the message
endline - true if a carriage return should be appended to the message

getColoredMessage

public static final java.lang.String getColoredMessage(java.lang.String message,
                                                       int color)
Get colored message.

Parameters:
message - message to print
color - color for the message
Returns:
Message with color tags


Copyright © 2002, 2005 - ObjectWeb Consortium - All Rights Reserved.