kawigi.cmd
Class LocalTestAction

java.lang.Object
  extended by javax.swing.AbstractAction
      extended by kawigi.cmd.DefaultAction
          extended by kawigi.cmd.LocalTestAction
All Implemented Interfaces:
java.awt.event.ActionListener, java.io.Serializable, java.lang.Cloneable, java.util.EventListener, javax.swing.Action

public class LocalTestAction
extends DefaultAction

Action implementation for actions related to local testing. This includes most of the buttons across the bottom of the KawigiEdit panel.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class kawigi.cmd.DefaultAction
cmdid, COLOR, enableSet, FONT, LARGE_ICON, SELECTED, SPINNER_MODEL, SPINNER_VALUE, TEXT, visible, VISIBLE, visibleSet
 
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
LocalTestAction(ActID cmdid)
          Constructs a new LocalTestAction for the given ActID.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          Runs the action!
 boolean compileLocal()
          Compiles the saved code for this problem.
 boolean isEnabled()
          Returns true if this action can be executed.
protected  java.lang.String removeCutting(java.lang.String text)
          Removes from code all between "BEGIN CUT HERE" and "END CUT HERE".
protected  java.lang.String restoreTesting(java.lang.String text, ClassDecl cl, EditorLanguage lang)
          Parses the text between "BEGIN KAWIGIEDIT TESTING" and "END KAWIGIEDIT TESTING" into test cases, inserts this code into TestPane and inserts into the code tag <%:testing-code%>.
 void saveLocal()
          Saves the current problem to the local test directory.
 
Methods inherited from class kawigi.cmd.DefaultAction
equals, getID, isNeedTrackEnabled, isVisible, reportError, setVisible, UIRefresh
 
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, putValue, removePropertyChangeListener, setEnabled
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LocalTestAction

public LocalTestAction(ActID cmdid)
Constructs a new LocalTestAction for the given ActID.

Method Detail

isEnabled

public boolean isEnabled()
Returns true if this action can be executed.

Specified by:
isEnabled in interface javax.swing.Action
Overrides:
isEnabled in class javax.swing.AbstractAction

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Runs the action!

Specified by:
actionPerformed in interface java.awt.event.ActionListener
Specified by:
actionPerformed in class DefaultAction

restoreTesting

protected java.lang.String restoreTesting(java.lang.String text,
                                          ClassDecl cl,
                                          EditorLanguage lang)
Parses the text between "BEGIN KAWIGIEDIT TESTING" and "END KAWIGIEDIT TESTING" into test cases, inserts this code into TestPane and inserts into the code tag <%:testing-code%>.


removeCutting

protected java.lang.String removeCutting(java.lang.String text)
Removes from code all between "BEGIN CUT HERE" and "END CUT HERE".


saveLocal

public void saveLocal()
Saves the current problem to the local test directory.


compileLocal

public boolean compileLocal()
                     throws java.lang.Exception
Compiles the saved code for this problem.

Throws:
java.lang.Exception