APIdia Launch Partner
Top Description Inners Methods
jfx.incubator.scene.control.richtext.skin

public Interface CellContext

Known Direct Implementers
com.sun.jfx.incubator.scene.control.richtext.VFlowCellContext
Imports
javafx.scene.Node, jfx.incubator.scene.control.richtext.model.StyleAttribute, .StyleAttributeMap

This interface provides a mechanism for the Skin to support custom StyleAttributes. During the layout pass, the cell context is passed to the Skin so the latter can add inline style(s) to either the paragraph Node (typically TextFlow) or the text segment Node (Text).
Since
24
See Also
RichTextAreaSkin#applyStyles(CellContext, StyleAttributeMap, boolean)

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum
CellContext.RunDecor

Specifies the decoration type to be applied to multiple text segments.

Method Summary

Modifier and TypeMethod and Description
public void
addStyle(String
the inline style string
fxStyle
)

Adds an inline style.

public <
the attribute type
T
>
void
decorateRun(StyleAttribute<T>
the attribute
a
,
CellContext.RunDecor
the decoration type
type
,
String
the style name
styleName
)

Decorates the current segment with the specified attribute by coalescing adjacent runs into a single decoration pass.

public StyleAttributeMap

Returns:

the current attributes.
getAttributes
()

Returns the current attributes.

public Node

Returns:

the node being styled.
getNode
()

Returns the node being styled.

Method Detail

addStyleback to summary
public void addStyle(String fxStyle)

Adds an inline style.

The inline style must be a valid CSS style string, for example "-fx-font-size:15px;". This string might contain multiple CSS properties.

Parameters
fxStyle:String

the inline style string

decorateRunback to summary
public <T> void decorateRun(StyleAttribute<T> a, CellContext.RunDecor type, String styleName)

Decorates the current segment with the specified attribute by coalescing adjacent runs into a single decoration pass.

This method is used when the visual representation requires uninterrupted segments instead of several adjacent ones, for example in the case of wavy underline, in order to avoid breaks in the wave. This method expects that for any attribute the corresponding type and styleName are the same.

Parameters
<T>
the attribute type
a:StyleAttribute<T>

the attribute

type:CellContext.RunDecor

the decoration type

styleName:String

the style name

Since
27
getAttributesback to summary
public StyleAttributeMap getAttributes()

Returns the current attributes.

Returns:StyleAttributeMap

the current attributes.

getNodeback to summary
public Node getNode()

Returns the node being styled.

This might be a TextFlow (for the paragraph cell context) or Text (for the text segment cell context).

Returns:Node

the node being styled.

jfx.incubator.scene.control.richtext.skin back to summary

public final Enum CellContext.RunDecor

extends Enum<CellContext.RunDecor>
Class Inheritance

Specifies the decoration type to be applied to multiple text segments.
Since
27

Field Summary

Modifier and TypeField and Description
public static final CellContext.RunDecor
HIGHLIGHT

Text background (highlight) decoration.

public static final CellContext.RunDecor
WAVY_UNDERLINE

Wavy underline decoration.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static CellContext.RunDecor
public static CellContext.RunDecor[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

HIGHLIGHTback to summary
public static final CellContext.RunDecor HIGHLIGHT

Text background (highlight) decoration.

WAVY_UNDERLINEback to summary
public static final CellContext.RunDecor WAVY_UNDERLINE

Wavy underline decoration.

Constructor Detail

RunDecorback to summary
private RunDecor()

Method Detail

valueOfback to summary
public static CellContext.RunDecor valueOf(String name)
valuesback to summary
public static CellContext.RunDecor[] values()