public abstract class ExportFileType extends Object implements Comparable<Object>
Constructor and Description |
---|
ExportFileType() |
Modifier and Type | Method and Description |
---|---|
static File |
adjustExtension(File file,
String preferredExtension,
String[] acceptableExtensions)
Deprecated.
use adjustExtension(File, String, String[], String)
|
static File |
adjustExtension(File file,
String preferredExtension,
String[] acceptableExtensions,
String extension)
Change the extension of a file if it is not of the appropriate
type.
|
File |
adjustFilename(File file,
Properties properties)
Gives the accessory the chance to change the output filename.
|
File |
adjustFilename(File file,
String extension,
Properties properties)
Gives the accessory the chance to change the output filename.
|
boolean |
applyChangedOptions(JPanel optionPanel,
Properties options)
Sets any changed options from the optionPanel to the properties object.
|
static boolean |
checkExtension(File file,
String[] acceptableExtensions)
A utility function that checks a file's extension.
|
int |
compareTo(Object o)
Compares to other exportfiletype in alphabetical order on the description string.
|
JPanel |
createOptionPanel(Properties options)
Returns a panel which allows to user to set options associated
with this particular output format.
|
abstract void |
exportToFile(File file,
Component[] target,
Component parent,
Properties properties,
String creator)
Writes the all given components out in the format of this file
type.
|
void |
exportToFile(File file,
Component target,
Component parent,
Properties properties,
String creator)
Writes the given component out in the format of this file
type.
|
abstract void |
exportToFile(OutputStream os,
Component[] target,
Component parent,
Properties properties,
String creator)
Writes the all given components out in the format of this file
type.
|
void |
exportToFile(OutputStream os,
Component target,
Component parent,
Properties properties,
String creator)
Writes the given component out in the format of this file
type.
|
boolean |
fileHasValidExtension(File file)
This method returns true if the given file has an extension
which can be handled by this file type.
|
abstract String |
getDescription()
Returns a short description of the format
|
static List<ExportFileType> |
getExportFileTypes()
Return all registered ExportFileTypes
|
static List<ExportFileType> |
getExportFileTypes(String format)
Return all registered ExportFileTypes for a certain format.
|
static String |
getExtension(File file,
String[] acceptableExtensions)
Returns the file's (longest) valid extension (ps, eps, heprep.zip), or "".
|
abstract String[] |
getExtensions()
Returns an array of possible extensions for the format, the first of
which is the preferred extension
|
String |
getFileExtension(File file)
Returns the longest valid extension on this filename, or "".
|
FileFilter |
getFileFilter()
Returns a file filter which selects only those files which
correspond to a particular file type.
|
abstract String[] |
getMIMETypes()
Return the MIME-type(s) for this format, the first of which is the
preferred MIME type.
|
boolean |
hasOptionPanel()
Returns true if this format has extra options.
|
boolean |
isMultipageCapable()
Returns true if this ExportFileType can handle multipage output.
|
static void |
setClassLoader(ClassLoader loader)
Sets the classloader to be used for loading ExportFileTypes
|
public abstract String getDescription()
public abstract String[] getExtensions()
public abstract String[] getMIMETypes()
public void exportToFile(OutputStream os, Component target, Component parent, Properties properties, String creator) throws IOException
IOException
public void exportToFile(File file, Component target, Component parent, Properties properties, String creator) throws IOException
IOException
public abstract void exportToFile(OutputStream os, Component[] target, Component parent, Properties properties, String creator) throws IOException
IOException
public abstract void exportToFile(File file, Component[] target, Component parent, Properties properties, String creator) throws IOException
IOException
public int compareTo(Object o)
compareTo
in interface Comparable<Object>
public boolean hasOptionPanel()
public JPanel createOptionPanel(Properties options)
public boolean applyChangedOptions(JPanel optionPanel, Properties options)
public FileFilter getFileFilter()
public File adjustFilename(File file, Properties properties)
public File adjustFilename(File file, String extension, Properties properties)
public String getFileExtension(File file)
public boolean fileHasValidExtension(File file)
public boolean isMultipageCapable()
public static void setClassLoader(ClassLoader loader)
public static List<ExportFileType> getExportFileTypes()
public static List<ExportFileType> getExportFileTypes(String format)
public static String getExtension(File file, String[] acceptableExtensions)
public static boolean checkExtension(File file, String[] acceptableExtensions)
public static File adjustExtension(File file, String preferredExtension, String[] acceptableExtensions)
Copyright © 2014. All rights reserved.