org.faceless.pdf2.viewer2

## Class Exporter.ExporterTask

- java.lang.Object
- - org.faceless.pdf2.viewer2.util.LongRunningTask
  - - org.faceless.pdf2.viewer2.Exporter.ExporterTask

- Enclosing class:
    Exporter

      public abstract class Exporter.ExporterTask
      extends LongRunningTask

  This class is a `LongRunningTask` that can be run to save a PDF to an OutputStream. Subclasses need to implement the `savePDF()` method, which should save the PDF to the OutputStream supplied in the `Exporter.getExporter(org.faceless.pdf2.viewer2.DocumentPanel, org.faceless.pdf2.PDF, javax.swing.JComponent, java.io.OutputStream)` method.

  This code is copyright the Big Faceless Organization. You're welcome to use, modify and distribute it in any form in your own projects, provided those projects continue to make use of the Big Faceless PDF library.

  Since:
    2.10.2

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ExporterTask()`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `completed()` Called when the save has completed - by default, a no-op.
    `void` | `run()` Run the current task.
    `abstract void` | `savePDF()` Save the PDF to the OutputStream

    - ### Methods inherited from class org.faceless.pdf2.viewer2.util.LongRunningTask

      `addPropertyChangeListener, cancel, getProgress, isCancellable, isCancelled, isModal, isRunning, removePropertyChangeListener, setCancellable, setModal, start, start`

    - ### Methods inherited from class java.lang.Object

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

- - ### Constructor Detail

    - #### ExporterTask

          public ExporterTask()

  - ### Method Detail

    - #### run

          public void run()
                   throws IOException

      Description copied from class: `LongRunningTask`
      Run the current task. Called by `LongRunningTask.start(javax.swing.JComponent, java.lang.String)`, this method should typically not be called directly.
      Specified by:
        `run` in class `LongRunningTask`
      Throws:
        `IOException`

    - #### savePDF

          public abstract void savePDF()
                                throws IOException

      Save the PDF to the OutputStream
      Throws:
        `IOException`

    - #### completed

          public void completed()

      Called when the save has completed - by default, a no-op. Both this and the `Exporter.completed()` method in the `Exporter` will be called on completion, but it may be easier for subclasses to override the other method.
      Since:
        2.11.2

Copyright © 2001-2015 Big Faceless Organization