org.eclipse.nebula.widgets.nattable.export
Class FileOutputStreamProvider

java.lang.Object
  extended by 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 Summary
protected  String currentFileName
           
protected  String defaultFileName
           
protected  String[] defaultFilterExtensions
           
protected  String[] defaultFilterNames
           
 
Constructor Summary
FileOutputStreamProvider(String defaultFileName, String[] defaultFilterNames, String[] defaultFilterExtensions)
           
 
Method Summary
 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.
 File getResult()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

defaultFileName

protected String defaultFileName

defaultFilterNames

protected String[] defaultFilterNames

defaultFilterExtensions

protected String[] defaultFilterExtensions

currentFileName

protected String currentFileName
Constructor Detail

FileOutputStreamProvider

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

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).


Copyright © 2014. All rights reserved.