com.jFormTK
Class AppCommonDB

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

public class AppCommonDB
extends java.lang.Object
implements JConstants

        This 'jFormTK' Class is used by the 'jFormTK' Kernel to contain the Application
        unique Data Base Constants and Variables...

        This Class is instanced by the 'AppDB' Class during the "Application" loading process.

        Kernel Usage:
        1)      This Class is hosted by the 'AppDB' Class. There shall be only one instance of
                this class per 'jFormTK' Application. The methods of this class are always
                referenced using the 'AppDB.AppCommonDB' prefix, i.e. the class instance is a
                'public' object of the 'AppDB' Class...
        

Version:
1.00, 11 July 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
static java.util.Vector items
           
 
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
AppCommonDB()
           
 
Method Summary
static int addItem(java.lang.String nameIn, java.lang.String valueIn, java.lang.String from)
           Add the given parameters to the 'AppCommonDB' Vector [items]...
static void addToPromptPhraseList(java.lang.String newPhrase)
           Add the given items[s] to the 'jFormTKDB.promptPhraseList' so that the given item[s], when found in a 'JFormField' prompt Sting, can be Styled as a function of the 'jFormTKDB.promptPhraseLAF' field OR by a LAF derived from an LAF Sting appended [encodedLAF] to the given item or provided seperately via the following Method signatures...
static void addToPromptPhraseList(java.lang.String[] newPhrases)
           Add the given items[s] to the 'jFormTKDB.promptPhraseList' so that the given item[s], when found in a 'JFormField' prompt Sting, can be Styled as a function of the 'jFormTKDB.promptPhraseLAF' field OR by a LAF derived from an LAF Sting appended [encodedLAF] to the given item or provided seperately...
static void addToPromptPhraseList(java.lang.String[][] newPhrases)
           Add the given items[s] to the 'jFormTKDB.promptPhraseList' so that the given item[s], when found in a 'JFormField' prompt Sting, can be Styled as a function of the 'jFormTKDB.promptPhraseLAF' field OR by a LAF derived from an LAF Sting appended [encodedLAF] to the given item or provided seperately...
static void addToPromptPhraseList(java.lang.String newPhrase, java.lang.String encodedLAF)
           Add the given items[s] to the 'jFormTKDB.promptPhraseList' so that the given item[s], when found in a 'JFormField' prompt Sting, can be Styled as a function of the 'jFormTKDB.promptPhraseLAF' field OR by a LAF derived from an LAF Sting appended [encodedLAF] to the given item or provided seperately...
static int findName(java.lang.String nameIn)
           Find the given 'AppCommonDB' element name in the current 'items' Vector.
 java.lang.String[] getItems()
           Construct and return a String Array that shall contain an Element for each Item in the 'AppCommonDB.items' Vector...
 java.lang.String[] getNames()
           Construct a String Array that shall contain an Element for each 'Name' in the 'AppCommonDB' Items Vector...
static int getNumberOfItems()
           Return the number of entries in the current 'items' Vector, i.e.
static java.lang.String getPromptPhraseList()
           Return the current 'promptPhraseList' from the 'AppCommonDB' Vector...
static java.lang.String getValue(int index, java.lang.String from)
           Return a String that contains the matching Value Field, i.e.
static java.lang.String getValue(java.lang.String name, java.lang.String from)
           Return a String that contains the matching Value Field, i.e.
 java.lang.String[] getValues()
           Construct a String Array that shall contain an Element for each 'Value' in the 'AppCommonDB' Items Vector...
 void removeItem(java.lang.String inName)
           Remove the 'AppCommonDB' Element specifed by the Element Name [inName] parameter.
 void setItems(java.lang.String[] savedItems)
           Set the *this* 'items' Vector from the given String Array [savedItems]...
static void setPromptPhraseList(java.lang.String s)
           Set the 'promptPhraseList' Element of the 'items' Vector...
 void setValue(int index, java.lang.String value, java.lang.String from)
           Insert the given new Value [value] into the current 'items' Vector iff the given 'items' Vector Index is within range, i.e.
 void setValue(java.lang.String nameIn, java.lang.String value, java.lang.String from)
           Perform the following operations as a function of the given 'AppCommonDB' Name field: If the Name [nameIn] is found in the current 'items' Vector, Then the associated Value is replaced with the given Value [value] in the 'items' Vector...
