kawigi.cmd
Class TestCasesAction

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

public class TestCasesAction
extends DefaultAction

Implementation of all actions for editing test cases.

See Also:
Serialized Form

Field Summary
protected static javax.swing.JCheckBox ansBox
           
protected static java.lang.Object answerFld
           
protected static EditorDataType arrayBaseType
           
protected static javax.swing.JDialog arrayDlg
          Dialog for editing array parameter of test case.
protected static javax.swing.JTextField arrayField
           
protected static javax.swing.JLabel arrayLabel
          All visual controls in dialog for editing array parameter of test case.
protected static javax.swing.JTextArea arrayText
           
protected static java.util.ArrayList<Dispatcher> caseDisps
           
protected static javax.swing.JDialog caseDlg
          Dialog for editing single test case.
protected static int caseNum
          Number of test case which is edited at nowtime (if test case will be added this variable is setted to -1).
protected static java.util.ArrayList<javax.swing.JButton> delButs
           
protected static GridPanel delsPan
           
protected static java.util.ArrayList<javax.swing.JButton> editButs
           
protected static java.util.ArrayList<java.lang.Object> editFields
          All visual controls and its dispatchers in dialog for editing single test case.
protected static GridPanel editsPan
           
protected static int fieldNum
          Number of an array field in test case which is edited at nowtime.
protected static boolean isChangingTexts
          Flag needed in synchronizing TextArea and TextBox when editing array parameter.
protected static GridPanel labelsPan
          All visual controls in main dialog for editing test cases.
protected static java.util.ArrayList<javax.swing.JLabel> labsLabels
           
protected static javax.swing.JDialog mainDlg
          Main dialog for editing test cases.
protected static Test testCase
          Test case edited at nowtime.
protected  java.lang.Object thisField
          TextBox or Button in dialog for editing single test case for which this action was created.
 
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
TestCasesAction(ActID cmdid)
          Constructs a new TestCasesAction for the given ActID.
TestCasesAction(ActID cmdid, ActionTextField field)
          Constructs a new TestCasesAction for the given ActID and given TextField.
TestCasesAction(ActID cmdid, javax.swing.JButton field)
          Constructs a new TestCasesAction for the given ActID and given Button.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          All commands gathered here.
protected  void adjustCBoxProps(javax.swing.JCheckBox cbox)
          Some code to change default checkbox colors in plugin mode.
protected  void adjustLabelProps(javax.swing.JLabel lab)
          Some code to change default label colors in plugin mode.
protected  void ansBoxChanged()
          Doing some UI changes after clicking on checkbox near answer (is it needed to check it).
protected  javax.swing.JDialog createArrayDialog(ClassDecl cl)
          Creates the dialog for editing array parameter.
protected  javax.swing.JDialog createCaseDialog(ClassDecl cl)
          Creates the dialog for editing single test case.
protected  javax.swing.JDialog createMainDialog(ClassDecl cl)
          Creates the main dialog for editing test cases.
protected  void fieldChanged()
          Changes text in TextArea (array one-element-in-line) after editing TextBox (array comma-separated).
 java.lang.Object getValue(java.lang.String key)
          Getting text for parameter value TextBox.
 boolean isEnabled()
          Returns true if this action is available.
 boolean isNeedTrackEnabled()
          I think it's very critical to not play with focus during contest.
 void putValue(java.lang.String key, java.lang.Object value)
          Saving text for parameter value TextBox after changing.
protected  void textChanged()
          Changes text in TextBox (array comma-separated) after editing TextArea (array one-element-in-line).
protected  void updateArrayLabel(int num_items)
          Changes the label text when number of elements in the array changed.
