Class FileOutputStreamProvider

java.lang.Object
org.eclipse.nebula.widgets.nattable.export.FileOutputStreamProvider
All Implemented Interfaces:
IOutputStreamProvider

public class FileOutputStreamProvider extends Object implements IOutputStreamProvider
Implementation of IOutputStreamProvider that will open a FileDialog on requesting an OutputStream, to let a user specify the location to write a file.
  • Field Details

    • defaultFileName

      protected String defaultFileName
    • defaultFilterNames

      protected String[] defaultFilterNames
    • defaultFilterExtensions

      protected String[] defaultFilterExtensions
    • currentFileName

      protected String currentFileName
    • extFilterIndex

      protected int extFilterIndex
      Since:
      1.5
  • Constructor Details

    • FileOutputStreamProvider

      public FileOutputStreamProvider(String defaultFileName, String[] defaultFilterNames, String[] defaultFilterExtensions)
  • Method Details

    • getOutputStream

      public OutputStream getOutputStream(org.eclipse.swt.widgets.Shell shell)
      Opens a FileDialog to let a user choose the location to write the export to, and returns the corresponding PrintStream to that file.
      Specified by:
      getOutputStream in interface IOutputStreamProvider
      Parameters:
      shell - The current active Shell. Needed to add support for user interactions on specifying the OutputStream for example by opening a dialog.
      Returns:
      The OutputStream to perform write operations to.
    • getResult

      public File getResult()
      Specified by:
      getResult in interface IOutputStreamProvider
      Returns:
      The result that is produced by this IOutputStreamProvider. Usually this is the place where the OutputStream that is produced by this provider is pointing to (e.g. the file to which the OutputStream points to).
    • getExtensionFilterIndex

      public int getExtensionFilterIndex()
      Extension filter index is >= 0 if there is a selected one in the file dialog. Extension filter index is equal -1 if the file dialog is not opened or no extension is selected.
      Returns:
      The extension filter index selected in the FileDialog.
      Since:
      1.5