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

public Class CodeTextModel

extends BasicTextModel
Class Inheritance
Imports
java.util.Set, javafx.beans.property.ObjectProperty, .SimpleObjectProperty, jfx.incubator.scene.control.richtext.SyntaxDecorator, .TextPos

Editable plain text model with optional syntax highlighting for use with the CodeArea control.

This model supports custom content storage mechanism via BasicTextModel.Content. By default, the model provides an in-memory storage via its BasicTextModel.InMemoryContent implementation.

Since
24

Field Summary

Modifier and TypeField and Description
private SimpleObjectProperty<SyntaxDecorator>
private static final Set<StyleAttribute<?>>

Constructor Summary

AccessConstructor and Description
public
CodeTextModel()

Constructs the CodeTextModel with an in-memory content.

public
CodeTextModel(BasicTextModel.Content
the content
c
)

Constructs the CodeTextModel with the specified content.

Method Summary

Modifier and TypeMethod and Description
public final ObjectProperty<SyntaxDecorator>

Returns:

the syntax decorator value (may be null)
decoratorProperty
()

Syntax decorator applies styling to the plain text stored in the model.

public void
fireChangeEvent(TextPos start, TextPos end, int charsTop, int linesAdded, int charsBottom)

Overrides jfx.incubator.scene.control.richtext.model.StyledTextModel.fireChangeEvent.

Fires a text modification event for the given range.

public final SyntaxDecorator
public final RichParagraph
protected Set<StyleAttribute<?>>
private static Set<StyleAttribute<?>>
public final void
Inherited from jfx.incubator.scene.control.richtext.model.BasicTextModel:
applyParagraphStyleapplyStylegetPlainTextgetStyleAttributeMapinsertLineBreakinsertParagraphinsertTextinsertTextSegmentisWritableremoveRangesetParagraphStylesize

Field Detail

decoratorback to summary
private SimpleObjectProperty<SyntaxDecorator> decorator
SUPPORTEDback to summary
private static final Set<StyleAttribute<?>> SUPPORTED

Constructor Detail

CodeTextModelback to summary
public CodeTextModel()

Constructs the CodeTextModel with an in-memory content.

CodeTextModelback to summary
public CodeTextModel(BasicTextModel.Content c)

Constructs the CodeTextModel with the specified content.

Parameters
c:BasicTextModel.Content

the content

Method Detail

decoratorPropertyback to summary
public final ObjectProperty<SyntaxDecorator> decoratorProperty()

Syntax decorator applies styling to the plain text stored in the model.

Returns:ObjectProperty<SyntaxDecorator>

the syntax decorator value (may be null)

fireChangeEventback to summary
public void fireChangeEvent(TextPos start, TextPos end, int charsTop, int linesAdded, int charsBottom)

Overrides jfx.incubator.scene.control.richtext.model.StyledTextModel.fireChangeEvent.

Doc from jfx.incubator.scene.control.richtext.model.StyledTextModel.fireChangeEvent.

Fires a text modification event for the given range.

Annotations
@Override
getDecoratorback to summary
public final SyntaxDecorator getDecorator()
getParagraphback to summary
public final RichParagraph getParagraph(int index)

Overrides jfx.incubator.scene.control.richtext.model.BasicTextModel.getParagraph.

Doc from jfx.incubator.scene.control.richtext.model.StyledTextModel.getParagraph.

Returns a RichParagraph at the given model index. The callers must ensure that the value of index is within the valid document range, since doing otherwise might result in an exception or undetermined behavior.

This method makes no guarantees that the same paragraph instance will be returned for the same model index.

Annotations
@Override
getSupportedAttributesback to summary
protected Set<StyleAttribute<?>> getSupportedAttributes()

Overrides jfx.incubator.scene.control.richtext.model.StyledTextModel.getSupportedAttributes.

Doc from jfx.incubator.scene.control.richtext.model.StyledTextModel.getSupportedAttributes.

Returns the set of attributes supported attributes. When this method returns a non-null set, it will be used by the methods which handle the external input for the purpose of filtering out the attributes the model cannot understand, preventing the attributes from being added to the model (for example, as a result of pasting from the system clipboard).

The methods that utilize the filtering are: applyStyle(TextPos, TextPos, StyleAttributeMap, boolean), replace(StyleResolver, TextPos, TextPos, StyledInput), and replace(StyleResolver, TextPos, TextPos, String).

When this method returns null, no filtering is performed.

This method might be overridden by certain models. The base class implementation returns null.

Annotations
@Override
initSupportedAttributesback to summary
private static Set<StyleAttribute<?>> initSupportedAttributes()
setDecoratorback to summary
public final void setDecorator(SyntaxDecorator d)