protected  void updateButtonState(java.lang.String val)
          Changes text on the button for array parameter ("create" array if it's empty or "modify" if not).
 
Methods inherited from class kawigi.cmd.DefaultAction
equals, getID, isVisible, reportError, setVisible, UIRefresh
 
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, removePropertyChangeListener, setEnabled
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mainDlg

protected static javax.swing.JDialog mainDlg
Main dialog for editing test cases.


caseDlg

protected static javax.swing.JDialog caseDlg
Dialog for editing single test case.


arrayDlg

protected static javax.swing.JDialog arrayDlg
Dialog for editing array parameter of test case.


labelsPan

protected static GridPanel labelsPan
All visual controls in main dialog for editing test cases.


editsPan

protected static GridPanel editsPan

delsPan

protected static GridPanel delsPan

labsLabels

protected static java.util.ArrayList<javax.swing.JLabel> labsLabels

editButs

protected static java.util.ArrayList<javax.swing.JButton> editButs

delButs

protected static java.util.ArrayList<javax.swing.JButton> delButs

caseNum

protected static int caseNum
Number of test case which is edited at nowtime (if test case will be added this variable is setted to -1).


testCase

protected static Test testCase
Test case edited at nowtime.


editFields

protected static java.util.ArrayList<java.lang.Object> editFields
All visual controls and its dispatchers in dialog for editing single test case.


ansBox

protected static javax.swing.JCheckBox ansBox

answerFld

protected static java.lang.Object answerFld

caseDisps

protected static java.util.ArrayList<Dispatcher> caseDisps

thisField

protected java.lang.Object thisField
TextBox or Button in dialog for editing single test case for which this action was created.


fieldNum

protected static int fieldNum
Number of an array field in test case which is edited at nowtime.


arrayLabel

protected static javax.swing.JLabel arrayLabel
All visual controls in dialog for editing array parameter of test case.


arrayText

protected static javax.swing.JTextArea arrayText

arrayField

protected static javax.swing.JTextField arrayField

arrayBaseType

protected static EditorDataType arrayBaseType

isChangingTexts

protected static boolean isChangingTexts
Flag needed in synchronizing TextArea and TextBox when editing array parameter.

Constructor Detail

TestCasesAction

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


TestCasesAction

public TestCasesAction(ActID cmdid,
                       ActionTextField field)
Constructs a new TestCasesAction for the given ActID and given TextField.


TestCasesAction

public TestCasesAction(ActID cmdid,
                       javax.swing.JButton field)
Constructs a new TestCasesAction for the given ActID and given Button.

Method Detail

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
All commands gathered here.

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

isEnabled

public boolean isEnabled()
Returns true if this action is available.

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

isNeedTrackEnabled

public boolean isNeedTrackEnabled()
I think it's very critical to not play with focus during contest.

Overrides:
isNeedTrackEnabled in class DefaultAction

adjustLabelProps

protected void adjustLabelProps(javax.swing.JLabel lab)
Some code to change default label colors in plugin mode.


adjustCBoxProps

protected void adjustCBoxProps(javax.swing.JCheckBox cbox)
Some code to change default checkbox colors in plugin mode.


createMainDialog

protected javax.swing.JDialog createMainDialog(ClassDecl cl)
Creates the main dialog for editing test cases.


createCaseDialog

protected javax.swing.JDialog createCaseDialog(ClassDecl cl)
Creates the dialog for editing single test case.


ansBoxChanged

protected void ansBoxChanged()
Doing some UI changes after clicking on checkbox near answer (is it needed to check it).


updateButtonState

protected void updateButtonState(java.lang.String val)
Changes text on the button for array parameter ("create" array if it's empty or "modify" if not).


getValue

public java.lang.Object getValue(java.lang.String key)
Getting text for parameter value TextBox.

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

putValue

public void putValue(java.lang.String key,
                     java.lang.Object value)
Saving text for parameter value TextBox after changing.

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

createArrayDialog

protected javax.swing.JDialog createArrayDialog(ClassDecl cl)
Creates the dialog for editing array parameter.


updateArrayLabel

protected void updateArrayLabel(int num_items)
Changes the label text when number of elements in the array changed.


textChanged

protected void textChanged()
Changes text in TextBox (array comma-separated) after editing TextArea (array one-element-in-line).


fieldChanged

protected void fieldChanged()
Changes text in TextArea (array one-element-in-line) after editing TextBox (array comma-separated).