com.jFormTK
Class JWorkSheet

java.lang.Object
  extended by com.jFormTK.JWorkSheet
All Implemented Interfaces:
JConstants

public class JWorkSheet
extends java.lang.Object
implements JConstants

        This 'jFormTK' Class is designed as a holder for the jFormFrame Items required to
        produce a "Work Sheet" Printout and to define the 'jFormTK' Application Form
        Fields that are required for the 'jFormTK' Package "Dynamic Referencing" feature.
 
        There is an instance of this class hosted by each Application 'JFormForm' Sub-Class,
        i.e. there is a 'WorkSheet' File created for each 'JFormForm' Sub-Class of a
        'jFormTK' Application.
 
        These files are automatically created during the 'jFormTK' Application "Development
        Phase". Each time the associated .java file changes, a new WorkSheets file is created
        in the 'WorkSheets' Folder within the 'jFormTK' Application Folder...
 
        When the 'jFormTK' Application is deployed a JAR file of the latest WorkSheet
        Files is distributed with the 'jFormTK' Kernel JAR and the 'jFormTK' Application JAR...
 
        Kernel Usage: 
        1)      Used to construct the Work Sheet print out [BasejFormTK].
        2)      Used by 'JFormForm.Constructor' to instance each 'JFormForm' Sub-Class
                'JWorkSheet' object. This instance is then used by the jFormTK
                "Dynamic Referencing" process to establish the Field Names for
                Forms ['JFormForm' Sub-Class] that have NOT been loaded at the time a "Reference"
                is Made...
        3)      Used by the 'AppForms' Class Methods to verify Field Names and Group Name for
                JFormField's in Forms that have not been initialized....
 

Version:
1.00, 24 Jun 2000
Author:
Jim Crowell
Professional Computer Solutions [PCS]
URL: http://jFormTK.com/
E-Mail: JimCrowell@EMail.com

Copyright (c) 2009 by Professional Computer Solutions [PCS]
All Rights Reserved

Field Summary
 
Fields inherited from interface com.jFormTK.JConstants
__, _AB, _AB_, _AField, _B, _BField, _CField, _CIField, _DField, _EU_, _H, _HEIGHT, _HEIGHT_INV, _HField, _I, _IField, _LField, _MField, _NField, _NotRequired, _PField, _PIField, _QField, _Required, _RField, _TAField, _TField, _WIDTH, _WIDTH_INV, _XField, AB, APP_TRACE_FOCUS, APP_TRACE_GET, APP_TRACE_SET, B_, BAR, BAR_, BB, BH, BI, BREAKPOINT_FOCUS, BREAKPOINT_GET, BREAKPOINT_SET, BVB, C_QUOTE, CLOSE, CLOSE_BRACKET, COLORS_DELIMITER, COMMA, COMMA_, D_ELEMENT, D_ELEMENT_N, D_ELEMENT_N1, D_ELEMENT_N2, D_ELEMENT_N3, D_FIELDS, D_FIELDS_N, D_FIELDS_N1, D_FIELDS_N2, D_FIELDS_N3, D_ITEMS, DASH, DOT, EOL, EOP, EOS, FIELD_TRACE_FOCUS, FIELD_TRACE_GET, FIELD_TRACE_SET, FONT_DELIMITER, H_, HB, HH, HI, I_, IB, IH, II, JLAF_DELIMITER, LF, LISTBRACKET, NO, OPEN, OPEN_BRACKET, pCheckboxGroup, QUOTE, SPACE_, TAB, YES
 
Constructor Summary
JWorkSheet(JFormForm formIn, java.lang.String modeIn, java.lang.String absolutePathIn)
          Constructors:
 
