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

public Class PlainTextFormatHandler

extends DataFormatHandler
Class Inheritance
Imports
java.io.IOException, .OutputStream, java.nio.charset.StandardCharsets, javafx.scene.input.DataFormat, com.sun.jfx.incubator.scene.control.richtext.StringBuilderStyledOutput, jfx.incubator.scene.control.richtext.StyleResolver, .TextPos

DataFormatHandler which operates with plain text.
Since
24

Field Summary

Modifier and TypeField and Description
private static final PlainTextFormatHandler

Constructor Summary

AccessConstructor and Description
private
PlainTextFormatHandler()

The constructor.

Method Summary

Modifier and TypeMethod and Description
public Object
copy(StyledTextModel m, StyleResolver resolver, TextPos start, TextPos end)

Implements abstract jfx.incubator.scene.control.richtext.model.DataFormatHandler.copy.

Creates an object to be put into the Clipboard for the given text range.

public StyledInput
createStyledInput(Object input, StyleAttributeMap attr)

Implements abstract jfx.incubator.scene.control.richtext.model.DataFormatHandler.createStyledInput.

Creates a StyledInput for the given input data.

public static final PlainTextFormatHandler

Returns:

the singleton instance of PlainTextFormatHandler
getInstance
()

Returns the singleton instance of PlainTextFormatHandler.

public void
save(StyledTextModel m, StyleResolver resolver, TextPos start, TextPos end, OutputStream out)

Implements abstract jfx.incubator.scene.control.richtext.model.DataFormatHandler.save.

Save the text range in the handler's format to the output stream (e.g. save to file).

Inherited from jfx.incubator.scene.control.richtext.model.DataFormatHandler:
getDataFormat

Field Detail

instanceback to summary
private static final PlainTextFormatHandler instance

Constructor Detail

PlainTextFormatHandlerback to summary
private PlainTextFormatHandler()

The constructor.

Method Detail

copyback to summary
public Object copy(StyledTextModel m, StyleResolver resolver, TextPos start, TextPos end) throws IOException

Implements abstract jfx.incubator.scene.control.richtext.model.DataFormatHandler.copy.

Doc from jfx.incubator.scene.control.richtext.model.DataFormatHandler.copy.

Creates an object to be put into the Clipboard for the given text range. The caller must guarantee that the start precedes the end position.

Typically, the implementation creates an instance of StyledOutput and calls StyledTextModel#export(TextPos, TextPos, StyledOutput) method.

Annotations
@Override
Exceptions
IOException:
when an I/O error occurs
createStyledInputback to summary
public StyledInput createStyledInput(Object input, StyleAttributeMap attr)

Implements abstract jfx.incubator.scene.control.richtext.model.DataFormatHandler.createStyledInput.

Doc from jfx.incubator.scene.control.richtext.model.DataFormatHandler.createStyledInput.

Creates a StyledInput for the given input data. When pasting, the caller may pass the style attributes attr at the insertion point. This argument may be used by the implementation if the format contains no styles on its own (for example, in the plain text format case).

Annotations
@Override
getInstanceback to summary
public static final PlainTextFormatHandler getInstance()

Returns the singleton instance of PlainTextFormatHandler.

Returns:PlainTextFormatHandler

the singleton instance of PlainTextFormatHandler

saveback to summary
public void save(StyledTextModel m, StyleResolver resolver, TextPos start, TextPos end, OutputStream out) throws IOException

Implements abstract jfx.incubator.scene.control.richtext.model.DataFormatHandler.save.

Doc from jfx.incubator.scene.control.richtext.model.DataFormatHandler.save.

Save the text range in the handler's format to the output stream (e.g. save to file). The caller must guarantee that the start precedes the end position. It is the responsibility of the caller to close the OutputStream.

Typically, the implementation creates an instance of StyledOutput and calls StyledTextModel#export(TextPos, TextPos, StyledOutput) method.

Annotations
@Override
Exceptions
IOException:
when an I/O error occurs