freemind.modes.actions
Class RevertAction

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

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, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SHORT_DESCRIPTION, SMALL_ICON
 
Constructor Summary
RevertAction(ModeController modeController)
           
 
Method Summary
 void act(XmlAction action)
           
 void actionPerformed(java.awt.event.ActionEvent arg0)
           
 RevertXmlAction createRevertXmlAction(java.io.File file)
           
 RevertXmlAction createRevertXmlAction(MindMap map, java.lang.String fileName, java.lang.String filePrefix)
           
 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.controller.actions.FreemindAction
addActor, getModeController, setSelected
 
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(ModeController modeController)
Parameters:
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 RevertXmlAction createRevertXmlAction(java.io.File file)
                                      throws JAXBException,
                                             java.io.IOException
Throws:
JAXBException
java.io.IOException

createRevertXmlAction

public RevertXmlAction createRevertXmlAction(MindMap map,
                                             java.lang.String fileName,
                                             java.lang.String filePrefix)
                                      throws JAXBException,
                                             java.io.IOException
Throws:
JAXBException
java.io.IOException

createRevertXmlAction

public RevertXmlAction createRevertXmlAction(java.lang.String xmlPackedFile,
                                             java.lang.String fileName,
                                             java.lang.String filePrefix)
                                      throws JAXBException
Parameters:
filePrefix - is used to generate the name of the reverted map in case that fileName is null.
Returns:
Throws:
JAXBException

act

public void act(XmlAction action)
Specified by:
act in interface ActorXml

getDoActionClass

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