org.pietschy.command.file
Class AbstractFileOpenCommand
- ActionCommandExecutor
public abstract class AbstractFileOpenCommand
The command provides generic file open behaviour. One execution, the command will display
a
JFileChooser
and if the selection is successful
performOpen(File[])
will be
invoked with the selected files. Subclasses must implement
performOpen(File[])
to implement
the required behaviour.
Subclasses can change the default settings by overriding
AbstractFileOpenCommand
and configuring
appropriately.
boolean | isMultiselectionEnabled() - Checks if multiple selection is enabled.
|
protected void | performFileAction(File[] files, JFileChooser chooser, Window invoker)
|
protected abstract void | performOpen(File[] files) - This method is called when the user selects one or more files to open.
|
void | setMultiselectionEnabled(boolean multiselectionEnabled) - Configures if the
JFileChooser allows multiple selection.
|
protected int | showChooserDialog(JFileChooser chooser, Window invoker)
|
afterExecute , beforeExecute , confirmProceed , getDefaultFileFilter , getFileChooser , handleCancel , handleError , handleExecute , isAcceptAllFileFilterUsed , isCenterOnInvoker , isRememberLastFilter , performFileAction , setAcceptAllFileFilterUsed , setCenterOnInvoker , setDefaultFileFilter , setRememberLastFilter , showChooserDialog |
addCommandListener , addInterceptor , areEqual , attach , configureButtonStates , detach , execute , execute , getActionAdapter , getActionAdapter , getActionCommand , getActionEvent , getHint , getHint , getHints , getInvoker , getInvokerWindow , getModifiers , handleExecute , installShortCut , installShortCut , postExecute , preExecute , putHint , putHints , removeCommandListener , removeInterceptor , requestDefautIn , setActionCommand , uninstallShortCut , uninstallShortCut |
addFace , addHoverListener , addNewFace , addNotify , addPropertyChangeListener , addPropertyChangeListener , attach , buttonIterator , configureButtonAppearance , configureButtonAppearances , configureButtonAppearances , configureButtonStates , createButton , createButton , createButton , createButton , createMenuItem , createMenuItem , createMenuItem , createMenuItem , detach , export , faceExists , fireHoverEnded , fireHoverStarted , getAccelerator , getAlternativeFaceNames , getButtonFactory , getButtonIn , getCommandManager , getDefaultFace , getDefaultFace , getDescription , getFace , getFace , getIcon , getId , getLongDescription , getMenuFactory , getMnemonic , getMnemonicIndex , getProperty , getProperty , getPropertyNames , getSelectedIcon , getText , getTextPosition , getToolbarFactory , initCommandManager , installFace , isAnonymous , isAttachedTo , isEnabled , isVisible , putProperty , removeHoverListener , removeNotify , removePropertyChangeListener , removePropertyChangeListener , requestFocusIn , setAccelerator , setButtonFactory , setDescription , setEnabled , setIcon , setLongDescription , setMenuFactory , setMnemonic , setMnemonicIndex , setSelectedIcon , setText , setTextPosition , setToolbarFactory , setVisible , toString |
AbstractFileOpenCommand
public AbstractFileOpenCommand(String id,
FileFilter filter)
Creates a new command with the specified id and FileFilter
. This command is bound
to the default command manager.
id
- the id of the command.filter
- the FileFilter
to use.
AbstractFileOpenCommand
public AbstractFileOpenCommand(String id,
FileFilter[] filters)
Creates a new command with the specified id and list of FileFilter
. This command is
bound to the default command manager.
id
- the id of the command.filters
- a list of FileFilter
instances to use.
AbstractFileOpenCommand
public AbstractFileOpenCommand(CommandManager manager,
String id,
FileFilter filter)
Creates a new command with the specified id and FileFilter
id
- the id of the command.filter
- the FileFilter
to use.
AbstractFileOpenCommand
public AbstractFileOpenCommand(CommandManager manager,
String id,
FileFilter[] filters)
Creates a new command with the specified id and list of FileFilter
id
- the id of the command.filters
- a list of FileFilter
instances to use.
isMultiselectionEnabled
public boolean isMultiselectionEnabled()
Checks if multiple selection is enabled.
- true if multiple selection is enabled.
performOpen
protected abstract void performOpen(File[] files)
This method is called when the user selects one or more files to open. Subclasses must
implement this method to perform the required behaviour.
If
multiple selection
is disabled, the file list will
contain only one file.
files
- the files that the user has selected.
setMultiselectionEnabled
public void setMultiselectionEnabled(boolean multiselectionEnabled)
Configures if the JFileChooser
allows multiple selection.
multiselectionEnabled
- true to allow multiple file selection, false
otherwise.