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
public class CodeTextModel extends BasicTextModel
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
| Type | Property | Description |
|---|---|---|
final ObjectProperty |
decorator |
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
| Constructor | Description |
|---|---|
CodeTextModel() |
Constructs the CodeTextModel with an in-memory content. |
CodeTextModel |
Constructs the CodeTextModel with the specified content. |
Method Summary
| Modifier and Type | Method | Description |
|---|---|---|
final ObjectProperty |
decoratorProperty() |
Syntax decorator applies styling to the plain text stored in the model. |
final SyntaxDecorator |
getDecorator() |
Gets the value of the decorator property. |
final RichParagraph |
getParagraph |
Returns a RichParagraph at the given model index. |
final void |
setDecorator |
Sets the value of the decorator 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
public final ObjectProperty<SyntaxDecorator> decoratorProperty
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
public CodeTextModel(BasicTextModel.Content c)
Constructs the CodeTextModel with the specified content.
- Parameters:
-
c- the content
Method Details
getParagraph
public final RichParagraph getParagraph(int index)
Description copied from class:
StyledTextModelReturns 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.
- Specified by:
-
getParagraphin classStyledTextModel - Parameters:
-
index- the paragraph index in the range (0...StyledTextModel.size()) - Returns:
- the instance of
RichParagraph
decoratorProperty
public final ObjectProperty<SyntaxDecorator> decoratorProperty()
Syntax decorator applies styling to the plain text stored in the model.
- Returns:
- the syntax decorator value (may be null)
- See Also:
getDecorator
public final SyntaxDecorator getDecorator()
Gets the value of the
decorator property.- Property description:
- Syntax decorator applies styling to the plain text stored in the model.
- Returns:
- the value of the
decoratorproperty - See Also:
setDecorator
public final void setDecorator(SyntaxDecorator d)
Sets the value of the
decorator property.- Property description:
- Syntax decorator applies styling to the plain text stored in the model.
- Parameters:
-
d- the value for thedecoratorproperty - See Also:
© 2008, 2025, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from JavaFX API Documentation.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Java, JavaFX and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.