|
JET | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.utep.cs.et.gui.FileActionFactory
edu.utep.cs.et.gui.ToolActionFactory
public class ToolActionFactory
A factory class to create various tool actions such as compile and
run. These actions may be used for creating menu items or tool bar
items (see MenuFactory).
| Nested Class Summary | |
|---|---|
private static class |
ToolActionFactory.ClassFileReader
A utility class to parse bytecode files. |
private static interface |
ToolActionFactory.Commandable
An interface to the commands that can be run in separate threads. |
private class |
ToolActionFactory.CommandThread
A thread class to execute a shell command in a particular directory. |
private class |
ToolActionFactory.MessageThread
A thread class to wire an input stream to the message pane of the main GUI. |
| Field Summary | |
|---|---|
private static AbstractAction |
actCheckJml
The action for the Check JML menu item. |
private static AbstractAction |
actCompile
The action for the Ccmpile Java menu item. |
private static AbstractAction |
actCompileJml
The action for the Compile JML menu item. |
private static AbstractAction |
actRun
The action for the Run menu item. |
private File |
compilationDirectory
The directory in which the last compilation was performed. |
private Outputer |
outputer
The display area where all console outputs should go. |
| Fields inherited from class edu.utep.cs.et.gui.FileActionFactory |
|---|
currentFile, et, frame |
| Constructor Summary | |
|---|---|
ToolActionFactory(Mainable et)
Creates a new instance for the given main program. |
|
| Method Summary | |
|---|---|
private void |
checkJml()
Checks the current file with the JML checker. |
private String |
classPath()
Returns the class path option for Java and JML compilers |
boolean |
compilable(String msg)
Is the current file compilable with JML? |
private boolean |
compileJml()
Compiles the current file with the UTJML compiler. |
private void |
doCompile()
Compiles the file associated with the editing buffer. |
private Thread |
doCompile(String cmd)
Compiles the file associated with the editing buffer. |
private void |
doRun()
Runs the file associated with the editing buffer. |
static String |
getBaseName(File file)
Returns the base name of the give file. |
AbstractAction |
getCheckJml()
Returns an action for the Check JML menu item. |
AbstractAction |
getCompile()
Returns an action for the Compile Java menu item. |
AbstractAction |
getCompileJml()
Returns an action for the Compile JML menu item. |
FileChangeListener |
getFileChangeListener()
Returns a file change listener that listens to the opening and closing of the file being edited by the editor. |
AbstractAction |
getRun()
Returns an action for the Run menu item. |
File |
locateFile(String filename)
Given a relative path name, finds the file. |
private boolean |
runCommand(ToolActionFactory.Commandable cmd,
String[] args,
String beforeMsg,
String afterMsg,
boolean refresh)
Runs the given command cmd by supplying the given
arguments args. |
protected void |
setCurrentFile(File file)
Sets the given file to be the current file being edited. |
| Methods inherited from class edu.utep.cs.et.gui.FileActionFactory |
|---|
getClose, getDropTarget, getExit, getIcon, getNew, getOpen, getPopDelete, getPopNew, getPopOpen, getPopRefresh, getPopRootDir, getPopTest, getPrint, getPrinterSetup, getSave, getSaveAs, saveIfModified, updatePopupActions |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private Outputer outputer
private static AbstractAction actCompile
private static AbstractAction actCheckJml
private static AbstractAction actCompileJml
private static AbstractAction actRun
private File compilationDirectory
| Constructor Detail |
|---|
public ToolActionFactory(Mainable et)
| Method Detail |
|---|
public FileChangeListener getFileChangeListener()
public File locateFile(String filename)
null is returned. The file name is
parsed from an error message and supposed to be relative to the
directory in which the last compilation was done.
public AbstractAction getCompile()
public AbstractAction getCheckJml()
public boolean compilable(String msg)
public AbstractAction getCompileJml()
public AbstractAction getRun()
public static String getBaseName(File file)
private Thread doCompile(String cmd)
cmd - String specifying the compiler and options, if any;
e.g., javac -d foo.private void checkJml()
private boolean compileJml()
private boolean runCommand(ToolActionFactory.Commandable cmd,
String[] args,
String beforeMsg,
String afterMsg,
boolean refresh)
cmd by supplying the given
arguments args.
beforeMsg - Message to be printed before executing the command.afterMsg - Message to be printed after executing the command.refresh - True if the directory browser needs to be
refreshed upon the completion of the command.protected void setCurrentFile(File file)
setCurrentFile in class FileActionFactoryprivate String classPath()
private void doCompile()
private void doRun()
|
JET | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||