be.ugent.caagt.swirl.actions

Class FileOpenAction


public abstract class FileOpenAction
extends FileAction

Abstract super class for actions that allow files to be loaded.

Clients should at least override openFile(File).

Field Summary

Fields inherited from class be.ugent.caagt.swirl.actions.FileAction

fileChooser, parent

Constructor Summary

FileOpenAction(Window parent, boolean multipleAllowed, FileFilter... filters)
Create an action of this type

Method Summary

void
dialogApproved()
Invoke openFile(File) on all files chosen.
protected abstract void
openFile(File file)
Called for every file selected by the user.
protected int
showDialog()
Shows the file chooser open dialog.

Methods inherited from class be.ugent.caagt.swirl.actions.FileAction

actionPerformed, createFileChooser, dialogApproved, dialogCanceled, dialogClosed, showDialog

Constructor Details

FileOpenAction

public FileOpenAction(Window parent,
                      boolean multipleAllowed,
                      FileFilter... filters)
Create an action of this type
Parameters:
parent - Parent window for the file chooser dialog
multipleAllowed - Indicates whether the user is allowed to select more than a single file at the time
filters - File filters for the file chooser dialog

Method Details

dialogApproved

public void dialogApproved()
Invoke openFile(File) on all files chosen.
Overrides:
dialogApproved in interface FileAction

openFile

protected abstract void openFile(File file)
Called for every file selected by the user. Must be overridden by clients.

showDialog

protected int showDialog()
Shows the file chooser open dialog.
Overrides:
showDialog in interface FileAction