Class CodeTextModel
java.lang.Object
jfx.incubator.scene.control.richtext.model.StyledTextModel
jfx.incubator.scene.control.richtext.model.BasicTextModel
jfx.incubator.scene.control.richtext.model.CodeTextModel
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
-
Nested Class Summary
Nested classes/interfaces declared in class jfx.incubator.scene.control.richtext.model.BasicTextModel
BasicTextModel.Content, BasicTextModel.InMemoryContent
Nested classes/interfaces declared in class jfx.incubator.scene.control.richtext.model.StyledTextModel
StyledTextModel.Listener
-
Property Summary
PropertiesTypePropertyDescriptionfinal ObjectProperty
<SyntaxDecorator> Syntax decorator applies styling to the plain text stored in the model.Properties declared in class jfx.incubator.scene.control.richtext.model.StyledTextModel
redoable, undoable
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs the CodeTextModel with an in-memory content.Constructs the CodeTextModel with the specified content. -
Method Summary
Modifier and TypeMethodDescriptionfinal ObjectProperty
<SyntaxDecorator> Syntax decorator applies styling to the plain text stored in the model.final SyntaxDecorator
Gets the value of thedecorator
property.final RichParagraph
getParagraph
(int index) Returns aRichParagraph
at the given model index.final void
Sets the value of thedecorator
property.Methods declared in class jfx.incubator.scene.control.richtext.model.BasicTextModel
applyStyle, getPlainText, getStyleAttributeMap, insertLineBreak, insertParagraph, insertText, insertTextSegment, isWritable, removeRange, setParagraphStyle, size
Methods declared in class jfx.incubator.scene.control.richtext.model.StyledTextModel
addListener, applyStyle, clamp, clearUndoRedo, export, exportParagraph, fireChangeEvent, fireStyleChangeEvent, getDataFormatHandler, getDocumentEnd, getEndOfParagraphTextPos, getMarker, getParagraphLength, getSupportedAttributes, getSupportedDataFormats, isRedoable, isUndoable, read, redo, redoableProperty, registerDataFormatHandler, removeDataFormatHandler, removeListener, replace, replace, undo, undoableProperty, write
-
Property Details
-
decorator
Syntax decorator applies styling to the plain text stored in the model.- See Also:
-
-
Constructor Details
-
CodeTextModel
public CodeTextModel()Constructs the CodeTextModel with an in-memory content. -
CodeTextModel
Constructs the CodeTextModel with the specified content.- Parameters:
c
- the content
-
-
Method Details
-
getParagraph
Description copied from class:StyledTextModel
Returns aRichParagraph
at the given model index. The callers must ensure that the value ofindex
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.
- Specified by:
getParagraph
in classStyledTextModel
- Parameters:
index
- the paragraph index in the range (0...StyledTextModel.size()
)- Returns:
- the instance of
RichParagraph
-
decoratorProperty
Syntax decorator applies styling to the plain text stored in the model.- Returns:
- the syntax decorator value (may be null)
- See Also:
-
getDecorator
Gets the value of thedecorator
property.- Property description:
- Syntax decorator applies styling to the plain text stored in the model.
- Returns:
- the value of the
decorator
property - See Also:
-
setDecorator
Sets the value of thedecorator
property.- Property description:
- Syntax decorator applies styling to the plain text stored in the model.
- Parameters:
d
- the value for thedecorator
property- See Also:
-