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 aFileDialog
on requesting an OutputStream, to let a user specify the location to write a file.
-
-
Field Summary
Fields Modifier and Type Field Description protected String
currentFileName
protected String
defaultFileName
protected String[]
defaultFilterExtensions
protected String[]
defaultFilterNames
protected int
extFilterIndex
-
Constructor Summary
Constructors Constructor Description FileOutputStreamProvider(String defaultFileName, String[] defaultFilterNames, String[] defaultFilterExtensions)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getExtensionFilterIndex()
Extension filter index is >= 0 if there is a selected one in the file dialog.OutputStream
getOutputStream(org.eclipse.swt.widgets.Shell shell)
Opens aFileDialog
to let a user choose the location to write the export to, and returns the correspondingPrintStream
to that file.File
getResult()
-
-
-
Method Detail
-
getOutputStream
public OutputStream getOutputStream(org.eclipse.swt.widgets.Shell shell)
Opens aFileDialog
to let a user choose the location to write the export to, and returns the correspondingPrintStream
to that file.- Specified by:
getOutputStream
in interfaceIOutputStreamProvider
- 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 interfaceIOutputStreamProvider
- 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
-
-