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

public Class RtfFormatHandler

extends DataFormatHandler
Class Inheritance
Imports
java.io.IOException, .OutputStream, .OutputStreamWriter, .StringWriter, .Writer, java.nio.charset.Charset, javafx.scene.input.DataFormat, com.sun.jfx.incubator.scene.control.richtext.RtfStyledOutput, com.sun.jfx.incubator.scene.control.richtext.rtf.RTFReader, jfx.incubator.scene.control.richtext.StyleResolver, .TextPos

This DataFormatHandler provides export/import support for RTF format.
Since
24

Field Summary

Modifier and TypeField and Description
private static final RtfFormatHandler

Constructor Summary

AccessConstructor and Description
private
RtfFormatHandler()

The constructor

Method Summary

Modifier and TypeMethod and Description
public Object
copy(StyledTextModel model, 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(String text, StyleAttributeMap attr)

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

Creates a StyledInput for the given input string.

private void
export(StyledTextModel model, StyleResolver resolver, TextPos start, TextPos end, Writer wr)

public static final RtfFormatHandler

Returns:

the singleton instance of RtfFormatHandler
getInstance
()

Returns the singleton instance of RtfFormatHandler.

public void
save(StyledTextModel model, 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 RtfFormatHandler instance

Constructor Detail

RtfFormatHandlerback to summary
private RtfFormatHandler()

The constructor

Method Detail

copyback to summary
public Object copy(StyledTextModel model, 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(String text, StyleAttributeMap attr) throws IOException

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 string. 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
Exceptions
IOException:
when operation is not supported or an I/O error occurs
exportback to summary
private void export(StyledTextModel model, StyleResolver resolver, TextPos start, TextPos end, Writer wr) throws IOException
getInstanceback to summary
public static final RtfFormatHandler getInstance()

Returns the singleton instance of RtfFormatHandler.

Returns:RtfFormatHandler

the singleton instance of RtfFormatHandler

saveback to summary
public void save(StyledTextModel model, 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