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

public Class StyleHandlerRegistry

extends Object
Class Inheritance
Imports
java.util.HashMap, jfx.incubator.scene.control.richtext.model.StyleAttribute, jfx.incubator.scene.control.richtext.skin.CellContext

Style Handler Registry keeps track of the StyleAttributeHandler for supported StyleAttributes. The registry, once created using its Builder, is immutable. This class is needed when extending the RichTextArea with support for other style attributes. Applications should not normally use this interface.
Since
24

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
StyleHandlerRegistry.Builder

The builder used to create an immutable instance of StyleHandlerRegistry.

Field Summary

Modifier and TypeField and Description
private final HashMap<StyleAttribute<T>, StyleAttributeHandler<C extends RichTextArea, T>>
private final HashMap<StyleAttribute<T>, StyleAttributeHandler<C extends RichTextArea, T>>

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static StyleHandlerRegistry.Builder

Returns:

the builder instance
builder
(StyleHandlerRegistry
the parent class' registry (can be null)
parent
)

Creates a builder initialized with the parent's registry content.

public <
the control type
C extends RichTextArea
,
the attribute value type
T
>
void
process(C
the control reference
control
,
boolean
specifies which attribute to search for: paragraph (true) or text segment (false)
forParagraph
,
CellContext
the cell context
cx
,
StyleAttribute<T>
the attribute
a
,
T
the attribute value
value
)

Invokes the handler, if present, for the specified attribute in the context of the specified control.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

parStyleHandlerMapback to summary
private final HashMap<StyleAttribute<T>, StyleAttributeHandler<C extends RichTextArea, T>> parStyleHandlerMap
segStyleHandlerMapback to summary
private final HashMap<StyleAttribute<T>, StyleAttributeHandler<C extends RichTextArea, T>> segStyleHandlerMap

Constructor Detail

StyleHandlerRegistryback to summary
private StyleHandlerRegistry(HashMap<StyleAttribute<T>, StyleAttributeHandler<C extends RichTextArea, T>> p, HashMap<StyleAttribute<T>, StyleAttributeHandler<C extends RichTextArea, T>> s)

Method Detail

builderback to summary
public static StyleHandlerRegistry.Builder builder(StyleHandlerRegistry parent)

Creates a builder initialized with the parent's registry content.

Parameters
parent:StyleHandlerRegistry

the parent class' registry (can be null)

Returns:StyleHandlerRegistry.Builder

the builder instance

processback to summary
public <C extends RichTextArea, T> void process(C control, boolean forParagraph, CellContext cx, StyleAttribute<T> a, T value)

Invokes the handler, if present, for the specified attribute in the context of the specified control.

Parameters
<C>
the control type
<T>
the attribute value type
control:C

the control reference

forParagraph:boolean

specifies which attribute to search for: paragraph (true) or text segment (false)

cx:CellContext

the cell context

a:StyleAttribute<T>

the attribute

value:T

the attribute value

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

public Class StyleHandlerRegistry.Builder

extends Object
Class Inheritance
  • java.lang.Object
  • jfx.incubator.scene.control.richtext.StyleHandlerRegistry.Builder

The builder used to create an immutable instance of StyleHandlerRegistry.

Field Summary

Modifier and TypeField and Description
private HashMap<StyleAttribute<T>, StyleAttributeHandler<C extends RichTextArea, T>>
private HashMap<StyleAttribute<T>, StyleAttributeHandler<C extends RichTextArea, T>>

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public StyleHandlerRegistry

Returns:

the StyleHandlerRegistry instance
build
()

Creates an immutable instance of StyleHandlerRegistry.

public <
the control type
C extends RichTextArea
,
the attribute value type
T
>
void
setParHandler(StyleAttribute<T>
the attribute
a
,
StyleAttributeHandler<C, T>
the handler
h
)

Sets the paragraph handler for the given attribute.

public <
the control type
C extends RichTextArea
,
the attribute value type
T
>
void
setSegHandler(StyleAttribute<T>
the attribute
a
,
StyleAttributeHandler<C, T>
the handler
h
)

Sets the text segment handler for the given attribute.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

parStyleHandlerMapback to summary
private HashMap<StyleAttribute<T>, StyleAttributeHandler<C extends RichTextArea, T>> parStyleHandlerMap
segStyleHandlerMapback to summary
private HashMap<StyleAttribute<T>, StyleAttributeHandler<C extends RichTextArea, T>> segStyleHandlerMap

Constructor Detail

Builderback to summary
pack-priv Builder()

Method Detail

buildback to summary
public StyleHandlerRegistry build()

Creates an immutable instance of StyleHandlerRegistry.

Returns:StyleHandlerRegistry

the StyleHandlerRegistry instance

setParHandlerback to summary
public <C extends RichTextArea, T> void setParHandler(StyleAttribute<T> a, StyleAttributeHandler<C, T> h)

Sets the paragraph handler for the given attribute.

Parameters
<C>
the control type
<T>
the attribute value type
a:StyleAttribute<T>

the attribute

h:StyleAttributeHandler<C, T>

the handler

setSegHandlerback to summary
public <C extends RichTextArea, T> void setSegHandler(StyleAttribute<T> a, StyleAttributeHandler<C, T> h)

Sets the text segment handler for the given attribute.

Parameters
<C>
the control type
<T>
the attribute value type
a:StyleAttribute<T>

the attribute

h:StyleAttributeHandler<C, T>

the handler