Class RtfFormatHandler
java.lang.Object
jfx.incubator.scene.control.richtext.model.DataFormatHandler
jfx.incubator.scene.control.richtext.model.RtfFormatHandler
-
Method Summary
Modifier and TypeMethodDescriptioncopy
(StyledTextModel model, StyleResolver resolver, TextPos start, TextPos end) Creates an object to be put into the Clipboard for the given text range.createStyledInput
(String text, StyleAttributeMap attr) Creates a StyledInput for the given input string.static final RtfFormatHandler
Returns the singleton instance ofRtfFormatHandler
.void
save
(StyledTextModel model, StyleResolver resolver, TextPos start, TextPos end, OutputStream out) Save the text range in the handler's format to the output stream (e.g.Methods declared in class jfx.incubator.scene.control.richtext.model.DataFormatHandler
getDataFormat
-
Method Details
-
getInstance
Returns the singleton instance ofRtfFormatHandler
.- Returns:
- the singleton instance of
RtfFormatHandler
-
createStyledInput
Description copied from class:DataFormatHandler
Creates a StyledInput for the given input string. When pasting, the caller may pass the style attributesattr
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).- Specified by:
createStyledInput
in classDataFormatHandler
- Parameters:
text
- the input stringattr
- the style attributes (can be null)- Returns:
- the StyledInput
- Throws:
IOException
- when operation is not supported or an I/O error occurs
-
copy
public Object copy(StyledTextModel model, StyleResolver resolver, TextPos start, TextPos end) throws IOException Description copied from class:DataFormatHandler
Creates an object to be put into the Clipboard for the given text range. The caller must guarantee that thestart
precedes theend
position.Typically, the implementation creates an instance of
StyledOutput
and callsStyledTextModel.export(TextPos, TextPos, StyledOutput)
method.- Specified by:
copy
in classDataFormatHandler
- Parameters:
model
- source modelresolver
- view-specific style resolverstart
- start text positionend
- end text position- Returns:
- an object to be placed to the Clipboard
- Throws:
IOException
- when an I/O error occurs
-
save
public void save(StyledTextModel model, StyleResolver resolver, TextPos start, TextPos end, OutputStream out) throws IOException Description copied from class:DataFormatHandler
Save the text range in the handler's format to the output stream (e.g. save to file). The caller must guarantee that thestart
precedes theend
position. It is the responsibility of the caller to close theOutputStream
.Typically, the implementation creates an instance of
StyledOutput
and callsStyledTextModel.export(TextPos, TextPos, StyledOutput)
method.- Specified by:
save
in classDataFormatHandler
- Parameters:
model
- source modelresolver
- view-specific style resolverstart
- start text positionend
- end text positionout
- targetOutputStream
- Throws:
IOException
- when an I/O error occurs
-