static void showAppCommonDB(java.lang.String from)
           
 boolean XXXupdateItems(java.lang.String nameIn, java.lang.String valueIn)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

items

public static java.util.Vector items
Constructor Detail

AppCommonDB

public AppCommonDB()
Method Detail

addItem

public static int addItem(java.lang.String nameIn,
                          java.lang.String valueIn,
                          java.lang.String from)
        Add the given parameters to the 'AppCommonDB' Vector [items]...
 
        Kernel Usage:
        1)      'this.Constructor' to initialize "System Level" Entries...
        2)      Called by the 'Java Form Tool Kit [jFormTK] Methods to set an
                "Application Constant". The Application Constants are used by the 'jFormTK'
                System to produce a drop down list of Constants when the Applicaton End User
                enter a "=" into the first character of a Text Field...
        3)      'this.setPromptPhraseList' Method when a set of elements are added to the
                'jFormTK.promptPhraseList' Control...
        

Parameters:
nameIn - AppCommonDB Element Name [String]...
valueIn - AppCommonDB Element Value [String]...
from - DEBUG 'from' annotation String...
Returns:
Vector location 'int' for the given Element Name[nameIn]...

addToPromptPhraseList

public static void addToPromptPhraseList(java.lang.String newPhrase)
        Add the given items[s] to the 'jFormTKDB.promptPhraseList' so that the given
        item[s], when found in a 'JFormField' prompt Sting, can be Styled as a function
        of the 'jFormTKDB.promptPhraseLAF' field OR by a LAF derived from an LAF Sting
        appended [encodedLAF] to the given item or provided seperately via the following
        Method signatures...

        public static void addToPromptPhrase(String newPhrase)
        public static void addToPromptPhrase(String newPhrase, String encodedLAF)
        public static void addToPromptPhrase(String [] newPhrases)
        public static void addToPromptPhrase(String [] newPhrases)
        public static void addToPromptPhrase(String [] [] newPhrases)

        NOTE:
        The delimiter between the New Phrase Item and the encoded LAF shall be the
        'jFormTKDB.groupSaveDelimiter'...

        Kernel Usage:
        1)      Not Used...           
        

Parameters:
newPhrase - String of new Phrase Pairs...

addToPromptPhraseList

public static void addToPromptPhraseList(java.lang.String newPhrase,
                                         java.lang.String encodedLAF)
        Add the given items[s] to the 'jFormTKDB.promptPhraseList' so that the given
        item[s], when found in a 'JFormField' prompt Sting, can be Styled as a function
        of the 'jFormTKDB.promptPhraseLAF' field OR by a LAF derived from an LAF Sting
        appended [encodedLAF] to the given item or provided seperately...

        NOTE:
        The delimiter between the New Phrase Item and the encoded LAF shall be the
        'jFormTKDB.groupSaveDelimiter'...

        Kernel Usage:
        1)      Not Used...           
        

Parameters:
newPhrase - New Prompt Prase...
encodedLAF - Encoded LAF Controls...

addToPromptPhraseList

public static void addToPromptPhraseList(java.lang.String[] newPhrases)
        Add the given items[s] to the 'jFormTKDB.promptPhraseList' so that the given
        item[s], when found in a 'JFormField' prompt Sting, can be Styled as a function
        of the 'jFormTKDB.promptPhraseLAF' field OR by a LAF derived from an LAF Sting
        appended [encodedLAF] to the given item or provided seperately...

        NOTE 1:
        The delimiter between the New Phrase Item and the encoded LAF shall be the
        'jFormTKDB.groupSaveDelimiter'...

        Note 2:
        This metho signature is used by all others to permorm the actual 'add'
        operation...

        Kernel Usage:
        1)      Not Used...           
        

Parameters:
newPhrases - String array containing 'PromtPhrase' ordered pair sets...

addToPromptPhraseList

