dsto.dfc.swing.persistence
Class BasicSerializeCommand

java.lang.Object
  extended by dsto.dfc.swing.commands.AbstractCommand
      extended by dsto.dfc.swing.commands.AbstractMutableCommand
          extended by dsto.dfc.swing.commands.BasicFileSaveCommand
              extended by dsto.dfc.swing.persistence.BasicSerializeCommand
All Implemented Interfaces:
Command, Iconic, Copyable, PropertyEventSource, ActionListener, Cloneable, EventListener

public class BasicSerializeCommand
extends BasicFileSaveCommand

Base implementation for commands that save objects using Serializer. The UI is customized by initFileChooser() which sets up an accessory panel (SerializeAccessoryPanel). The saveFile () method will usually call save () to save an object using the options specified in the chooser.

Version:
$Revision$
See Also:
SerializeAccessoryPanel

Field Summary
 
Fields inherited from class dsto.dfc.swing.commands.BasicFileSaveCommand
owner
 
Fields inherited from class dsto.dfc.swing.commands.AbstractMutableCommand
listeners
 
Fields inherited from class dsto.dfc.swing.commands.AbstractCommand
displayName, icon
 
Fields inherited from interface dsto.dfc.swing.icons.Iconic
NULL_ICON
 
Constructor Summary
BasicSerializeCommand()
           
BasicSerializeCommand(Component owner)
           
 
Method Summary
protected  void initFileChooser(JFileChooser chooser)
          Sets up the accessory panel.
protected  void save(Object object, JFileChooser chooser)
          Save an object using the settings in the chooser.
protected  void save(Object object, JFileChooser chooser, File file)
          Save an object to a specified file, using the option settings in the chooser.
 
Methods inherited from class dsto.dfc.swing.commands.BasicFileSaveCommand
dialogCancelled, execute, getAccelerator, getDescription, getGroupInView, getMnemonic, getName, handleError, handleError, isInteractive, saveFile
 
Methods inherited from class dsto.dfc.swing.commands.AbstractMutableCommand
addPropertyChangeListener, clone, isEnabled, removePropertyChangeListener, setEnabled, setIcon
 
Methods inherited from class dsto.dfc.swing.commands.AbstractCommand
actionPerformed, canReplace, getDefaultDisplayName, getDisplayName, getIcon, getLargeIcon, getLogString, setDisplayName
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicSerializeCommand

public BasicSerializeCommand()

BasicSerializeCommand

public BasicSerializeCommand(Component owner)
Method Detail

initFileChooser

protected void initFileChooser(JFileChooser chooser)
Sets up the accessory panel.

Overrides:
initFileChooser in class BasicFileSaveCommand

save

protected void save(Object object,
                    JFileChooser chooser)
             throws FileNotFoundException,
                    IOException
Save an object using the settings in the chooser.

Parameters:
object - The object to save.
chooser - The chooser.
Throws:
FileNotFoundException
IOException

save

protected void save(Object object,
                    JFileChooser chooser,
                    File file)
             throws FileNotFoundException,
                    IOException
Save an object to a specified file, using the option settings in the chooser.

Parameters:
object - The object to save.
chooser - The chooser.
file - The file to save to.
Throws:
FileNotFoundException
IOException


Copyright © 2008 Commonwealth of Australia