Changeset 6565 for trunk/gli/src/org/greenstone/gatherer/util
- Timestamp:
- 2004-01-21T11:18:33+13:00 (20 years ago)
- Location:
- trunk/gli/src/org/greenstone/gatherer/util
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/util/StaticStrings.java
r6549 r6565 119 119 static final public String HTTP_PROTOCOL_STR = "http://"; 120 120 static final public String HELP_ARGUMENT = "-help"; 121 static final public String HELP_INDEX_FILENAME = "help_index.xml"; 122 static final public String HTM_FILE_EXTENSION = ".htm"; 121 123 static final public String IDENTIFIER_VALUE = "identifier"; 122 124 static final public String IMAGES_FOLDER = "images"; … … 152 154 static final public String MAPPING_ELEMENT = "Mapping"; 153 155 static final public String MARC_EXTENSION = ".marc"; 156 static final public String MDS_ATTRIBUTE = "mds"; 154 157 static final public String METADATA_ARGUMENT = "-metadata"; 155 158 static final public String METADATA_BAK = "~metadata.xml"; … … 190 193 static final public String SEARCHTYPE_ELEMENT = "SearchType"; 191 194 static final public String SEARCHTYPE_STR = "searchtype"; 195 static final public String SECTION_ELEMENT = "Section"; 192 196 static final public String SECTION_STR = "section"; 193 197 static final public String SEPARATOR_ATTRIBUTE = "separator"; … … 216 220 static final public String TEXT_STR = "text"; 217 221 static final public String TIMESTAMP_ARGUMENT = "&uq="; 222 static final public String TITLE_ELEMENT = "Title"; 218 223 static final public String TRUE_STR = "true"; 219 static final public String TRUNCATED_STRING 224 static final public String TRUNCATED_STRING = "..."; 220 225 static final public String TYPE_ATTRIBUTE = "type"; 221 226 static final public String UNDERSCORE_CHARACTER = "_"; -
trunk/gli/src/org/greenstone/gatherer/util/Utility.java
r6539 r6565 370 370 // If the token is bigger than two thirds width, before we've even started break it down. 371 371 if(current_width + 1 + token.length() > width && token.length() > threshold) { 372 String prefix = token.substring(0, width - 1 - current_width);373 token = token.substring(prefix.length());374 if(current_width == 0) {375 line = line + prefix;372 if(width == current_width) { 373 lines.push(line); 374 line = token; 375 current_width = token.length(); 376 376 } 377 377 else { 378 line = line + " " + prefix; 378 String prefix = token.substring(0, width - 1 - current_width); 379 token = token.substring(prefix.length()); 380 if(current_width == 0) { 381 line = line + prefix; 382 } 383 else { 384 line = line + " " + prefix; 385 } 386 lines.push(line); 387 line = ""; 388 current_width = 0; 379 389 } 380 lines.push(line);381 line = "";382 current_width = 0;383 390 } 384 391 // If adding the next token would push us over the maximum line width. … … 547 554 return col_dir + ETC_DIR; 548 555 } 556 557 /** Retrieve the full file path to the help index xml file. 558 * @return the full path as a String 559 */ 560 static public String getHelpIndex() { 561 String help_index = HELP_DIR + Gatherer.config.getLanguage() + File.separator + StaticStrings.HELP_INDEX_FILENAME; 562 File help_index_file = new File(help_index); 563 // If that file can't be found, default to english 564 if(!help_index_file.exists()) { 565 help_index = HELP_DIR + StaticStrings.ENGLISH_LANGUAGE_STR + File.separator + StaticStrings.HELP_INDEX_FILENAME; 566 } 567 return help_index; 568 } 569 570 549 571 /** Method to retrieve an image icon with the given filename found in classpath or the resouces directory. 550 572 * @return The specified <strong>ImageIcon</strong>, or an error image replacement if no such images exists.
Note:
See TracChangeset
for help on using the changeset viewer.