Method Summary
 void appendItems(java.lang.String s)
           Append the given String to the 'items' control String.
 java.lang.String displayGroupNames()
           Build and return a display String to show the "Group Names" of this 'JWorkSheet' instance...
 int findName(java.lang.String inName, java.lang.String from)
           Find the given Name [inName] in the current 'Names' Vector and return the index if it is found or a -1 if the name is not found...
 java.lang.String getAbsolutePath()
           This method is designed to used to return the 'absolutePath' of the '/WorkSheets' Folder Associated File...
 java.lang.String[] getFieldNames()
           Return a String Array of the names contained in '*this*JWorkSheet'.
 java.lang.String getGroupName(int index)
           
 java.lang.String getGroupNameAndBreakpoint(int index)
           
 java.util.Vector getGroupNames()
           Return the 'GroupNames' Vector.
 java.lang.String[] getGroupNamesArray()
           Return a String array of each 'JFormForm' Sub-Class Group Name...
 java.util.Vector getHints()
           
 java.lang.String getInfo()
           
 java.lang.String getItems()
           
 java.lang.String[] getItems(java.lang.String fldIDIn)
           Return the set of Items associated with the given 'JFormField' ID [fldIDIn].
 java.lang.String getMode()
           
 java.lang.String getName(int index)
           
 java.lang.String getNameAndValue(int index)
           
 java.util.Vector getNames()
           
 java.lang.String getPrompt(java.lang.String inFieldName)
           
 java.util.Vector getPrompts()
           
 char[] getTypesArray()
           
 boolean hasGroup()
           Retrun a flag that is set to true iff the current Work Sheet has Group Names...
 boolean isShell()
           
 void setAbsolutePath(java.lang.String s)
           
 void setGroupName(java.lang.String s)
           
 void setGroupNames(java.lang.String packedGroupNames)
           
 void setGroupNames(java.util.Vector v)
           This method is used to set the JWorkSheet groupNames Vector...
 void setHint(java.lang.String s)
           
 void setHints(java.lang.String packedHints)
           
 void setHints(java.util.Vector v)
           This method is used to set the JWorkSheet hints Vector...
 void setInfo(java.lang.String s)
           This method is used to set the Information Text String...
 void setItems(java.lang.String s)
           
 void setMode(java.lang.String modeIn)
           
 void setName(java.lang.String s)
           
 void setNames(java.lang.String packedNames)
           
 void setNames(java.util.Vector v)
           This method is used to set the JWorkSheet Names Vector...
 void setPrompt(java.lang.String s)
           
 void setPrompts(java.lang.String packedPrompts)
           
 void setPrompts(java.util.Vector v)
           This method is used to set the JWorkSheet prompts Vector...
 java.lang.String showWorkSheet()
           Return a String that presents each 'JFormField' in the host 'JWorkSheet'.
 void showWorkSheet(char showMode, java.lang.String from)
           Show the host 'JWorkSheet' parameters as a function of the 'showMode' display control parameter as follows: 'n' - Name/GroupName and Type Only...
 void showWorkSheet(java.lang.String from)
           Show the host 'JWorkSheet' parameters with a default 'showMode' of 'a'...
 java.lang.String XXXgetHintFor(java.lang.String groupNameIn, java.lang.String fieldNameIn)
           Create a String constructed as follows: 1) Found Index 2) 'jFormTK' Fields Delimiter 3) Found 'hintText' String If the given Group / Field Names are NOT found Then return the 'Null' String...
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JWorkSheet

public JWorkSheet(JFormForm formIn,
                  java.lang.String modeIn,
                  java.lang.String absolutePathIn)
Constructors:
        Build a 'JWorkSheet' in the specified Mode. Set the 'absolutePath' for the
        eventual 'load' Processing from a 'WorkSheets' Folder Work Sheet File OR
        the 'xxxWorkSheets.jar' File where 'xxx' is the 'jFormTK' Application Name...

        Kernel Usage:
        1)      Called by 'jFormForm' [via JFormForm.Sub-Class for each unique Application
                Form] as required based on the 'jFormTK' Execution Mode
                [Development / Deployment] and the time stamp of the .java / WorkSheets File
                iff in the "Development" Mode...
        

Parameters:
formIn - 'JFormForm' Sub-Class Host reference...
modeIn - Mode [String] to build the 'JWorkSheet' instance.
absolutePathIn - Absoute path [String] for the 'JWorkSheet' Storage...
Method Detail

appendItems

public void appendItems(java.lang.String s)
        Append the given String to the 'items' control String.

        NOTE:
        The given appendage [s] MUST be formatted as follows:
                Field ID...
                JFormTKDB.itemsDelimiter
                items with the COMMA Delimiter...
                JFormTKDB.fieldsDelimiter

        Kernel Usage:
        1)      'JFormField.postHelp' Method when envoked by the 'JFormField.addItem' OR
                'JFormField'addItems' methods. The given 'items' are used by the
                'JFormWorkSheets.doPrinter' to create the 'data' line item when constructing
                a Work Sheet to be printed...
        

Parameters:
s - Formatted Items Addendum String...

displayGroupNames

public java.lang.String displayGroupNames()
        Build and return a display String to show the "Group Names" of this
        'JWorkSheet' instance...

        Kernel Usage:
        1)      'Util.verifyRange' when a given Group Name is invalid.
        

Returns:
Display String of the Group Names...

findName

