SHL-119 Remove unused bright color constants

This commit is contained in:
mpollack
2014-01-30 18:06:53 -05:00
parent 2cd832858d
commit 7123eae85a
3 changed files with 4 additions and 40 deletions

View File

@@ -43,13 +43,6 @@ import org.springframework.util.Assert;
*/
public class JLineLogHandler extends Handler {
// Constants
private static final boolean ROO_BRIGHT_COLORS = Boolean.getBoolean("roo.bright");
private static final boolean SHELL_BRIGHT_COLORS = Boolean.getBoolean("spring.shell.bright");
private static final boolean BRIGHT_COLORS = ROO_BRIGHT_COLORS || SHELL_BRIGHT_COLORS;
// Fields
private ConsoleReader reader;
@@ -227,31 +220,4 @@ public class JLineLogHandler extends Handler {
return sb.toString();
}
/**
* Makes text brighter if requested through system property 'roo.bright' and works around issue on Windows in using
* reverse() in combination with the Jansi lib, which leaves its 'negative' flag set unless reset explicitly.
*
* @return new patched ANSIBuffer
*/
// public static ANSIBuffer getANSIBuffer() {
// final char esc = (char) 27;
// return new ANSIBuffer() {
// @Override
// public ANSIBuffer reverse(final String str) {
// if (OsUtils.isWindows()) {
// return super.reverse(str).append(ANSICodes.attrib(esc));
// }
// return super.reverse(str);
// };
//
// @Override
// public ANSIBuffer attrib(final String str, final int code) {
// if (BRIGHT_COLORS && 30 <= code && code <= 37) {
// // This is a color code: add a 'bright' code
// return append(esc + "[" + code + ";1m").append(str).append(ANSICodes.attrib(0));
// }
// return super.attrib(str, code);
// }
// };
// }
}

View File

@@ -117,7 +117,7 @@ public abstract class JLineShell extends AbstractShell implements Shell, Runnabl
removeHandlers(mainLogger);
mainLogger.addHandler(handler);
reader.addCompleter(new JLineCompletorAdapter(getParser()));
reader.addCompleter(new ParserCompleter(getParser()));
reader.setBellEnabled(true);
if (Boolean.getBoolean("jline.nobell")) {

View File

@@ -23,17 +23,17 @@ import jline.console.completer.Completer;
import org.springframework.util.Assert;
/**
* An implementation of JLine's {@link Completor} interface that delegates to a {@link Parser}.
* An implementation of JLine's {@link Completer} interface that delegates to a {@link Parser}.
*
* @author Ben Alex
* @since 1.0
*/
public class JLineCompletorAdapter implements Completer {
public class ParserCompleter implements Completer {
// Fields
private final Parser parser;
public JLineCompletorAdapter(final Parser parser) {
public ParserCompleter(final Parser parser) {
Assert.notNull(parser, "Parser required");
this.parser = parser;
}
@@ -46,8 +46,6 @@ public class JLineCompletorAdapter implements Completer {
List<Completion> completions = new ArrayList<Completion>();
result = parser.completeAdvanced(buffer, cursor, completions);
for (Completion completion : completions) {
// candidates.add(new jline.Completion(completion.getValue(), completion.getFormattedValue(), completion
// .getHeading()));
candidates.add(completion.getValue());
}
}