com.jFormTK
Class JItems

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

public class JItems
extends java.lang.Object
implements JConstants

        This 'jFormTK' Class is used to contain a set of items to be used in a Java
        JList component. It was initially designed to hold the Safe Place Container
        Locations for the Survivors List PLUS 'jFormTK' Application...

        It is instanced and hosted by the 'jFormTK' Application Data Base [AppDB].

        In the SLPlus usage, the item values are loaded from the SLPlus DirRegistration
        JFormForm Sub-Class     'postProcess' method after the End User has specified their
        important documents container locations.

        Multiple items list are available and identified by the 'itemsName' control
        parameter. For example, in the SLPlus 'jFormTK' Application the items list described
        above is names "safePlaceLocations".

        The 'itemsName' is used as a KEY into the 'tree' TreeMap collection. The associated
        'tree' VALUE is the 'ItemControls' Inner Class. Each 'ItemControls' instance contains
        the following controls:
        1)      a list of raw items as entered by the 'jFormTK' Application End USer.
        2)      a String Array [formats] of Ordered Pairs required to construct a "Formatted Items"
                list to be used in a 'JFormField' _CField instance during 'jFormTK' run-time.
        3)      a control String [pattern] used to configure the "Formatted Items"...

        The 'OrderItemsDialog' Inner Class is designed to enable the 'jFormTK' Application
        End User to dictate the order of the "Formatted Items" that simplifies their data
        entry processing. Using a "Drag and Drop [DnD]" process the End User will place the
        most used list item at the top of the list so that generally the default item shall
        be displayed and the only data entry required is pressing the return|enter key...

        Usages for other 'jFormTK' Applications are TBD.
        

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

Copyright (c) 2008 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
JItems()
           
JItems(int mChars)
           
 
Method Summary
static void add(java.lang.String itemIn)
           Add an item [String] to the 'items' Class Vector as specified by the given itemIn String...
 java.lang.String[] getFormattedItems()
           
static java.lang.String[] getRawItems()
           Return a String array of the class items...
static java.lang.String[] getReferencedItems()
           Return a String array of the class items invoking the 'JFormField' reference function...
static void orderItems(java.lang.String instructions, java.lang.String[] formattedItems)
           Produce a dialog that enables the 'jFormTK' End User to re-order the items in the 'items' Class Vector...
 void setFormats(java.lang.String[] formats, java.lang.String pattern)
           Set the Formats String Array.
static void showJItems(java.lang.String title)
           Display the contents of the current 'items' Class vector in a message dialog...
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JItems

public JItems()

JItems

public JItems(int mChars)
Method Detail

add

public static void add(java.lang.String itemIn)
        Add an item [String] to the 'items' Class Vector as specified by the
        given itemIn String...

        NOTE:
        The 'itemIn' String may contain an Indirect Address to a 'jFormTK' 'JFormField'.
        For example, this is how the initial implementation is used to set the item to
        the user specified locations in the SLPlus 'DirReception' Form... 

        Kernel Usage:
        1)      None. Used exclusively in the 'JFormForm' Sub-Class's that specify each
                'jFormTK' data entry form...
        

Parameters:
itemIn - Item [String] to be added to the items Class Vector...

getReferencedItems

public static java.lang.String[] getReferencedItems()
        Return a String array of the class items invoking the 'JFormField' reference
        function...

        Kernel Usage:
        1)      'JItems.getFormattedItems' Method...
        

Returns:
String array of the class items invoking the 'JFormField' reference... function.

getRawItems

public static java.lang.String[] getRawItems()
        Return a String array of the class items...

        Kernel Usage:
        1)      
        

Returns:
String array of the class items...

orderItems

public static void orderItems(java.lang.String instructions,
                              java.lang.String[] formattedItems)
        Produce a dialog that enables the 'jFormTK' End User to re-order the items
        in the 'items' Class Vector...

        A String of instructions is required that informs the end user why the
        order process is requested...

        Kernel Usage:
        1)      None
        NOTE:
        This method is envoked by a 'jFormTK.jFormForm' Sub-Class [i.e. a Form Application
        Class] only.
        

Parameters:
instructions - String annotation to inform the End User why the re-ordering is requested...

setFormats

public void setFormats(java.lang.String[] formats,
                       java.lang.String pattern)
        Set the Formats String Array.
        This String array is designed to hold a set of formatting controls to be
        used in constructing the display String from the raw data 'items' Vector.

        There SHALL be an element for each element of the 'items' Vector.
        A SOFTWARE TRAP SHALL be constructed if the 'items' and 'formats' dimensions are
        out of sync.

        Each 'formats' element must contain 'n' "format controls" delimited with the
        JFormTKDB.itemsDelimiter where 'n' is determined by the 'style' control. The
        allowed "format controls" are as follows:
                1)      number  -       indicates the 'items' element number to be used...
                2)      ref 'JFormField' - get the current text value for the given ID...
                3)      text - Text String to be used ASIS in the formatted item...     

        NOTE 1  :       the "~" symbol is used below to denote the JFormTKDB.itemsDelimiter...
        NOTE 2  :       the following "format controls" are used for the SLPlus locations
                                items:
                                [0] SAFE:~0
                                [1] Safety Deposit Box:~1
                                [2] (Directory.DirReception.otherSafePlaceContainerLocation.0)~2

        The 'pattern' parameter is a template used to construct the formatted items. It
        uses the 'JFormTKDB.itemsDelimiter' to deliminate the control items as follows:
                1)      number  -       the "format controls" element index...
                2)      text    -       text string to be used in the pattern...

  NOTE 3        :       the following 'pattern' is used for the SLPlus locations items:
        "0~[~1~]~"
  
  Kernel Usage:
  1)    NOT used by the 'jFormTK' Kernel.
        Used in 'jFormTK.jFormForm' Sub-Class Forms as required.
        

Parameters:
formats -

getFormattedItems

public java.lang.String[] getFormattedItems()

showJItems

public static void showJItems(java.lang.String title)
        Display the contents of the current 'items' Class vector in a message dialog...

        Label the display with the given 'title' [String]...

        Kernel Usage:
        1)      None. As required for DEBUG in a 'jFormTK' Aoolication 'JFormForm' Sub-Class...
        

Parameters:
title - String for the 'JFormFrame.message' dialog title annotation...