public int findName(java.lang.String inName,
                    java.lang.String from)
        Find the given Name [inName] in the current 'Names' Vector and return the index
        if it is found or a -1 if the name is not found...
 
        Note:   If a set number if specified it is stripped off before the compare is
                        attempted...
 
        Kernel Usage:
        1)      'Util.verifyAssignment' Method to verify that a Field Name in an
                "Assignment" Statement is acceptable...
        2)      'Util.verifyConditions' Method to verify that a Field Name in an
                "Condition If" Statement is acceptable...
        3)      'JFormForm.getJFormFieldIndex' method when the 'formFields' Vector is empty...
        

Parameters:
inName - Field Name...
from - DEBUG String annotation...
Returns:
Index into the host 'JWorkSheet' instance...

getAbsolutePath

public java.lang.String getAbsolutePath()
        This method is designed to used to return the 'absolutePath'
        of the '/WorkSheets' Folder Associated File...

        Kernel Usage:
        1)      'jFormIO.updateWorkSheet' Method if the 'jFormTK' App is in the "Development"
                Mode and the Work Sheet must be updated to reflect changes in the associated
                Form.java File...
        

Returns:
Absolute Path String provided by 'JFormFoem' when the host instance was created...

getFieldNames

public java.lang.String[] getFieldNames()
        Return a String Array of the names contained in '*this*JWorkSheet'.
        These names SHALL be stripped of the 'Type' Character that is a Prefix to the
        elements of the 'names' Vector...

        Kernel Usage:
        1)      'JFormForm.getRange' for a Highlite Set of a 'JFormForm' Sub=Class
                that has not be processed yet by the 'jFormTK' Application End User...
        

Returns:
String Array of the names contained in '*this*JWorkSheet'...

getGroupName

public java.lang.String getGroupName(int index)

getGroupNameAndBreakpoint

public java.lang.String getGroupNameAndBreakpoint(int index)

hasGroup

public boolean hasGroup()
        Retrun a flag that is set to true iff the current Work Sheet has
        Group Names...

        Kernel Usage:
        1)      bbbb
        

Returns:
Boolean flag as a finction of Group Name existence...

getGroupNames

public java.util.Vector getGroupNames()
        Return the 'GroupNames' Vector. The 'Breakpoint' String, if any, is removed
        prior to returning the 'groupNames' Vector...
        
        Kernel Usage:
        1)      'JFormForm.Constructor' to initialize the 'JFormInfo.groupControls'
                iff there are existing Group Names in the loaded 'JWorkSheet' instance...
        

Returns:
Vector of Group Names minus any Breakpoint Controls...

getGroupNamesArray

public java.lang.String[] getGroupNamesArray()
        Return a String array of each 'JFormForm' Sub-Class Group Name...

        Kernel Usage:
        1)      'JFormForm.getRange' method to compute Start / End ID's...
        

Returns:
A String array for each Element of the host 'JFormForm' Sub-Class...

getHints

public java.util.Vector getHints()

getInfo

public java.lang.String getInfo()

getItems

public java.lang.String getItems()

getItems

public java.lang.String[] getItems(java.lang.String fldIDIn)
        Return the set of Items associated with the given 'JFormField' ID [fldIDIn].


        Kernel Usage:
        1)      'JFormWorkSheets.ValidateSelectedFormNames.WSTypeDialog.doPrinter' method to
                construct the 'choices', etc. row of a 'JFormForm' Sub-Class' Work Sheet.

        Kernel Usage:
        1)      'JFormWorkSheets.ValidateSelectedFormNames.WSTypeDialog.doPrinter' when the
                'JFormField.type' is such that a "list" of Options is maintained. For example,
                'JFormField.type' = _CField...
        

Parameters:
fldIDIn - 'JFormField' ID to be unpacked...
Returns:
The String array for the 'Field ID' items OR the null String if the given 'JFormField' ID is not found in the current 'items' control String...

getMode

public java.lang.String getMode()

getName

public java.lang.String getName(int index)

getNameAndValue

public java.lang.String getNameAndValue(int index)

getNames

public java.util.Vector getNames()

getPrompt

public java.lang.String getPrompt(java.lang.String inFieldName)

getPrompts

public java.util.Vector getPrompts()

XXXgetHintFor

public java.lang.String XXXgetHintFor(java.lang.String groupNameIn,
                                      java.lang.String fieldNameIn)
        Create a String constructed as follows:
        1)      Found Index
        2)      'jFormTK' Fields Delimiter
        3)      Found 'hintText' String

        If the given Group / Field Names are NOT found
        Then return the 'Null' String...

        Kernel Usage:
        1)      NOT CURRENTLY USED BY THE KERNEL... 
        

