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

public abstract Class StyledTextModelViewOnlyBase

extends StyledTextModel
Class Inheritance
Known Direct Subclasses
jfx.incubator.scene.control.richtext.model.SimpleViewOnlyStyledModel
Imports
java.util.function.Supplier, javafx.scene.layout.Region, jfx.incubator.scene.control.richtext.TextPos

The base class for view-only StyledTextModels.

Models extending this class will not be user editable.

Since
24

Constructor Summary

AccessConstructor and Description
public
StyledTextModelViewOnlyBase()

The constructor.

Method Summary

Modifier and TypeMethod and Description
protected final void
applyParagraphStyle(int ix, StyleAttributeMap a)

Implements abstract jfx.incubator.scene.control.richtext.model.StyledTextModel.applyParagraphStyle.

Applies paragraph styles in the specified paragraph.

protected final void
applyStyle(int ix, int start, int end, StyleAttributeMap a, boolean merge)

Implements abstract jfx.incubator.scene.control.richtext.model.StyledTextModel.applyStyle.

Applies style to the specified text range within a single paragraph.

protected void
insertLineBreak(int index, int offset)

Implements abstract jfx.incubator.scene.control.richtext.model.StyledTextModel.insertLineBreak.

Inserts a line break at the specified position.

protected void
insertParagraph(int index, Supplier<Region> generator)

Implements abstract jfx.incubator.scene.control.richtext.model.StyledTextModel.insertParagraph.

Inserts a paragraph that contains a single Region.

protected int
insertTextSegment(int index, int offset, String text, StyleAttributeMap attrs)

Implements abstract jfx.incubator.scene.control.richtext.model.StyledTextModel.insertTextSegment.

This method is called to insert a single styled text segment at the given position.

public final boolean

Returns:

always returns false
isWritable
()

Implements abstract jfx.incubator.scene.control.richtext.model.StyledTextModel.isWritable.

Indicates whether the model supports content modifications made via applyStyle(), replace(), undo(), redo() methods.

protected void
removeRange(TextPos start, TextPos end)

Implements abstract jfx.incubator.scene.control.richtext.model.StyledTextModel.removeRange.

Removes the specified text range.

protected final void
setParagraphStyle(int ix, StyleAttributeMap a)

Implements abstract jfx.incubator.scene.control.richtext.model.StyledTextModel.setParagraphStyle.

Replaces the paragraph styles in the specified paragraph.

Inherited from jfx.incubator.scene.control.richtext.model.StyledTextModel:
addListenerapplyStyleclampclearUndoRedodocumentPropertiesexportexportParagraphfireChangeEventfireStyleChangeEventgetDataFormatHandlergetDocumentEndgetEndOfParagraphTextPosgetLineEndinggetMarkergetParagraphgetParagraphLengthgetPlainTextgetStyleAttributeMapgetSupportedAttributesgetSupportedDataFormatshandleDocumentPropertiesisRedoableisUndoableisUndoRedoEnabledreadredoredoablePropertyregisterDataFormatHandlerremoveDataFormatHandlerremoveListenerreplacereplacesetLineEndingsetUndoRedoEnabledsizeundoundoablePropertyversionStringwrite

Constructor Detail

StyledTextModelViewOnlyBaseback to summary
public StyledTextModelViewOnlyBase()

The constructor.

Method Detail

applyParagraphStyleback to summary
protected final void applyParagraphStyle(int ix, StyleAttributeMap a)

Implements abstract jfx.incubator.scene.control.richtext.model.StyledTextModel.applyParagraphStyle.

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

Applies paragraph styles in the specified paragraph.

Annotations
@Override
applyStyleback to summary
protected final void applyStyle(int ix, int start, int end, StyleAttributeMap a, boolean merge)

Implements abstract jfx.incubator.scene.control.richtext.model.StyledTextModel.applyStyle.

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

Applies style to the specified text range within a single paragraph. The end argument may exceed the paragraph length, in which case the outcome should be the same as supplying the paragraph length value.

Annotations
@Override
insertLineBreakback to summary
protected void insertLineBreak(int index, int offset)

Implements abstract jfx.incubator.scene.control.richtext.model.StyledTextModel.insertLineBreak.

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

Inserts a line break at the specified position.

Annotations
@Override
insertParagraphback to summary
protected void insertParagraph(int index, Supplier<Region> generator)

Implements abstract jfx.incubator.scene.control.richtext.model.StyledTextModel.insertParagraph.

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

Inserts a paragraph that contains a single Region.

The model should not cache or otherwise retain references to the created Regions, as they might be requested multiple times during the lifetime of the model, or by different views.

This method allows for embedding Controls that handle user input. In this case, the model should declare necessary properties and provide bidirectional bindings between the properties in the model and the corresponding properties in the control, as well as handle copy, paste, writing to and reading from I/O streams.

Annotations
@Override
insertTextSegmentback to summary
protected int insertTextSegment(int index, int offset, String text, StyleAttributeMap attrs)

Implements abstract jfx.incubator.scene.control.richtext.model.StyledTextModel.insertTextSegment.

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

This method is called to insert a single styled text segment at the given position.

Annotations
@Override
isWritableback to summary
public final boolean isWritable()

Implements abstract jfx.incubator.scene.control.richtext.model.StyledTextModel.isWritable.

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

Indicates whether the model supports content modifications made via applyStyle(), replace(), undo(), redo() methods.

Note that even when this method returns false, the model itself may still update its content and fire the change events as a response, for example, to changes in its backing data storage.

Returns:boolean

always returns false

Annotations
@Override
removeRangeback to summary
protected void removeRange(TextPos start, TextPos end)

Implements abstract jfx.incubator.scene.control.richtext.model.StyledTextModel.removeRange.

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

Removes the specified text range. This method gets called only if the model is editable. The caller guarantees that start precedes end.

Annotations
@Override
setParagraphStyleback to summary
protected final void setParagraphStyle(int ix, StyleAttributeMap a)

Implements abstract jfx.incubator.scene.control.richtext.model.StyledTextModel.setParagraphStyle.

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

Replaces the paragraph styles in the specified paragraph.

Annotations
@Override