Tabnine Logo
org.crsh.text
Code IndexAdd Tabnine to your IDE (free)

How to use org.crsh.text

Best Java code snippets using org.crsh.text (Showing top 20 results out of 315)

origin: crashub/crash

/**
 * Compute the current merged style.
 *
 * @return the merged style
 */
private Style.Composite getMerged() {
 Style.Composite merged = Style.style();
 for (Style s : stack) {
  merged = (Style.Composite)merged.merge(s);
 }
 return merged;
}
origin: crashub/crash

@Override
public Screenable append(CharSequence csq, int start, int end) throws IOException {
 if (start < end) {
  adapter.send();
  buffer.append(csq, start, end);
 }
 return this;
}
origin: crashub/crash

public void render(RenderAppendable to) {
 LineRenderer renderer = renderer();
 // For now height - 1 because of the char that goes to the line in some impl
 LineReader reader = renderer.reader(to.getWidth(), to.getHeight() - 1);
 if (reader != null) {
  while (reader.hasLine()) {
   reader.renderLine(to);
   to.append('\n');
  }
 }
}
origin: crashub/crash

public final void println(Object obj, Color foreground, Color background) {
 print(obj, Style.style(foreground, background));
 println();
}
origin: crashub/crash

/**
 * Renders this object to the provided output.
 *
 * @param out the output
 */
public final void render(RenderAppendable out) {
 LineReader renderer = reader(out.getWidth());
 if (renderer != null) {
  while (renderer.hasLine()) {
   renderer.renderLine(out);
   out.append('\n');
  }
 }
}
origin: crashub/crash

public void testNextRow1() throws Exception {
 TestBuffer tmp = new TestBuffer(2, 2);
 VirtualScreen buffer = new VirtualScreen(tmp);
 buffer.append("abcd");
 assertTrue(buffer.isRefresh());
 assertTrue(buffer.paint().isPainted());
 assertFalse(buffer.nextRow());
 assertTrue(buffer.isPainted());
}
origin: crashub/crash

private void assertBuffer(int width, int height, String actual, String... test) throws IOException {
 TestBuffer tmp = new TestBuffer(width, height);
 VirtualScreen buffer = new VirtualScreen(tmp);
 for (String a : test) {
  buffer.append(a);
  buffer.paint();
  assertTrue(buffer.isPainting() || buffer.isPainted());
 }
 assertEquals(actual, tmp.toString());
}
origin: crashub/crash

 public void assertPainted(String s1, String s2) throws Exception {
  TestBuffer tmp = new TestBuffer(2, 2);
  VirtualScreen buffer = new VirtualScreen(tmp);
  buffer.append(s1);
  assertTrue(buffer.isRefresh());
  assertTrue(buffer.paint().isPainting());
  buffer.append(s2);
  assertTrue(buffer.isPainting());
  assertTrue(buffer.paint().isPainted());
 }
}
origin: crashub/crash

public void testBlend() throws IOException {
 assertReader(new ScreenBuffer().append(Color.red.fg(),"foo", Color.red.fg(), "bar"), Color.red.fg(), "foo", "bar");
}
origin: crashub/crash

public void testNextRow0() throws Exception {
 TestBuffer tmp = new TestBuffer(2, 2);
 VirtualScreen buffer = new VirtualScreen(tmp);
 assertTrue(buffer.isRefresh());
 assertTrue(buffer.paint().isPainting());
 assertFalse(buffer.nextRow());
 assertTrue(buffer.isPainting());
}
origin: crashub/crash

public void testSimple() {
 assertReader(new ScreenBuffer().append("a"), "a");
 assertReader(new ScreenBuffer().append(RED, "a"), RED, "a");
}
origin: crashub/crash

 public Style.Composite blink(Boolean value) {
  return Style.style(this).blink(value);
 }
}
origin: crashub/crash

public void flush() throws IOException {
 send();
 out.flush();
}
origin: crashub/crash

public void testRefresh() throws Exception {
 TestBuffer tmp = new TestBuffer(2, 2);
 VirtualScreen buffer = new VirtualScreen(tmp);
 tmp.width = 3;
 assertFalse(buffer.update());
}
origin: crashub/crash

public final void print(Object obj, Decoration decoration, Color foreground) {
 print(obj, Style.style(decoration, foreground));
 println();
}
origin: crashub/crash

public void testConcatenation() {
 assertReader(new ScreenBuffer().append(RED).append(new ScreenBuffer().append("a")), RED, "a");
 assertReader(new ScreenBuffer().append(new ScreenBuffer().append(RED)).append("a"), RED, "a");
}
origin: crashub/crash

@Override
public Screenable append(char c) throws IOException {
 adapter.send();
 buffer.append(c);
 return this;
}
origin: crashub/crash

public final void println(Object obj, Decoration decoration) {
 print(obj, Style.style(decoration));
 println();
}
origin: crashub/crash

public final void print(Object obj, Decoration decoration, Color foreground, Color background) {
 print(obj, Style.style(decoration, foreground, background));
 println();
}
origin: crashub/crash

public final void println(Object obj, Decoration decoration, Color foreground, Color background) {
 print(obj, Style.style(decoration, foreground, background));
 println();
}
org.crsh.text

Most used classes

  • Style$Composite
  • Style
    A control for the text stylistric attributes:background colorforeground color underlineboldblink A s
  • RenderPrintWriter
  • Layout
    The layout computes the lengths of a list of contiguous cells.
  • Color
    A color representing the available ansi colors as well as an additional color #def that symbolize th
  • LineReader,
  • RenderAppendable,
  • Element,
  • LabelElement,
  • Layout$Weighted,
  • RowElement,
  • TableElement,
  • TreeElement,
  • UIBuilder,
  • LineRenderer,
  • RenderWriter,
  • Renderer,
  • ScreenBuffer,
  • VirtualScreen
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now