Tag
public class StyleTag extends BaseTag
A StyleTag
represents a dynamically determined style for a
Cell
. A StyleTag
must have a body.
The style
attribute works like the HTML "style" attribute,
in that one can specify one or more style elements in a
property: value; property: value
style. If a property is
specified, then it will override whatever value is already present in the
Cell
. If a property value is an empty string or the property
is not present, then it will be ignored and it will not override whatever
value is already present in the Cell
. Unrecognized property
names and unrecognized values for a property are ignored and do not override
whatever value is already present in the Cell
. Property names
and values may be specified in a case insensitive-fashion, i.e. "CENTER" =
"Center" = "center"..
The class
attributes works like the HTML "class" attribute,
in that one can specify one or more CSS-like style "classes" in a
semicolon-delimited list. Register CSS-like files and/or CSS-like text with
the ExcelTransformer
prior to transformation. Subsequent class
names override previous class names, and the style
attribute
overrides the class
attribute.
BaseTag
.String
String
For supported property names and values (plus explanations), please see
TagParser
.
ExcelTransformer
Modifier and Type | Field | Description |
---|---|---|
static java.lang.String |
ATTR_CLASS |
Attribute that specifies the desired pre-defined style class to apply to
the current
Cell . |
static java.lang.String |
ATTR_STYLE |
Attribute that specifies the desired style property(ies) to change in the
current
Cell . |
ATTR_ON_PROCESSED, SPEC_SEP
Constructor | Description |
---|---|
StyleTag() |
Modifier and Type | Method | Description |
---|---|---|
java.lang.String |
getName() |
Returns this
Tag's name. |
protected java.util.List<java.lang.String> |
getOptionalAttributes() |
Returns a
List of optional attribute names. |
protected java.util.List<java.lang.String> |
getRequiredAttributes() |
Returns a
List of required attribute names. |
boolean |
process() |
Override the cells' current styles with any non-null style property
values.
|
void |
validateAttributes() |
Validates the attributes for this
Tag . |
checkAttributes, clearBlock, deleteBlock, getAttributes, getContext, getLocation, getParentTag, getWorkbookContext, isBodiless, processTag, removeBlock, setAttributes, setBodiless, setContext, setParentTag, setWorkbookContext
public static final java.lang.String ATTR_STYLE
Cell
. Properties are specified in a string with the
following format: property1: value1; property2: value2; ...
public static final java.lang.String ATTR_CLASS
Cell
. Pre-defined styles are defined by
registering styles with the ExcelTransformer
prior to
transformation.ExcelTransformer.addCssFile(String)
,
ExcelTransformer.addCssText(String)
,
Constant Field Valuespublic java.lang.String getName()
Tag's
name.Tag's
name.protected java.util.List<java.lang.String> getRequiredAttributes()
List
of required attribute names.getRequiredAttributes
in class BaseTag
List
of required attribute names.protected java.util.List<java.lang.String> getOptionalAttributes()
List
of optional attribute names.getOptionalAttributes
in class BaseTag
List
of optional attribute names.public void validateAttributes() throws TagParseException
Tag
. This tag must have a
body.validateAttributes
in class BaseTag
TagParseException
- If the attribute values are illegal or
unacceptable.Copyright © 2012–2018 Jett Team. All rights reserved.