public class ConverterFileChooser extends WekaFileChooser
setCapabilitiesFilter(Capabilities)
,
Serialized FormWekaFileChooser.Factory, WekaFileChooser.FileChooserBookmarksPanel, WekaFileChooser.PropertiesHandler
Modifier and Type | Field and Description |
---|---|
static int |
LOADER_DIALOG
the loader dialog.
|
static int |
SAVER_DIALOG
the saver dialog.
|
static int |
UNHANDLED_DIALOG
unhandled type of dialog.
|
ACCEPT_ALL_FILE_FILTER_USED_CHANGED_PROPERTY, ACCESSORY_CHANGED_PROPERTY, APPROVE_BUTTON_MNEMONIC_CHANGED_PROPERTY, APPROVE_BUTTON_TEXT_CHANGED_PROPERTY, APPROVE_BUTTON_TOOL_TIP_TEXT_CHANGED_PROPERTY, APPROVE_OPTION, APPROVE_SELECTION, CANCEL_OPTION, CANCEL_SELECTION, CHOOSABLE_FILE_FILTER_CHANGED_PROPERTY, CONTROL_BUTTONS_ARE_SHOWN_CHANGED_PROPERTY, CUSTOM_DIALOG, DIALOG_TITLE_CHANGED_PROPERTY, DIALOG_TYPE_CHANGED_PROPERTY, DIRECTORIES_ONLY, DIRECTORY_CHANGED_PROPERTY, ERROR_OPTION, FILE_FILTER_CHANGED_PROPERTY, FILE_HIDING_CHANGED_PROPERTY, FILE_SELECTION_MODE_CHANGED_PROPERTY, FILE_SYSTEM_VIEW_CHANGED_PROPERTY, FILE_VIEW_CHANGED_PROPERTY, FILES_AND_DIRECTORIES, FILES_ONLY, MULTI_SELECTION_ENABLED_CHANGED_PROPERTY, OPEN_DIALOG, SAVE_DIALOG, SELECTED_FILE_CHANGED_PROPERTY, SELECTED_FILES_CHANGED_PROPERTY
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Constructor and Description |
---|
ConverterFileChooser()
onstructs a FileChooser pointing to the user's default directory.
|
ConverterFileChooser(java.io.File currentDirectory)
Constructs a FileChooser using the given File as the path.
|
ConverterFileChooser(java.lang.String currentDirectory)
Constructs a FileChooser using the given path.
|
Modifier and Type | Method and Description |
---|---|
Capabilities |
getCapabilitiesFilter()
returns the capabilities filter for the savers, can be null if all are
listed.
|
boolean |
getCoreConvertersOnly()
Returns whether only the hardcoded core converters are displayed.
|
boolean |
getFileMustExist()
Returns whether the selected file must exist (only open dialog).
|
AbstractFileLoader |
getLoader()
returns the loader that was chosen by the user, can be null in case the
user aborted the dialog or the save dialog was shown.
|
boolean |
getOverwriteWarning()
Returns whether a popup appears with a warning that the file already exists
(only save dialog).
|
AbstractFileSaver |
getSaver()
returns the saver that was chosen by the user, can be null in case the user
aborted the dialog or the open dialog was shown.
|
static void |
initDefaultFilters()
Initialize the default set of filters for loaders and savers
|
static void |
main(java.lang.String[] args)
For testing the file chooser.
|
void |
setCapabilitiesFilter(Capabilities value)
sets the capabilities that the savers must have.
|
void |
setCoreConvertersOnly(boolean value)
Whether to display only the hardocded core converters.
|
void |
setFileMustExist(boolean value)
Whether the selected file must exst (only open dialog).
|
void |
setOverwriteWarning(boolean value)
Whether a warning is popped up if the file that is to be saved already
exists (only save dialog).
|
int |
showDialog(java.awt.Component parent,
java.lang.String approveButtonText)
Pops a custom file chooser dialog with a custom approve button.
|
int |
showOpenDialog(java.awt.Component parent)
Pops up an "Open File" file chooser dialog.
|
int |
showSaveDialog(java.awt.Component parent)
Pops up an "Save File" file chooser dialog.
|
accept, addActionListener, addChoosableFileFilter, approveSelection, cancelSelection, changeToParentDirectory, ensureFileIsVisible, getAcceptAllFileFilter, getAccessibleContext, getAccessory, getActionListeners, getApproveButtonMnemonic, getApproveButtonText, getApproveButtonToolTipText, getChoosableFileFilters, getControlButtonsAreShown, getCurrentDirectory, getDescription, getDialogTitle, getDialogType, getDragEnabled, getFileFilter, getFileSelectionMode, getFileSystemView, getFileView, getIcon, getName, getSelectedFile, getSelectedFiles, getTypeDescription, getUI, getUIClassID, isAcceptAllFileFilterUsed, isDirectorySelectionEnabled, isFileHidingEnabled, isFileSelectionEnabled, isMultiSelectionEnabled, isTraversable, removeActionListener, removeChoosableFileFilter, rescanCurrentDirectory, resetChoosableFileFilters, setAcceptAllFileFilterUsed, setAccessory, setApproveButtonMnemonic, setApproveButtonMnemonic, setApproveButtonText, setApproveButtonToolTipText, setControlButtonsAreShown, setCurrentDirectory, setDialogTitle, setDialogType, setDragEnabled, setFileFilter, setFileHidingEnabled, setFileSelectionMode, setFileSystemView, setFileView, setMultiSelectionEnabled, setSelectedFile, setSelectedFiles, updateUI
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
public static final int UNHANDLED_DIALOG
public static final int LOADER_DIALOG
public static final int SAVER_DIALOG
public ConverterFileChooser()
public ConverterFileChooser(java.io.File currentDirectory)
currentDirectory
- the path to start inpublic ConverterFileChooser(java.lang.String currentDirectory)
currentDirectory
- the path to start inpublic static void initDefaultFilters()
public void setCapabilitiesFilter(Capabilities value)
value
- the minimum Capabilities the savers must havepublic Capabilities getCapabilitiesFilter()
public void setOverwriteWarning(boolean value)
value
- if true a warning will be popuppublic boolean getOverwriteWarning()
public void setFileMustExist(boolean value)
value
- if true the file must existpublic boolean getFileMustExist()
public void setCoreConvertersOnly(boolean value)
value
- if true only the core converters will be displayedm_CoreConvertersOnly
public boolean getCoreConvertersOnly()
m_CoreConvertersOnly
public int showDialog(java.awt.Component parent, java.lang.String approveButtonText)
showDialog
in class javax.swing.JFileChooser
parent
- the parent of this dialogapproveButtonText
- the text for the OK buttonpublic int showOpenDialog(java.awt.Component parent)
showOpenDialog
in class javax.swing.JFileChooser
parent
- the parent of this file chooserpublic int showSaveDialog(java.awt.Component parent)
showSaveDialog
in class javax.swing.JFileChooser
parent
- the parent of this file chooserpublic AbstractFileLoader getLoader()
public AbstractFileSaver getSaver()
public static void main(java.lang.String[] args) throws java.lang.Exception
args
- the commandline options - ignoredjava.lang.Exception
- if something goes wrong with loading/saving