Changeset 10009
- Timestamp:
- 2005-06-03T14:49:55+12:00 (19 years ago)
- Location:
- trunk/gli/src/org/greenstone/gatherer
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/gui/HelpFrame.java
r10006 r10009 44 44 import javax.swing.event.*; 45 45 import javax.swing.tree.*; 46 import org.greenstone.gatherer.Configuration; 46 47 import org.greenstone.gatherer.DebugStream; 47 48 import org.greenstone.gatherer.Dictionary; … … 121 122 122 123 124 /** Retrieve the full file path to the help index xml file. 125 * @return the full path as a String 126 */ 127 private String getHelpFolder() 128 { 129 String help_folder = "help/" + Configuration.getLanguage() + "/"; 130 131 // Try in the JAR/classes directory first 132 URL help_folder_url = Utility.base.getResource("/" + help_folder); // !! 133 if (help_folder_url != null) { 134 return help_folder; 135 } 136 137 // Look in the base directory next 138 File help_folder_file = new File(help_folder); 139 if (help_folder_file.exists()) { 140 return help_folder; 141 } 142 143 // Resort to English 144 return "help/" + StaticStrings.ENGLISH_LANGUAGE_STR + "/"; 145 } 146 147 123 148 static public void setView(String section_name) 124 149 { … … 162 187 // Load the XML help file and build the contents structure from it 163 188 try { 164 String help_index = Utility.getHelpFolder() + StaticStrings.HELP_INDEX_FILENAME;189 String help_index = getHelpFolder() + StaticStrings.HELP_INDEX_FILENAME; 165 190 Document document = XMLTools.parseXMLFile(help_index, true); 166 191 … … 291 316 URL url = null; 292 317 293 String help_file = Utility.getHelpFolder() + name + StaticStrings.HTM_FILE_EXTENSION;318 String help_file = getHelpFolder() + name + StaticStrings.HTM_FILE_EXTENSION; 294 319 295 320 if (name != null && !name.equals(NULL_STRING)) { -
trunk/gli/src/org/greenstone/gatherer/util/Utility.java
r10008 r10009 412 412 413 413 414 /** Retrieve the full file path to the help index xml file.415 * @return the full path as a String416 */417 static public String getHelpFolder() {418 419 String help_folder = "help/" + Configuration.getLanguage() + "/";420 421 // Try in the JAR/classes directory first422 URL help_folder_url = base.getResource("/" + help_folder);423 if (help_folder_url != null) {424 return help_folder;425 }426 427 // Look in the base directory next428 File help_folder_file = new File(help_folder);429 if (help_folder_file.exists()) {430 return help_folder;431 }432 433 // Resort to English434 return "help/" + StaticStrings.ENGLISH_LANGUAGE_STR + "/";435 }436 437 414 /** Method to retrieve an image icon with the given filename found in classpath or the resouces directory. 438 415 * @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.