org.tinyjee.maven.dim.extensions
Class InlineCssParameterTransformer
java.lang.Object
org.tinyjee.maven.dim.extensions.AbstractParameterTransformer
org.tinyjee.maven.dim.extensions.InlineCssParameterTransformer
- All Implemented Interfaces:
- RequestParameterTransformer
public class InlineCssParameterTransformer
- extends AbstractParameterTransformer
This extension adds an inline CSS definition to the current page.
Use this extension to define short-lived style classes or adjust existing styles for just one page.
- Author:
- Juergen_Kellerer, 2011-11-06
Field Summary |
static String |
PARAM_INLINE_CSS
Enables this extension and sets the content to place inside the inlined "<style>" element. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PARAM_INLINE_CSS
public static final String PARAM_INLINE_CSS
- Enables this extension and sets the content to place inside the inlined "<style>" element.
Note: Setting this property has no effect in case of "
source
" or "source-class
" were
specified with the macro call. This behaviour ensures that the parameter "inline-css
" can still be used
with ordinary macro calls where a source or source-class was set.
Using this parameter has no effect when the used Sink does not support HTML markup.
This parameter supports the usage of "classpath:/path/to/css/to/inline
" to load the css from the classpath instead
of defining it with the macro call.
As the default brace style of "{}" is used to call macros in APT, the extension supports substituting the default CSS braces
with "[]". This brace style is optional but it must be used when more than one style class is defined with the macro call
as the APT parser swallows the "}" character, leading to invalid results.
Examples:
- "
%{include|inline-css=.my-class { background-color:red; }}
"
- "
%{include|inline-css=.section th { background-color:#999999; color:white; }}
"
- changes the appearance of table headers inside sections.
- "
%{include|inline-css=.white [ color:white; ] .red [ color:red; ]}
"
- Define more than one class at once using [] instead of {}.
- See Also:
- Constant Field Values
InlineCssParameterTransformer
public InlineCssParameterTransformer()
doTransformParameters
protected boolean doTransformParameters(Map<String,Object> requestParams)
- Specified by:
doTransformParameters
in class AbstractParameterTransformer