UTJML

edu.utep.cs.utjml.canica.jmleditor
Class FileAccess

java.lang.Object
  extended by edu.utep.cs.utjml.canica.jmleditor.FileAccess
All Implemented Interfaces:
FileAccessable

public class FileAccess
extends Object
implements FileAccessable

The FileAccess class shall implement the services provided in the FileAccessable class. The File access functionalities are: create a new file, open a file, save a file, save all files, close a file, closes all files, print a file, and printer setup.

Author:
Angelica B. Perez, Apr 26, 2006

Field Summary
static File workingDir
          Working directory
 
Constructor Summary
FileAccess(JMLEditorMDI editor, Mainable canica)
          constructor
 
Method Summary
 void closeAllFiles()
          Closes all files opened in the JML editor.
 void closeFile()
          Close the actual editing file in the JML editor.
 void closeFile(File file)
          Close the file given.
 void createNewFile()
          Creates a new empty file in the JML editor
 void createNewFile(String currentDirectory)
          Creates a new empty file in the JML editor giving the path where to create it.
 void openFile()
          Opens an existing file to the JML editor, asking for the file name.
 void openFile(File file)
          Opens an existing file, giving the absolute file name.
 void printerSetup()
          Calls the printer setup
 void printFile()
          Prints the active editing file
 void saveAllFiles()
          Saves all files opened in the JML editor.
 void saveAs()
          Saves the contents of the active editing file into a new file, which name is provided by the user.
 void saveFile()
          Saves the changes of the active editing file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

workingDir

public static File workingDir
Working directory

Constructor Detail

FileAccess

public FileAccess(JMLEditorMDI editor,
                  Mainable canica)
constructor

Method Detail

createNewFile

public void createNewFile()
Description copied from interface: FileAccessable
Creates a new empty file in the JML editor

Specified by:
createNewFile in interface FileAccessable

createNewFile

public void createNewFile(String currentDirectory)
Description copied from interface: FileAccessable
Creates a new empty file in the JML editor giving the path where to create it.

Specified by:
createNewFile in interface FileAccessable

openFile

public void openFile()
Description copied from interface: FileAccessable
Opens an existing file to the JML editor, asking for the file name.

Specified by:
openFile in interface FileAccessable

openFile

public void openFile(File file)
Description copied from interface: FileAccessable
Opens an existing file, giving the absolute file name.

Specified by:
openFile in interface FileAccessable

saveFile

public void saveFile()
Description copied from interface: FileAccessable
Saves the changes of the active editing file.

Specified by:
saveFile in interface FileAccessable

saveAs

public void saveAs()
Description copied from interface: FileAccessable
Saves the contents of the active editing file into a new file, which name is provided by the user.

Specified by:
saveAs in interface FileAccessable

saveAllFiles

public void saveAllFiles()
Description copied from interface: FileAccessable
Saves all files opened in the JML editor.

Specified by:
saveAllFiles in interface FileAccessable

closeFile

public void closeFile()
Description copied from interface: FileAccessable
Close the actual editing file in the JML editor.

Specified by:
closeFile in interface FileAccessable

closeFile

public void closeFile(File file)
Close the file given.

Specified by:
closeFile in interface FileAccessable
Parameters:
file - File given.

closeAllFiles

public void closeAllFiles()
Description copied from interface: FileAccessable
Closes all files opened in the JML editor.

Specified by:
closeAllFiles in interface FileAccessable

printFile

public void printFile()
Description copied from interface: FileAccessable
Prints the active editing file

Specified by:
printFile in interface FileAccessable

printerSetup

public void printerSetup()
Description copied from interface: FileAccessable
Calls the printer setup

Specified by:
printerSetup in interface FileAccessable

UTJML

UTJML is Copyright (C) 2004-2006 by University of Texas at El Paso and is distributed under the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This release depends on code from the JML project.