org.eobjects.metamodel.data
Interface Style

All Superinterfaces:
Serializable

public interface Style
extends Serializable

A Style represents the visual presentation ('styling') attributes of a value in a Row. Styling can be used to highlight special values and format the cells of eg. a spreadsheet. Most datastores don't support styling, but some do. Those who do not support it will just omit it. Creation of Style objects is handled by the StyleBuilder class.

Author:
Kasper Sørensen

Nested Class Summary
static interface Style.Color
          Represents a color used for value highlighting.
static class Style.SizeUnit
          Represents a unit of sizing elements (eg. fonts) in a Style.
static class Style.TextAlignment
          Represents the text alignment of a value.
 
Field Summary
static Style NO_STYLE
          A style object used for values without styling, "unstyled" values or "neutrally styled" values.
 
Method Summary
 Style.TextAlignment getAlignment()
          Gets the text alignment, or null if text alignment is unspecified.
 Style.Color getBackgroundColor()
          Gets the background color, or null if the color is unspecified.
 Integer getFontSize()
          Gets the font size, or null if font size is unspecified.
 Style.SizeUnit getFontSizeUnit()
          Gets the unit of the font size.
 Style.Color getForegroundColor()
          Gets the foreground (text) color, or null if the color is unspecified.
 boolean isBold()
          Determines whether or not the value is written in bold text.
 boolean isItalic()
          Determines whether or not the value is written in italic text.
 boolean isUnderline()
          Determines whether or not the value is written with an underline
 String toCSS()
          Creates a Cascading Style Sheets (CSS) representation of this style.
 

Field Detail

NO_STYLE

static final Style NO_STYLE
A style object used for values without styling, "unstyled" values or "neutrally styled" values.

Method Detail

isBold

boolean isBold()
Determines whether or not the value is written in bold text.

Returns:
true if text is bold

isItalic

boolean isItalic()
Determines whether or not the value is written in italic text.

Returns:
true if text is italic

isUnderline

boolean isUnderline()
Determines whether or not the value is written with an underline

Returns:
true if text is underlined

getFontSize

Integer getFontSize()
Gets the font size, or null if font size is unspecified.

Returns:
an Integer, or null
See Also:
Style.SizeUnit

getFontSizeUnit

Style.SizeUnit getFontSizeUnit()
Gets the unit of the font size.

Returns:
an enum representing the font size unit used.

getAlignment

Style.TextAlignment getAlignment()
Gets the text alignment, or null if text alignment is unspecified.

Returns:
a TextAlignment value, or null

getForegroundColor

Style.Color getForegroundColor()
Gets the foreground (text) color, or null if the color is unspecified.

Returns:
a Color object representing the foreground color

getBackgroundColor

Style.Color getBackgroundColor()
Gets the background color, or null if the color is unspecified.

Returns:
a Color object representing the background color

toCSS

String toCSS()
Creates a Cascading Style Sheets (CSS) representation of this style.

Returns:
a CSS string


Copyright © 2007-2013. All Rights Reserved.