- /**
- * Create a SGR parameter sequence for enabling boldface.
- *
- * @param on if true, turn on bold
- * @return the string to emit to an ANSI / ECMA-style terminal,
- * e.g. "\033[1m"
- */
- private String bold(final boolean on) {
- return bold(on, true);
- }
-
- /**
- * Create a SGR parameter sequence for enabling boldface.
- *
- * @param on if true, turn on bold
- * @param header if true, make the full header, otherwise just emit the
- * bare parameter e.g. "1;"
- * @return the string to emit to an ANSI / ECMA-style terminal,
- * e.g. "\033[1m"
- */
- private String bold(final boolean on, final boolean header) {
- if (header) {
- if (on) {
- return "\033[1m";
- }
- return "\033[22m";
- }
- if (on) {
- return "1;";
- }
- return "22;";
- }
-
- /**
- * Create a SGR parameter sequence for enabling blinking text.
- *
- * @param on if true, turn on blink
- * @return the string to emit to an ANSI / ECMA-style terminal,
- * e.g. "\033[5m"
- */
- private String blink(final boolean on) {
- return blink(on, true);
- }
-
- /**
- * Create a SGR parameter sequence for enabling blinking text.
- *
- * @param on if true, turn on blink
- * @param header if true, make the full header, otherwise just emit the
- * bare parameter e.g. "5;"
- * @return the string to emit to an ANSI / ECMA-style terminal,
- * e.g. "\033[5m"
- */
- private String blink(final boolean on, final boolean header) {
- if (header) {
- if (on) {
- return "\033[5m";
- }
- return "\033[25m";
- }
- if (on) {
- return "5;";
- }
- return "25;";
- }
-
- /**
- * Create a SGR parameter sequence for enabling underline / underscored
- * text.
- *
- * @param on if true, turn on underline
- * @return the string to emit to an ANSI / ECMA-style terminal,
- * e.g. "\033[4m"
- */
- private String underline(final boolean on) {
- if (on) {
- return "\033[4m";
- }
- return "\033[24m";
- }
-