Changeset 9349
- Timestamp:
- 2005-03-10T10:57:51+13:00 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/Dictionary.java
r8811 r9349 46 46 import org.greenstone.gatherer.util.Utility; 47 47 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> 49 49 * <BR> 50 50 * Property files usable by this class have the Backus-Naur form: <BR> … … 114 114 115 115 /** 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. 117 117 * @param key A <strong>String</strong> which is mapped to a initial String within the ResourceBundle. 118 118 * @param args A <strong>String[]</strong> used to populate argument fields within the complete String. … … 152 152 } 153 153 complete = complete + initial.substring(0, opening); 154 154 155 // Parse arg_num 155 156 String arg_str = null; … … 160 161 arg_str = initial.substring(opening + 1, closing); 161 162 } 162 int arg_num = Integer.parseInt(arg_str); 163 163 164 if (closing + 1 < initial.length()) { 164 165 initial = initial.substring(closing + 1); … … 167 168 initial = ""; 168 169 } 170 169 171 // Insert argument 170 if (arg s != 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]; 177 179 } 178 else {179 f_subargs[0] = "Arial";180 }181 complete = complete + get("Farg" + arg_num, f_subargs);182 180 } 183 181 }
Note:
See TracChangeset
for help on using the changeset viewer.