be.ugent.caagt.swirl.actions
Class FileOpenAction

java.lang.Object
  extended by javax.swing.AbstractAction
      extended by be.ugent.caagt.swirl.actions.FileAction
          extended by be.ugent.caagt.swirl.actions.FileOpenAction
All Implemented Interfaces:
java.awt.event.ActionListener, java.io.Serializable, java.lang.Cloneable, java.util.EventListener, javax.swing.Action

public abstract class FileOpenAction
extends FileAction

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

Clients should at least override openFile(java.io.File).

See Also:
Serialized Form

Field Summary
 
Fields inherited from class be.ugent.caagt.swirl.actions.FileAction
fileChooser, parent
 
Fields inherited from class javax.swing.AbstractAction
changeSupport, enabled
 
Fields inherited from interface javax.swing.Action
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON
 
Constructor Summary
FileOpenAction(java.awt.Window parent, boolean multipleAllowed, javax.swing.filechooser.FileFilter... filters)
          Create an action of this type
 
Method Summary
 void dialogApproved()
          Invoke openFile(java.io.File) on all files chosen.
protected abstract  void openFile(java.io.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, dialogCanceled, dialogClosed
 
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileOpenAction

public FileOpenAction(java.awt.Window parent,
                      boolean multipleAllowed,
                      javax.swing.filechooser.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 Detail

openFile

protected abstract void openFile(java.io.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.

Specified by:
showDialog in class FileAction

dialogApproved

public void dialogApproved()
Invoke openFile(java.io.File) on all files chosen.

Specified by:
dialogApproved in class FileAction