public static void addToPromptPhraseList(java.lang.String[][] newPhrases)
        Add the given items[s] to the 'jFormTKDB.promptPhraseList' so that the given
        item[s], when found in a 'JFormField' prompt Sting, can be Styled as a function
        of the 'jFormTKDB.promptPhraseLAF' field OR by a LAF derived from an LAF Sting
        appended [encodedLAF] to the given item or provided seperately...

        NOTE:
        The delimiter between the New Phrase Item and the encoded LAF shall be the
        'jFormTKDB.groupSaveDelimiter'...

        Kernel Usage:
        1)      Not Used...           
        

Parameters:
newPhrases - String [][] array containing 'PromtPhrase' ordered pair sets... NOTE: The input String Array shall be constructed as follows: [2][n] where [set 1] is an Ordered Pair with [0] = the Phrase String and [1] = associated 'encodedLAF' [set 2] indexes the Ordered Pairs Sets as required by the 'jFormTK' Application Developer...

findName

public static int findName(java.lang.String nameIn)
        Find the given 'AppCommonDB' element name in the current 'items' Vector.
        If found, the index into the items vector is returned.
        If not found, then the return Index is set to -1...

        Kernel Usage:
        1)      '*this*.addItem' to determine if the given prompt phrase currently exist
                in the 'items' Vector...
        2)      '*this*.addItem' to return the 'items' Vector element index of the added
                prompt phrase...
        3)      '*this*.remov eItem' to find the 'items' Vector Element to remove...
        4)      '*this*setValue' Method to find the 'items' Vector Index for setting the new
                value. If the name is not found then a new Item is constructed and the value
                set accordingly...
        5)      '*this*.updateItems' Method to find the 'items' element index to be updated...
        6)      'JValue.Constructor' to determine if a given 'c' Control has an existing
                entry in the 'AppCommonDB'...
        

Parameters:
nameIn - String with element name to find...
Returns:
Index [int] into the '*this*.items' instance...

getNumberOfItems

public static int getNumberOfItems()
        Return the number of entries in the current 'items' Vector, i.e. the number of
        entried in the 'AppCommonDB' Data Base...

        Kernel Usage:
        1)      '*this*setValue' Method iff a 'jFormTK' Soft Abort is created...
        2)      'Main.build_AppCommonDB' Method to add Registration Parameters to the 'AppCommonDB'...
        

Returns:
'items' Vector size...

getPromptPhraseList

public static java.lang.String getPromptPhraseList()
        Return the current 'promptPhraseList' from the 'AppCommonDB' Vector...

        Kernel Usage:
        1)      '*this*addPromptPhraseList' Method to get the current list so that it may
                be appended...
        

Returns:
The constructed Prompt Phrase List String...

getValue

public static java.lang.String getValue(int index,
                                        java.lang.String from)
        Return a String that contains the matching Value Field, i.e. the String in the
        'items' Vector Element indicates by the given index...

        NOTE:
        If no Match is found the following String is returned:
                "No Match: " + Name + "!"
        Kernel Usage:
        1)                                   
        

Parameters:
index - 'items' Vector Index...
Returns:
Found String Value...

getValue

public static java.lang.String getValue(java.lang.String name,
                                        java.lang.String from)
        Return a String that contains the matching Value Field, i.e. the String
        in the 'items' Vector Element indicates by the given 'name...

        NOTE:
        If no Match is found the following String is returned:
                "No Match: " + Name + "!"
        Kernel Usage:
        1)      '*this*.getPromptPhraseList' to fetch the 'promptPhaseList' that shall be
                returned to the envoking method after some housekeeping...      
        

Parameters:
name - 'items' Vector Index...
from - DEBUG from String...
Returns:
Found String Value...

setPromptPhraseList

public static void setPromptPhraseList(java.lang.String s)
        Set the 'promptPhraseList' Element of the 'items' Vector...

        Kernel Usage:
        1)      '*this*.addToPromptPhraseList' Method...
        

Parameters:
s - String of the new 'promptPhraseList' value

showAppCommonDB

public static void showAppCommonDB(java.lang.String from)

getItems

public java.lang.String[] getItems()
        Construct and return a String Array that shall contain an Element for each Item
        in the 'AppCommonDB.items' Vector...

        Note:
        The vector contains ordered pairs as follows:
        0       -       The Prompt Phrase String...
        1       -       Optionally an Encoded 'JLAF' String...

        Kernel Usage:
        1)      Called by the 'jFormIO.writeJAddressBook' method to Dynamically Save the
                'appDB.AppCommonDB' in the 'JAddressBook' File...
        

