org.fife.ui.rtextarea
Class Macro

java.lang.Object
  extended by org.fife.ui.rtextarea.Macro

public class Macro
extends Object

A macro as recorded/played back by an RTextArea.

Version:
0.1
Author:
Robert Futrell

Constructor Summary
Macro()
          Constructor.
Macro(File file)
          Loads a macro from a file on disk.
Macro(String name)
          Constructor.
Macro(String name, List records)
          Constructor.
 
Method Summary
 void addMacroRecord(org.fife.ui.rtextarea.Macro.MacroRecord record)
          Adds a macro record to this macro.
 List getMacroRecords()
          Returns the macro records that make up this macro.
 String getName()
          Returns the name of this macro.
 void saveToFile(String fileName)
          Saves this macro to a text file.
 void setName(String name)
          Sets the name of this macro.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Macro

public Macro()
Constructor.


Macro

public Macro(File file)
      throws EOFException,
             FileNotFoundException,
             IOException
Loads a macro from a file on disk.

Parameters:
file - The file from which to load the macro.
Throws:
EOFException - If an EOF is reached unexpectedly (i.e., the file is corrupt).
FileNotFoundException - If the specified file does not exist, is a directory instead of a regular file, or otherwise cannot be opened.
IOException - If an I/O exception occurs while reading the file.
See Also:
saveToFile(java.lang.String)

Macro

public Macro(String name)
Constructor.

Parameters:
name - The name of the macro.

Macro

public Macro(String name,
             List records)
Constructor.

Parameters:
name - The name of the macro.
records - The initial records of the macro.
Method Detail

addMacroRecord

public void addMacroRecord(org.fife.ui.rtextarea.Macro.MacroRecord record)
Adds a macro record to this macro.

Parameters:
record - The record to add. If null, nothing happens.
See Also:
getMacroRecords()

getMacroRecords

public List getMacroRecords()
Returns the macro records that make up this macro.

Returns:
The macro records.
See Also:
addMacroRecord(org.fife.ui.rtextarea.Macro.MacroRecord)

getName

public String getName()
Returns the name of this macro.

Returns:
The macro's name.
See Also:
setName(java.lang.String)

saveToFile

public void saveToFile(String fileName)
                throws IOException
Saves this macro to a text file. This file can later be read in by the constructor taking a File parameter; this is the mechanism for saving macros.

Parameters:
fileName - The name of the file in which to save the macro.
Throws:
IOException - If an error occurs while generating the XML for the output file.

setName

public void setName(String name)
Sets the name of this macro.

Parameters:
name - The new name for the macro.
See Also:
getName()