Class InlineStyleFormattingContext
- All Implemented Interfaces:
DeclarationFormattingContext
,StyleFormattingContext
,Serializable
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
endCurrentContext
(org.w3c.dom.css.CSSRule rule) Notify this context that the style was serialized for the given rule.void
endInlinePropertyDeclaration
(io.sf.carte.util.SimpleWriter wri) End an inline property declaration.void
endPropertyDeclaration
(io.sf.carte.util.SimpleWriter wri) Ends a property declaration in a rule style (does not apply to inline styles).void
Ends the serialization of a rule.void
updateContext
(org.w3c.dom.css.CSSRule rule) Update this context for the given rule.void
writeComment
(io.sf.carte.util.SimpleWriter wri, String comment) Serialize a comment that precedes a rule, with the appropriate indent.void
writeFullIndent
(io.sf.carte.util.SimpleWriter wri) Serialize a full paragraph indent to aSimpleWriter
.void
writeLeftCurlyBracket
(io.sf.carte.util.SimpleWriter wri) Serialize a left curly bracket to aSimpleWriter
.void
writeLevelIndent
(io.sf.carte.util.SimpleWriter wri) Serialize one level of indentation to aSimpleWriter
.void
writeSemiColon
(io.sf.carte.util.SimpleWriter wri) Serialize a semicolon to aSimpleWriter
.Methods inherited from class io.sf.carte.doc.style.css.om.DefaultStyleFormattingContext
deepenCurrentContext, endRuleList, endStyleDeclaration, setParentContext, startRule, startStyleDeclaration, writeImportantPriority, writeRightCurlyBracket, writeURL
Methods inherited from class io.sf.carte.doc.style.css.om.DefaultDeclarationFormattingContext
startPropertyDeclaration, writeColon, writeComma
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.sf.carte.doc.style.css.DeclarationFormattingContext
startPropertyDeclaration, writeColon, writeComma, writeMinifiedValue, writeValue
Methods inherited from interface io.sf.carte.doc.style.css.StyleFormattingContext
writeShorthandValue
-
Constructor Details
-
InlineStyleFormattingContext
public InlineStyleFormattingContext()
-
-
Method Details
-
endCurrentContext
public void endCurrentContext(org.w3c.dom.css.CSSRule rule) Description copied from interface:StyleFormattingContext
Notify this context that the style was serialized for the given rule.It is called before
StyleFormattingContext.endStyleDeclaration(SimpleWriter)
.- Specified by:
endCurrentContext
in interfaceStyleFormattingContext
- Overrides:
endCurrentContext
in classDefaultStyleFormattingContext
- Parameters:
rule
- the rule being serialized.
-
endPropertyDeclaration
Description copied from interface:DeclarationFormattingContext
Ends a property declaration in a rule style (does not apply to inline styles).It is called after
DeclarationFormattingContext.writeSemiColon(SimpleWriter)
.- Specified by:
endPropertyDeclaration
in interfaceDeclarationFormattingContext
- Overrides:
endPropertyDeclaration
in classDefaultStyleFormattingContext
- Parameters:
wri
- the writer.- Throws:
IOException
- if an I/O problem happens while writing to theSimpleWriter
.
-
endInlinePropertyDeclaration
Description copied from interface:StyleFormattingContext
End an inline property declaration.Called after
DeclarationFormattingContext.writeSemiColon(SimpleWriter)
, only from inline styles.- Specified by:
endInlinePropertyDeclaration
in interfaceStyleFormattingContext
- Overrides:
endInlinePropertyDeclaration
in classDefaultStyleFormattingContext
- Parameters:
wri
- the writer to write to.- Throws:
IOException
- if an I/O problem happens while writing to theSimpleWriter
.
-
endRule
public void endRule(io.sf.carte.util.SimpleWriter wri, List<String> trailingComments) throws IOException Description copied from interface:StyleFormattingContext
Ends the serialization of a rule.It is called after
StyleFormattingContext.writeRightCurlyBracket(SimpleWriter)
.- Specified by:
endRule
in interfaceStyleFormattingContext
- Overrides:
endRule
in classDefaultStyleFormattingContext
- Parameters:
wri
- the writer to write to.trailingComments
- the comments that go after the rule.- Throws:
IOException
- if an I/O problem happens while writing to theSimpleWriter
.
-
updateContext
public void updateContext(org.w3c.dom.css.CSSRule rule) Description copied from interface:StyleFormattingContext
Update this context for the given rule.For style rules, it is called after serializing the selector list and before
StyleFormattingContext.writeLeftCurlyBracket(SimpleWriter)
. At-rules call it after writing the rule name.May be used for indentation.
- Specified by:
updateContext
in interfaceStyleFormattingContext
- Overrides:
updateContext
in classDefaultStyleFormattingContext
- Parameters:
rule
- the rule being serialized.
-
writeComment
Description copied from interface:StyleFormattingContext
Serialize a comment that precedes a rule, with the appropriate indent.Trailing comments are generally written directly by
StyleFormattingContext.endRule(SimpleWriter, List)
because no indent is necessary.- Specified by:
writeComment
in interfaceStyleFormattingContext
- Overrides:
writeComment
in classDefaultStyleFormattingContext
- Parameters:
wri
- the writer to write to.comment
- the comment to serialize.- Throws:
IOException
- if an I/O problem happens while writing to theSimpleWriter
.
-
writeFullIndent
Description copied from interface:DeclarationFormattingContext
Serialize a full paragraph indent to aSimpleWriter
.- Specified by:
writeFullIndent
in interfaceDeclarationFormattingContext
- Overrides:
writeFullIndent
in classDefaultStyleFormattingContext
- Parameters:
wri
- the writer.- Throws:
IOException
- if an I/O problem happens while writing to theSimpleWriter
.
-
writeLeftCurlyBracket
Description copied from interface:StyleFormattingContext
Serialize a left curly bracket to aSimpleWriter
.Called after
StyleFormattingContext.updateContext(CSSRule)
and beforeStyleFormattingContext.startStyleDeclaration(SimpleWriter)
.- Specified by:
writeLeftCurlyBracket
in interfaceStyleFormattingContext
- Overrides:
writeLeftCurlyBracket
in classDefaultStyleFormattingContext
- Parameters:
wri
- the writer.- Throws:
IOException
- if an I/O problem happens while writing to theSimpleWriter
.
-
writeLevelIndent
Description copied from interface:StyleFormattingContext
Serialize one level of indentation to aSimpleWriter
.- Specified by:
writeLevelIndent
in interfaceStyleFormattingContext
- Overrides:
writeLevelIndent
in classDefaultStyleFormattingContext
- Parameters:
wri
- the writer.- Throws:
IOException
- if an I/O problem happens while writing to theSimpleWriter
.
-
writeSemiColon
Description copied from interface:DeclarationFormattingContext
Serialize a semicolon to aSimpleWriter
.Called after writing the property name.
- Specified by:
writeSemiColon
in interfaceDeclarationFormattingContext
- Overrides:
writeSemiColon
in classDefaultStyleFormattingContext
- Parameters:
wri
- the writer.- Throws:
IOException
- if an I/O problem happens while writing to theSimpleWriter
.
-