Returns:
String Array witn an element for each 'items' Entry...

getNames

public java.lang.String[] getNames()
        Construct a String Array that shall contain an Element for each 'Name' in the
        'AppCommonDB' Items Vector...

        Kernel Usage:
        1)      Called by the 'JFormField.actionPerformed' process when the Application
                End User has selected the 'Constants' Item from the
                'Dynamoc Referencing' Popup Menu...
        

Returns:
String array of 'AppCommonDB' Element Names...

getValues

public java.lang.String[] getValues()
        Construct a String Array that shall contain an Element for each 'Value' in the
        'AppCommonDB' Items Vector...

        Kernel Usage:
        1)      TBD...
                Called by the 'JFormField.actionPerformed' process when the Application
                End User has selected a 'Constants' Item from the 'Dynamoc Referencing'
                Popup Menu...
        

Returns:
String Array of the 'AppCommonDB' Value's...

removeItem

public void removeItem(java.lang.String inName)
        Remove the 'AppCommonDB' Element specifed by the Element Name [inName]
        parameter.

        If the name does not match with any of the current 'AppComminDB' Element Names
        Then a "Development Time" Soft Abort is performed...

        Kernel Usage:
        1)      'Util.removeAppCommonDBElement' Method...
        

Parameters:
inName - 'AppCommonDB' Element Name to be removed...

setItems

public void setItems(java.lang.String[] savedItems)
        Set the *this* 'items' Vector from the given String Array [savedItems]...

        Kernel Usage:
        1)      Called by the 'jFormIO.readJAddressBook' method to Re-Set the 'AppCommonDB'
                as a function of the String Array read from the current 'JAddressBook' File...
        

Parameters:
savedItems - String Array of the saved 'AppCommonDB' elements...

setValue

public void setValue(int index,
                     java.lang.String value,
                     java.lang.String from)
        Insert the given new Value [value] into the current 'items' Vector
        iff the given 'items' Vector Index is within range,
        i.e. it's index [index] is > 0 and < the 'items' Vector Size...

        NOTE:
        If the given index is deemed to be in error a "Soft Abort is performed.
        This is most likely a 'jFormTK' Development Phase error...

        Kernel Usage:
        1)      'this.updateItems' Method when the given 'item' is NOT Found in the current
                'AppCommonDB,Name' Encoded Items List...
        2)      'Util.assignment' Method when the "" prefix is used in the 'A' term 
                of an assignment,
                e.g. "A = B..." Dynamic Statement where 'A' ic elementName... 
        

Parameters:
index - Index [int] of the 'AppCommonDB' Element to Set...
value - The new Value String...
from - DEBUG annotation of the calling method...

setValue

public void setValue(java.lang.String nameIn,
                     java.lang.String value,
                     java.lang.String from)
        Perform the following operations as a function of the given 'AppCommonDB'
        Name field:
                If the Name [nameIn] is found in the current 'items' Vector,
                Then
                        the associated Value is replaced with the given Value [value]
                        in the 'items' Vector...
                Else    [The given name [nameIn] is not presently in the 'items' vector]
                        Create a new (name, value) ordered-pair in the 'items' Vector...

        Kernel Usage:
        1)      Called by the 'jFormTK' Developer when an End User has entered a value to
                replace an existing value in the current 'AppCommonDB' Data Base.
                See the 'Survivors List PLUS' 'Family' Form for an example...
        2)      Used by the 'Util.setAfield' Method when the "" prefix is used in the
                'A' field [left of =] of a 'jFormTK' "Dynamic" Assignment...
        3)      'JHDD_IO.writeJAddressBook' TO Reset the 'promptPhraseList' Value to ensure
                that any "Dynamic" Changes      have been saved...
        

Parameters:
nameIn - 'AppCommonDB' Entry Name String...
value - 'AppCommonDB' Entry Value String...
from - DEBUG annotation of the envoking Method...

XXXupdateItems

public boolean XXXupdateItems(java.lang.String nameIn,
                              java.lang.String valueIn)