Parameters:
groupNameIn - Group Name String...
fieldNameIn - Field Name String...
Returns:
Formatted String = f(groupName, fieldName) parameters...

isShell

public boolean isShell()

setAbsolutePath

public void setAbsolutePath(java.lang.String s)

setGroupName

public void setGroupName(java.lang.String s)

setGroupNames

public void setGroupNames(java.lang.String packedGroupNames)

setGroupNames

public void setGroupNames(java.util.Vector v)
        This method is used to set the JWorkSheet groupNames Vector...

        Kernel Usage:
        1)      Called from the jFormTK 'jFormIO.updateWorkSheet' Method
                when the /WorkSheets Folder Work Sheet File is created OR
                updated.
        

Parameters:
v - String Vector of Group Names. One element for each 'jFormForm' SubClass field [jFormField] instance...

setHint

public void setHint(java.lang.String s)

setHints

public void setHints(java.lang.String packedHints)

setHints

public void setHints(java.util.Vector v)
        This method is used to set the JWorkSheet hints Vector...

        Kernel Usage:
        1)      Called from the jFormTK 'jFormIO.updateWorkSheet' Method when the
                /WorkSheets Folder Work Sheet File is created OR updated...
        

Parameters:
v - String Vector of Hints, one entry per 'JFormField' of the Host 'JFormForm' SubClass...

setInfo

public void setInfo(java.lang.String s)
        This method is used to set the Information Text String...

        Kernel Usage:
        1)      Called from the jFormTK 'jFormIO.updateWorkSheet' Method
                when the /WorkSheets Folder Work Sheet File is created OR updated...
        

Parameters:
s - The Info Test String provided via the 'JFormForm' SubClass to annotate the Form's purpose...

setItems

public void setItems(java.lang.String s)

setMode

public void setMode(java.lang.String modeIn)

setName

public void setName(java.lang.String s)

setNames

public void setNames(java.lang.String packedNames)

setNames

public void setNames(java.util.Vector v)
        This method is used to set the JWorkSheet Names Vector...

        Kernel Usage:
        1)      Called from the jFormTK 'jFormIO.updateWorkSheet' Method
                when the /WorkSheets Folder Work Sheet File is created OR updated...
        

Parameters:
v - String Vector contining an element with the name of each 'JFormField' of the 'JFormForm' SubClass...

setPrompt

public void setPrompt(java.lang.String s)

setPrompts

public void setPrompts(java.lang.String packedPrompts)

setPrompts

public void setPrompts(java.util.Vector v)
        This method is used to set the JWorkSheet prompts Vector...

        Kernel Usage:
        1)      Called from the jFormTK 'jFormIO.updateWorkSheet' Method
                when the /WorkSheets Folder Work Sheet File is created OR updated...
        

Parameters:
v - String vector containing the Prompt string for each 'JFormField' of the associated 'JFormForm' SubClass...

getTypesArray

public char[] getTypesArray()

showWorkSheet

public java.lang.String showWorkSheet()
        Return a String that presents each 'JFormField' in the host 'JWorkSheet'.
        Show the field prompt and the Hint Button text if it exist...

        Kernel Usage:
        1)      Debug statements to include 
        

Returns:
String that presents each 'JFormField' in the host 'JWorkSheet'...

showWorkSheet

public void showWorkSheet(char showMode,
                          java.lang.String from)
        Show the host 'JWorkSheet' parameters as a function of the 'showMode'
        display control parameter as follows:
                        'n' - Name/GroupName and Type Only...
                        'p' - Name/GroupName/Type/Prompt...
                        'h' - Name/GroupName/Type/Hint...
                        'a' - Name/GroupName/Type/Prompt/Hint...

        Kernel Usage:
        1)      'this.Constructor' iff 'debug' flag is true...
        2)      'JFormForm.getWorkSheet' iff debug is true...
        3)      'JHDD_IO.readWorkSheet' iff the debug flag is on...
        4)      'Util.verifyFields' iff the debug flag is on...
                "Clean Work Sheet" option is selected from the 'jFormTK' "Debug" menu...
        

Parameters:
showMode - Display Mode Control Character...
from - String to annotate the calling method...

showWorkSheet

public void showWorkSheet(java.lang.String from)
        Show the host 'JWorkSheet' parameters with a default 'showMode' of 'a'...

        Kernel Usage:
        1)      'this.Constructor' if 'debug' flag is true...
        2)      'BasejFormTK.Menu.actionPerformed' when the "Show Work Sheet" OR
                "Clean Work Sheet" option is selected from the 'jFormTK' "Debug" menu...
        

Parameters:
from - String to annotate the calling method...