FileListFormatHandler (JavaFX 28)
Description: declaration: module: jfx.incubator.richtext, package: jfx.incubator.scene.control.richtext.model, class: FileListFormatHandler

# Class FileListFormatHandler

java.lang.Object
jfx.incubator.scene.control.richtext.model.DataFormatHandler
jfx.incubator.scene.control.richtext.model.FileListFormatHandler

public class FileListFormatHandler extends DataFormatHandler
Facilitates importing of file lists into the RichTextModel.

Since:
  27

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Object`
  `copy(StyledTextModel model, StyleResolver r, TextPos start, TextPos end)`
  Creates an object to be put into the Clipboard for the given text range.
  `StyledInput`
  `createStyledInput(Object input, StyleAttributeMap attr)`
  Creates a StyledInput for the given input data.
  `static final FileListFormatHandler`
  `getInstance()`
  Returns the singleton instance of `FileListFormatHandler`.
  `void`
  `save(StyledTextModel model, StyleResolver r, 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 DataFormatHandler

  `getDataFormat`

  ### Methods declared in class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Method Details

  - ### getInstance

    public static final FileListFormatHandler getInstance()
    Returns the singleton instance of `FileListFormatHandler`.
    Returns:
      the singleton instance of `FileListFormatHandler`

  - ### createStyledInput

    public StyledInput createStyledInput(Object input, StyleAttributeMap attr) throws IOException
    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>`.

    Specified by:
      `createStyledInput` in class `DataFormatHandler`
    Parameters:
      `input` - the input data, never null
      `attr` - 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 r, 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 the `start` precedes the `end` position.

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

    Specified by:
      `copy` in class `DataFormatHandler`
    Parameters:
      `model` - source model
      `r` - view-specific style resolver
      `start` - start text position
      `end` - 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 r, 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 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.

    Specified by:
      `save` in class `DataFormatHandler`
    Parameters:
      `model` - source model
      `r` - view-specific style resolver
      `start` - start text position
      `end` - end text position
      `out` - target `OutputStream`
    Throws:
      `IOException` - when an I/O error occurs