JET

edu.utep.cs.jet.gui
Class ToolActionFactory

java.lang.Object
  extended by edu.utep.cs.jet.gui.FileActionFactory
      extended by edu.utep.cs.jet.gui.ToolActionFactory
All Implemented Interfaces:
Constants

public class ToolActionFactory
extends FileActionFactory

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).


Field Summary
 
Fields inherited from class edu.utep.cs.jet.gui.FileActionFactory
compilationDirectory, currentFile, et, frame, viewController
 
Fields inherited from interface edu.utep.cs.jet.gui.Constants
CLASS_EXTENSION, COLOR_EXPLORER, COLOR_OUTPUT, COPYRIGHT, DEBUG, DIVIDER_SIZE, EDIT_MENU_NAME, EXPLORER_DIR, EXPLORER_ROOT, FILE_MENU_NAME, HELP_MENU_NAME, ICON_ABOUT, ICON_ABSTRACT_CLASS, ICON_BROWSER, ICON_CLASS, ICON_CLASS_DISABLED, ICON_DELETE, ICON_ERROR, ICON_FILE, ICON_FOLDER, ICON_GEN_APP, ICON_HOME, ICON_INFORM, ICON_INTERFACE, ICON_JAVA_FILE, ICON_JML_LOGO, ICON_METHOD, ICON_METHOD_GREEN, ICON_METHOD_ORANGE, ICON_METHOD_RED, ICON_MINER, ICON_NEW, ICON_NEWTESTSUITE, ICON_NOTE, ICON_OPEN, ICON_OUTPUT, ICON_PREFERENCES, ICON_QUESTION, ICON_REDO, ICON_SAVE_AS, ICON_TEST_FILE, ICON_UNDO, ICON_UNKOWN, ICON_WARN, JAVA, JAVA_EXTENSION, JAVAC, JUNIT_SWINGGUI_TESTRUNNER, NEWLINE, OPTION_MENU_NAME, TEST_MENU_NAME, TITLE, TOOL_MENU_NAME, VERSION, WEB_PAGE_LOCATION, WEB_PAGE_NAME, WINDOW_HEIGHT, WINDOW_MIN_HEIGHT, WINDOW_MIN_WIDTH, WINDOW_WIDTH
 
Constructor Summary
ToolActionFactory(Mainable et, edu.utep.cs.jet.gui.ViewController vc)
          Creates a new instance for the given main program.
 
Method Summary
 boolean compilable(String msg)
          Is the current file compilable with JML?
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.
 AbstractAction getTutorial()
          Returns an action for the Tutorial menu item.
protected  void setCurrentFile(File file)
          Sets the given file to be the current file being edited.
 
Methods inherited from class edu.utep.cs.jet.gui.FileActionFactory
getClose, getCloseAll, getDropTarget, getET, getExit, getIcon, getNew, getOpen, getPopDelete, getPopNew, getPopOpen, getPopRefresh, getPopRootDir, getPopTest, getPrint, getPrinterSetup, getSave, getSaveAs, getTestOP, locateFile, saveIfModified, updatePopupActions
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ToolActionFactory

public ToolActionFactory(Mainable et,
                         edu.utep.cs.jet.gui.ViewController vc)
Creates a new instance for the given main program.

Method Detail

getTutorial

public AbstractAction getTutorial()
Returns an action for the Tutorial menu item.


getFileChangeListener

public FileChangeListener getFileChangeListener()
Returns a file change listener that listens to the opening and closing of the file being edited by the editor. The file name is displayed on the status bar.


getCompile

public AbstractAction getCompile()
Returns an action for the Compile Java menu item.


getCheckJml

public AbstractAction getCheckJml()
Returns an action for the Check JML menu item.


compilable

public boolean compilable(String msg)
Is the current file compilable with JML?


getCompileJml

public AbstractAction getCompileJml()
Returns an action for the Compile JML menu item.


getRun

public AbstractAction getRun()
Returns an action for the Run menu item.


getBaseName

public static String getBaseName(File file)
Returns the base name of the give file.


setCurrentFile

protected void setCurrentFile(File file)
Sets the given file to be the current file being edited. This method is overridden here to enable or disable various actions.

Overrides:
setCurrentFile in class FileActionFactory

JET

JET is Copyright (C) 2005-2008 by The 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.