Package de.hsh.graja.util.comment
Class Inline
java.lang.Object
de.hsh.graja.util.comment.Content
de.hsh.graja.util.comment.AbstractElementContent
de.hsh.graja.util.comment.Inline
- All Implemented Interfaces:
Serializable
This content is rendered as a "span" inside a paragraph. A subsequent content will begin immediately after this content without a line break or paragraph delimiter.
Usage example:
InlineContent.format(includeSpec, "%s: %d", "Expected result", 15);
- See Also:
-
Field Summary
Fields inherited from class de.hsh.graja.util.comment.Content
EXCLUSIVE, renderUuid
-
Constructor Summary
ConstructorsConstructorDescriptionInline
(IncludeSpec includeSpec, String data) Create a new content with default (normal) font.Inline
(IncludeSpec includeSpec, String data, FontWeightAndStyle fwas) Create a new content.Inline
(IncludeSpec includeSpec, String data, FontWeightAndStyle fwas, WhiteSpace whiteSpace) Create a new content.Create a new content with default (normal) font and no include spec.Inline
(String data, FontWeightAndStyle fwas) Create a new content without include spec -
Method Summary
Modifier and TypeMethodDescriptionboolean
implements the contract ofObject.equals(Object)
.static Inline
format
(IncludeSpec includeSpec, String format, FontWeightAndStyle fwas, Object... args) Convenience factory method for a formatted string.static Inline
format
(IncludeSpec includeSpec, String format, Object... args) Convenience factory method for a formatted string.static Inline
format
(String format, FontWeightAndStyle fwas, Object... args) Convenience factory method for a formatted string with no include spec.static Inline
Convenience factory method for a formatted string with no include spec.getData()
getFwas()
int
hashCode()
implements the contract ofObject.hashCode()
.boolean
void
renderHtmlImpl
(StringBuilder sb, IncludeInfo includeInfo, RenderContext ctx, boolean useJavascript) render content to HTML.void
renderPlainImpl
(StringBuilder sb, IncludeInfo includeInfo, RenderContext ctx) render content to plain text.void
Set new textThis method is for debugging purposes.Methods inherited from class de.hsh.graja.util.comment.AbstractElementContent
getNestedContents
Methods inherited from class de.hsh.graja.util.comment.Content
click, dehighlight, disableCallerStacktraceRecording, enableCallerStacktraceRecording, excludeGlobally, getIncludeSpec, getRenderUuid, getStackdump, hide, highlight, include, isCallerStacktraceRecordingEnabled, isHidden, isShowing, onClick, onClick, onHide, onHide, onLoad, onLoad, onShow, onShow, registerCallable, renderHtml, renderHtml, renderIdAttribute, renderJavascriptOncePerClass, renderOnClickAttribute, renderPlain, renderPlain, setGlobalIncludeInfo, setHref, setIncludeSpec, show, toString
-
Constructor Details
-
Inline
Create a new content without include spec- Parameters:
data
- the text of the commentfwas
- the font
-
Inline
Create a new content.- Parameters:
includeSpec
- the include spec of the commentdata
- the text of the commentfwas
- the font
-
Inline
Create a new content.- Parameters:
includeSpec
- the include spec of the commentdata
- the text of the commentfwas
- the fontwhiteSpace
- the white space specification
-
Inline
Create a new content with default (normal) font.- Parameters:
includeSpec
- the include spec of the commentdata
- the text of the comment
-
Inline
Create a new content with default (normal) font and no include spec.- Parameters:
data
- the text of the comment
-
-
Method Details
-
getData
- Returns:
- the text as it was passed to constructor or the setter.
-
setData
Set new text- Parameters:
data
- the new text
-
format
public static Inline format(IncludeSpec includeSpec, String format, FontWeightAndStyle fwas, Object... args) Convenience factory method for a formatted string.- Parameters:
includeSpec
- the include spec of the commentformat
- a format string as defined byFormatter.format(String, Object...)
.fwas
- a font specificationargs
- arguments as expected byFormatter.format(String, Object...)
.- Returns:
- a new instance
-
format
Convenience factory method for a formatted string with no include spec.- Parameters:
format
- a format string as defined byFormatter.format(String, Object...)
.fwas
- a font specificationargs
- arguments as expected byFormatter.format(String, Object...)
.- Returns:
- a new instance
-
format
Convenience factory method for a formatted string.- Parameters:
includeSpec
- the include spec of the commentformat
- a format string as defined byFormatter.format(String, Object...)
.args
- arguments as expected byFormatter.format(String, Object...)
.- Returns:
- a new instance with normal font.
-
format
Convenience factory method for a formatted string with no include spec.- Parameters:
format
- a format string as defined byFormatter.format(String, Object...)
.args
- arguments as expected byFormatter.format(String, Object...)
.- Returns:
- a new instance with normal font.
-
isInlineContent
public boolean isInlineContent()- Specified by:
isInlineContent
in classContent
- Returns:
- true
- See Also:
-
toString
Description copied from class:Content
This method is for debugging purposes. -
getFwas
- Returns:
- the font as it was passed to the constructor.
-
hashCode
public int hashCode()implements the contract ofObject.hashCode()
. -
equals
implements the contract ofObject.equals(Object)
. -
renderHtmlImpl
public void renderHtmlImpl(StringBuilder sb, IncludeInfo includeInfo, RenderContext ctx, boolean useJavascript) Description copied from class:Content
render content to HTML. This method is meant to be overriden by subclasses.- Specified by:
renderHtmlImpl
in classContent
- Parameters:
sb
- HTML code resultincludeInfo
- controls, which content to be rendered.ctx
- render contextuseJavascript
- if true, the generated HTML code will contain Javascript- See Also:
-
Content#renderHtmlImpl(StringBuilder, IncludeInfo, RenderContext)
-
renderPlainImpl
Description copied from class:Content
render content to plain text. This method is meant to be overriden by subclasses.- Specified by:
renderPlainImpl
in classContent
- Parameters:
sb
- plain text resultincludeInfo
- controls, which content to be rendered.ctx
- render context (unused).- See Also:
-