be.ugent.caagt.swirl.actions
Class FileAction
AbstractAction
be.ugent.caagt.swirl.actions.FileAction
public abstract class FileAction
extends AbstractAction
Common (abstract) super class of
FileOpenAction
and
FileSaveAction
. Clients should consider extending one of those
classes instead of this one.
protected JFileChooser | fileChooser - The file chooser which is used by this action.
|
protected Window | parent - Parent window for any dialogs which need to be shown, in particular
the file chooser dialog.
|
FileAction(Window parent, FileFilter... filters) - Create an action of this type
|
void | actionPerformed(ActionEvent e) - Shows the file chooser dialog and dispatches to the
appropriate
dialog... method depending on
the users choice
|
protected JFileChooser | createFileChooser() - Factory method which creates the file chooser at initialization time.
|
protected abstract void | dialogApproved() - Called when the dialog is approved.
|
protected void | dialogCanceled() - Called when the dialog is canceled.
|
protected void | dialogClosed() - Called when the dialog is dismissed.
|
protected abstract int | showDialog() - Shows the dialog appropriate for this type of file action
|
fileChooser
protected JFileChooser fileChooser
The file chooser which is used by this action.
parent
protected Window parent
Parent window for any dialogs which need to be shown, in particular
the file chooser dialog.
FileAction
public FileAction(Window parent,
FileFilter... filters)
Create an action of this type
parent
- Window which will be used as parent for
all dialogsfilters
- File filters for the file chooser dialog
actionPerformed
public void actionPerformed(ActionEvent e)
Shows the file chooser dialog and dispatches to the
appropriate dialog...
method depending on
the users choice
createFileChooser
protected JFileChooser createFileChooser()
Factory method which creates the file chooser at initialization time.
to initialize its 'approve' button.
dialogApproved
protected abstract void dialogApproved()
Called when the dialog is approved.
dialogCanceled
protected void dialogCanceled()
Called when the dialog is canceled. This implementation is empty.
dialogClosed
protected void dialogClosed()
Called when the dialog is dismissed. This implementation calls
dialogCanceled()
.
showDialog
protected abstract int showDialog()
Shows the dialog appropriate for this type of file action