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.Charset, 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
source model
m
,
StyleResolver
view-specific style resolver
resolver
,
TextPos
start text position
start
,
TextPos
end text position
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
the input string
text
,
StyleAttributeMap
the style attributes (can be null)
attr
)

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

Creates a StyledInput for the given input string.

public static final PlainTextFormatHandler

Returns:

the singleton instance of PlainTextFormatHandler
getInstance
()

Returns the singleton instance of PlainTextFormatHandler.

public void
save(StyledTextModel
source model
m
,
StyleResolver
view-specific style resolver
resolver
,
TextPos
start text position
start
,
TextPos
end text position
end
,
OutputStream
target 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.

Parameters
m:StyledTextModel

source model

resolver:StyleResolver

view-specific style resolver

start:TextPos

start text position

end:TextPos

end text position

Returns:Object

an object to be placed to the Clipboard

Annotations
@Override
Exceptions
IOException:
when an I/O error occurs
createStyledInputback to summary
public StyledInput createStyledInput(String text, 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 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).

Parameters
text:String

the input string

attr:StyleAttributeMap

the style attributes (can be null)

Returns:StyledInput

the StyledInput

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.

Parameters
m:StyledTextModel

source model

resolver:StyleResolver

view-specific style resolver

start:TextPos

start text position

end:TextPos

end text position

out:OutputStream

target OutputStream

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