org.crsh.text
Class Style

java.lang.Object
  extended by org.crsh.text.Style
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
Style.Composite

public abstract class Style
extends Object
implements Serializable

A control for the text stylistric attributes:

  • background color
  • foreground color
  • underline
  • bold
  • blink
  • A style is either a composite style or the reset style. Styles can be composed together to form a new style style.merge(other).

    See Also:
    Serialized Form

    Nested Class Summary
    static class Style.Composite
               
     
    Field Summary
    private static Style.Composite[][][][][] ALL
              [bold][underline][blink][foreground][background].
    private static Boolean[] BOOLEANS
              .
    private static Color[] COLORS
              .
    static Style reset
               
     
    Constructor Summary
    Style()
               
     
    Method Summary
    abstract  Style merge(Style s)
               
    static Style.Composite style()
              Create a new blank style.
    static Style.Composite style(Boolean bold, Boolean underline, Boolean blink, Color foreground, Color background)
               
    static Style.Composite style(Color foreground)
               
    static Style.Composite style(Color foreground, Color background)
               
    static Style.Composite style(Decoration decoration)
               
    static Style.Composite style(Decoration decoration, Color foreground)
               
    static Style.Composite style(Decoration decoration, Color foreground, Color background)
               
     CharSequence toAnsiSequence()
               
    abstract  String toString()
               
    abstract  void writeAnsiTo(Appendable appendable)
               
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
     

    Field Detail

    reset

    public static final Style reset

    BOOLEANS

    private static final Boolean[] BOOLEANS
    .


    COLORS

    private static final Color[] COLORS
    .


    ALL

    private static final Style.Composite[][][][][] ALL
    [bold][underline][blink][foreground][background].

    Constructor Detail

    Style

    public Style()
    Method Detail

    style

    public static Style.Composite style(Color foreground)

    style

    public static Style.Composite style(Color foreground,
                                        Color background)

    style

    public static Style.Composite style(Decoration decoration,
                                        Color foreground,
                                        Color background)

    style

    public static Style.Composite style(Boolean bold,
                                        Boolean underline,
                                        Boolean blink,
                                        Color foreground,
                                        Color background)

    style

    public static Style.Composite style()
    Create a new blank style.

    Returns:
    the style

    style

    public static Style.Composite style(Decoration decoration)

    style

    public static Style.Composite style(Decoration decoration,
                                        Color foreground)

    merge

    public abstract Style merge(Style s)
                         throws NullPointerException
    Throws:
    NullPointerException

    toAnsiSequence

    public CharSequence toAnsiSequence()

    writeAnsiTo

    public abstract void writeAnsiTo(Appendable appendable)
                              throws IOException
    Throws:
    IOException

    toString

    public abstract String toString()
    Overrides:
    toString in class Object


    Copyright © 2015 eXo Platform SAS. All Rights Reserved.