freemind.modes.mindmapmode.actions
Class RevertAction

java.lang.Object
  extended by javax.swing.AbstractAction
      extended by freemind.modes.mindmapmode.actions.FreemindAction
          extended by freemind.modes.mindmapmode.actions.RevertAction
All Implemented Interfaces:
ActorXml, java.awt.event.ActionListener, java.io.Serializable, java.lang.Cloneable, java.util.EventListener, javax.swing.Action

public class RevertAction
extends FreemindAction
implements ActorXml

Reverts the map to the saved version. In Xml, the old map is stored as xml and as an undo action, the new map is stored, too. Moreover, the filename of the doAction is set to the appropriate map file's name. The undo action has no file name associated. The action goes like this: close the actual map and open the given Xml/File. If only a Xml string is given, a temporary file name is created, the xml stored into and this map is opened instead of the actual.

Author:
foltin
See Also:
Serialized Form

Field Summary
 
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
RevertAction(MindMapController modeController)
           
 
Method Summary
 void act(freemind.controller.actions.generated.instance.XmlAction action)
           
 void actionPerformed(java.awt.event.ActionEvent arg0)
           
 freemind.controller.actions.generated.instance.RevertXmlAction createRevertXmlAction(java.io.File file)
           
 freemind.controller.actions.generated.instance.RevertXmlAction createRevertXmlAction(MindMap map, java.lang.String fileName, java.lang.String filePrefix)
           
 freemind.controller.actions.generated.instance.RevertXmlAction createRevertXmlAction(java.lang.String xmlPackedFile, java.lang.String fileName, java.lang.String filePrefix)
           
 java.lang.Class getDoActionClass()
           
 void openXmlInsteadOfMap(java.lang.String xmlFileContent)
           
 
Methods inherited from class freemind.modes.mindmapmode.actions.FreemindAction
addActor, getMindMapController
 
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

RevertAction

public RevertAction(MindMapController modeController)
Method Detail

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent arg0)
Specified by:
actionPerformed in interface java.awt.event.ActionListener

openXmlInsteadOfMap

public void openXmlInsteadOfMap(java.lang.String xmlFileContent)

createRevertXmlAction

public freemind.controller.actions.generated.instance.RevertXmlAction createRevertXmlAction(java.io.File file)
                                                                                     throws java.io.IOException
Throws:
java.io.IOException

createRevertXmlAction

public freemind.controller.actions.generated.instance.RevertXmlAction createRevertXmlAction(MindMap map,
                                                                                            java.lang.String fileName,
                                                                                            java.lang.String filePrefix)
                                                                                     throws java.io.IOException
Throws:
java.io.IOException

createRevertXmlAction

public freemind.controller.actions.generated.instance.RevertXmlAction createRevertXmlAction(java.lang.String xmlPackedFile,
                                                                                            java.lang.String fileName,
                                                                                            java.lang.String filePrefix)
Parameters:
filePrefix - is used to generate the name of the reverted map in case that fileName is null.

act

public void act(freemind.controller.actions.generated.instance.XmlAction action)
Specified by:
act in interface ActorXml

getDoActionClass

public java.lang.Class getDoActionClass()
Specified by:
getDoActionClass in interface ActorXml