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

public Class FileListFormatHandler

extends DataFormatHandler
Class Inheritance
Imports
java.io.ByteArrayInputStream, .File, .IOException, .OutputStream, java.nio.file.Files, java.util.Collections, .List, javafx.scene.image.Image, javafx.scene.input.DataFormat, com.sun.jfx.incubator.scene.control.richtext.EmbeddedImageHelper, com.sun.jfx.incubator.scene.control.richtext.util.RichUtils, jfx.incubator.scene.control.richtext.StyleResolver, .TextPos

Facilitates importing of file lists into the RichTextModel.
Since
27

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private static final FileListFormatHandler

Constructor Summary

AccessConstructor and Description
private
FileListFormatHandler()

Constructor.

Method Summary

Modifier and TypeMethod and Description
public Object
copy(StyledTextModel model, StyleResolver r, 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 FileListFormatHandler

Returns:

the singleton instance of FileListFormatHandler
getInstance
()

Returns the singleton instance of FileListFormatHandler.

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

Constructor Detail

FileListFormatHandlerback to summary
private FileListFormatHandler()

Constructor.

Method Detail

copyback to summary
public Object copy(StyledTextModel model, StyleResolver r, 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) 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 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).

The type of input must be List<File>.

Annotations
@Override
Exceptions
IOException:
when operation is not supported or an I/O error occurs
getInstanceback to summary
public static final FileListFormatHandler getInstance()

Returns the singleton instance of FileListFormatHandler.

Returns:FileListFormatHandler

the singleton instance of FileListFormatHandler

saveback to summary
public void save(StyledTextModel model, StyleResolver r, 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
jfx.incubator.scene.control.richtext.model back to summary

private Class FileListFormatHandler.FileListStyledInput

extends Object
implements StyledInput
Class Inheritance
  • java.lang.Object
  • jfx.incubator.scene.control.richtext.model.FileListFormatHandler.FileListStyledInput
All Implemented Interfaces
jfx.incubator.scene.control.richtext.model.StyledInput, java.io.Closeable, java.lang.AutoCloseable

Field Summary

Modifier and TypeField and Description
private final List<File>
private int

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
close()

Implements java.io.Closeable.close.

Closes this stream and releases any system resources associated with it.

public StyledSegment
nextSegment()

Implements jfx.incubator.scene.control.richtext.model.StyledInput.nextSegment.

Returns the next segment, or null if no more segments.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

filesback to summary
private final List<File> files
indexback to summary
private int index

Constructor Detail

FileListStyledInputback to summary
pack-priv FileListStyledInput(List<File> files)

Method Detail

closeback to summary
public void close() throws IOException

Implements java.io.Closeable.close.

Doc from java.io.Closeable.close.

Closes this stream and releases any system resources associated with it. If the stream is already closed then invoking this method has no effect.

As noted in AutoCloseable#close(), cases where the close may fail require careful attention. It is strongly advised to relinquish the underlying resources and to internally mark the Closeable as closed, prior to throwing the IOException.

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs
nextSegmentback to summary
public StyledSegment nextSegment()

Implements jfx.incubator.scene.control.richtext.model.StyledInput.nextSegment.

Doc from jfx.incubator.scene.control.richtext.model.StyledInput.nextSegment.

Returns the next segment, or null if no more segments.

Annotations
@Override