org.crsh.text
Class Renderer

java.lang.Object
  extended by org.crsh.text.Renderer
Direct Known Subclasses:
LabelRenderer, Renderer.Composite, RowRenderer, TableRenderer, TextRenderer, TreeRenderer

public abstract class Renderer
extends Object

Something that can be rendered within a context.


Nested Class Summary
private static class Renderer.Composite
           
 
Constructor Summary
Renderer()
           
 
Method Summary
static Renderer compose(Iterable<Renderer> renderers)
           
abstract  int getActualWidth()
          Returns the element actual width.
abstract  int getMinWidth()
          Returns the element minimum width.
 void render(RenderAppendable out)
          Renders this object to the provided output.
abstract  LineReader renderer(int width)
          Create a renderer for the specified width or return null if the element does not provide any output.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Renderer

public Renderer()
Method Detail

compose

public static Renderer compose(Iterable<Renderer> renderers)

getActualWidth

public abstract int getActualWidth()
Returns the element actual width.

Returns:
the actual width

getMinWidth

public abstract int getMinWidth()
Returns the element minimum width.

Returns:
the minimum width

renderer

public abstract LineReader renderer(int width)
Create a renderer for the specified width or return null if the element does not provide any output.

Parameters:
width - the width the width
Returns:
the renderer

render

public final void render(RenderAppendable out)
Renders this object to the provided output.

Parameters:
out - the output


Copyright © 2012 eXo Platform SAS. All Rights Reserved.