org.graffiti.managers
Class DefaultIOManager

java.lang.Object
  extended by org.graffiti.managers.DefaultIOManager
All Implemented Interfaces:
IOManager, PluginManagerListener

public class DefaultIOManager
extends Object
implements IOManager

Handles the editor's IO serializers.

Version:
$Revision: 5779 $

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.graffiti.managers.IOManager
IOManager.IOManagerListener
 
Constructor Summary
DefaultIOManager(Preferences prefs)
          Constructs a new io manager.
 
Method Summary
 void addInputSerializer(InputSerializer is)
          Registers the given input serializer.
 void addListener(IOManager.IOManagerListener ioManagerListener)
          Adds the given IOManagerListener to the list of io manager listeners.
 void addOutputSerializer(OutputSerializer os)
          Registers the given output serializer.
 JFileChooser createOpenFileChooser()
          Modifies the given file chooser by registering file extensions from the input serializers.
 JFileChooser createSaveFileChooser()
          Creates and returns a file open chooser dialog with the registered file extensions from the output serializers.
 InputSerializer getInputSerializer(String ext)
          Creates an instance of an input serializer from the given extension.
 OutputSerializer getOutputSerializer(String ext)
          Creates an instance of an output serializer from the given extension.
 boolean hasInputSerializer()
          Returns true, if the io manager has a registered input manager.
 boolean hasOutputSerializer()
          Returns true, if the io manager has a registered output manager.
 void pluginAdded(GenericPlugin plugin, PluginDescription desc)
          Called by the plugin manager, iff a plugin has been added.
 boolean removeListener(IOManager.IOManagerListener l)
          Returns true, if the given io manager listener was in the list of listeners and could be removed.
 void storeSelectedFolder(String path)
           
 String toString()
          Returns a string representation of the io manager.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefaultIOManager

public DefaultIOManager(Preferences prefs)
Constructs a new io manager.

Method Detail

addInputSerializer

public void addInputSerializer(InputSerializer is)
Description copied from interface: IOManager
Registers the given input serializer.

Specified by:
addInputSerializer in interface IOManager
Parameters:
is - the new serializer to add.

addListener

public void addListener(IOManager.IOManagerListener ioManagerListener)
Description copied from interface: IOManager
Adds the given IOManagerListener to the list of io manager listeners.

Specified by:
addListener in interface IOManager
Parameters:
ioManagerListener - the listener to add.

addOutputSerializer

public void addOutputSerializer(OutputSerializer os)
Description copied from interface: IOManager
Registers the given output serializer.

Specified by:
addOutputSerializer in interface IOManager
Parameters:
os - the new serializer to add.

getInputSerializer

public InputSerializer getInputSerializer(String ext)
                                   throws IllegalAccessException,
                                          InstantiationException
Description copied from interface: IOManager
Creates an instance of an input serializer from the given extension.

Specified by:
getInputSerializer in interface IOManager
Returns:
DOCUMENT ME!
Throws:
IllegalAccessException
InstantiationException

storeSelectedFolder

public void storeSelectedFolder(String path)
Specified by:
storeSelectedFolder in interface IOManager

createOpenFileChooser

public JFileChooser createOpenFileChooser()
Description copied from interface: IOManager
Modifies the given file chooser by registering file extensions from the input serializers.

Specified by:
createOpenFileChooser in interface IOManager
Returns:
DOCUMENT ME!

getOutputSerializer

public OutputSerializer getOutputSerializer(String ext)
                                     throws IllegalAccessException,
                                            InstantiationException
Description copied from interface: IOManager
Creates an instance of an output serializer from the given extension.

Specified by:
getOutputSerializer in interface IOManager
Returns:
DOCUMENT ME!
Throws:
IllegalAccessException
InstantiationException

createSaveFileChooser

public JFileChooser createSaveFileChooser()
Description copied from interface: IOManager
Creates and returns a file open chooser dialog with the registered file extensions from the output serializers.

Specified by:
createSaveFileChooser in interface IOManager
Returns:
DOCUMENT ME!

hasInputSerializer

public boolean hasInputSerializer()
Description copied from interface: IOManager
Returns true, if the io manager has a registered input manager.

Specified by:
hasInputSerializer in interface IOManager
Returns:
true, if the io manager has a registered input manager.

hasOutputSerializer

public boolean hasOutputSerializer()
Description copied from interface: IOManager
Returns true, if the io manager has a registered output manager.

Specified by:
hasOutputSerializer in interface IOManager
Returns:
true, if the io manager has a registered output manager.

pluginAdded

public void pluginAdded(GenericPlugin plugin,
                        PluginDescription desc)
Description copied from interface: PluginManagerListener
Called by the plugin manager, iff a plugin has been added.

Specified by:
pluginAdded in interface PluginManagerListener
Parameters:
plugin - the added plugin.
desc - the description of the new plugin.

removeListener

public boolean removeListener(IOManager.IOManagerListener l)
Description copied from interface: IOManager
Returns true, if the given io manager listener was in the list of listeners and could be removed.

Specified by:
removeListener in interface IOManager
Parameters:
l - the io manager listener to remove.
Returns:
DOCUMENT ME!

toString

public String toString()
Returns a string representation of the io manager. Useful for debugging.

Overrides:
toString in class Object
See Also:
Object.toString()


Generated at 2012-05-30 11:00:14 PM CEST