@Override public void write(Style style, Appendable to) throws IOException { style.writeAnsiTo(to); } @Override
@Override public void write(Style d) throws IOException { if (ansi) { d.writeAnsiTo(writer); } }
public CharSequence toAnsiSequence() { StringBuilder sb = new StringBuilder(); try { writeAnsiTo(sb); } catch (IOException e) { // Should not happen throw new UndeclaredThrowableException(e); } return sb.toString(); }
@Override public void write(Style style, Appendable to) throws IOException { style.writeAnsiTo(to); } @Override
@Override public void write(Style d) throws IOException { if (ansi) { d.writeAnsiTo(writer); } }
@Override public void write(Style d) throws IOException { if (ansi) { d.writeAnsiTo(writer); } }
@Override public void write(Style style, Appendable to) throws IOException { style.writeAnsiTo(to); } @Override
public void write(Style d) throws IOException { d.writeAnsiTo(writer); }
public CharSequence toAnsiSequence() { StringBuilder sb = new StringBuilder(); try { writeAnsiTo(sb); } catch (IOException e) { // Should not happen throw new UndeclaredThrowableException(e); } return sb.toString(); }
public CharSequence toAnsiSequence() { StringBuilder sb = new StringBuilder(); try { writeAnsiTo(sb); } catch (IOException e) { // Should not happen throw new UndeclaredThrowableException(e); } return sb.toString(); }
public CharSequence toAnsiSequence() { StringBuilder sb = new StringBuilder(); try { writeAnsiTo(sb); } catch (IOException e) { // Should not happen throw new UndeclaredThrowableException(e); } return sb.toString(); }
@Deprecated public void writeAnsiTo(Appendable appendable) throws IOException { Iterator<Chunk> iterator = iterator(); while (iterator.hasNext()) { Chunk chunk = iterator.next(); if (chunk instanceof Text) { Text text = (Text)chunk; if (text.buffer.length() > 0) { appendable.append(text.buffer); } } else if (chunk instanceof Style) { ((Style)chunk).writeAnsiTo(appendable); } } }
public void provide(Chunk element) throws IOException { if (element instanceof Text) { Text textChunk = (Text)element; processor.writer.append(textChunk.getText()); } else if (element instanceof Style) { try { ((Style)element).writeAnsiTo(processor.writer); } catch (IOException ignore) { } } else { // Clear screen processor.writer.print("\033[2J"); processor.writer.print("\033[1;1H"); } }