Changeset 9349


Ignore:
Timestamp:
2005-03-10T10:57:51+13:00 (19 years ago)
Author:
mdewsnip
Message:

Removed the formatting args stuff.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gli/src/org/greenstone/gatherer/Dictionary.java

    r8811 r9349  
    4646import org.greenstone.gatherer.util.Utility;
    4747
    48 /** Extends the ResourceBundle class to allow for the automatic insertion of  arguments. Note that the key names beginning Farg are reserved for formatting. <BR>
     48/** Extends the ResourceBundle class to allow for the automatic insertion of arguments.<BR>
    4949 * <BR>
    5050 * Property files usable by this class have the Backus-Naur form: <BR>
     
    114114
    115115    /** Used to retrieve a property value from the Locale specific ResourceBundle, based upon the key and arguments supplied. If the key cannot be found or if some other part of the call fails a default (English) error message is returned. <BR>
    116      * Here the get recieves a second argument which is an array of Strings used to populate argument fields, denoted {<I>n</I>}, within the value String returned. Note that argument numbers greater than or equal to 32 are automatically mapped to the formatting String named Farg<I>n</I>.
     116     * Here the get recieves a second argument which is an array of Strings used to populate argument fields, denoted {<I>n</I>}, within the value String returned.
    117117     * @param key A <strong>String</strong> which is mapped to a initial String within the ResourceBundle.
    118118     * @param args A <strong>String[]</strong> used to populate argument fields within the complete String.
     
    152152        }
    153153        complete = complete + initial.substring(0, opening);
     154
    154155        // Parse arg_num
    155156        String arg_str = null;
     
    160161            arg_str = initial.substring(opening + 1, closing);
    161162        }
    162         int arg_num = Integer.parseInt(arg_str);
     163
    163164        if (closing + 1 < initial.length()) {
    164165            initial = initial.substring(closing + 1);
     
    167168            initial = "";
    168169        }
     170
    169171        // Insert argument
    170         if (args != null && 0 <= arg_num && arg_num < args.length) {
    171             complete = complete + args[arg_num];
    172         }
    173         else if (arg_num >= 32) {
    174             String f_subargs[] = new String[1];
    175             if (font != null) {
    176             f_subargs[0] = font.getFontName();
     172        if (arg_str.equals("FONT")) {
     173            complete = complete + (font != null ? font.getFontName() : "Arial");
     174        }
     175        else {
     176            int arg_num = Integer.parseInt(arg_str);
     177            if (args != null && 0 <= arg_num && arg_num < args.length) {
     178            complete = complete + args[arg_num];
    177179            }
    178             else {
    179             f_subargs[0] = "Arial";
    180             }
    181             complete = complete + get("Farg" + arg_num, f_subargs);
    182180        }
    183181        }
Note: See TracChangeset for help on using the changeset viewer.