Changeset 6783 in josm for trunk/src/org/openstreetmap/josm/gui/help/HelpUtil.java
- Timestamp:
- 2014-01-30T02:08:22+01:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/help/HelpUtil.java
r6362 r6783 27 27 * @return the base wiki URL 28 28 */ 29 static public String getWikiBaseUrl() {29 public static String getWikiBaseUrl() { 30 30 return Main.pref.get("help.baseurl", Main.JOSM_WEBSITE); 31 31 } … … 36 36 * @return the base wiki URL for help pages 37 37 */ 38 static public String getWikiBaseHelpUrl() {38 public static String getWikiBaseHelpUrl() { 39 39 return getWikiBaseUrl() + "/wiki"; 40 40 } … … 47 47 * @see #buildAbsoluteHelpTopic 48 48 */ 49 static public String getHelpTopicUrl(String absoluteHelpTopic) {49 public static String getHelpTopicUrl(String absoluteHelpTopic) { 50 50 if(absoluteHelpTopic == null) 51 51 return null; … … 63 63 * @return the URL to the edit page 64 64 */ 65 static public String getHelpTopicEditUrl(String absoluteHelpTopic) {65 public static String getHelpTopicEditUrl(String absoluteHelpTopic) { 66 66 String topicUrl = getHelpTopicUrl(absoluteHelpTopic); 67 67 topicUrl = topicUrl.replaceAll("#[^#]*$", ""); // remove optional fragment … … 76 76 * @return the relative help topic in the URL, i.e. "/Action/New" 77 77 */ 78 static public String extractRelativeHelpTopic(String url) {78 public static String extractRelativeHelpTopic(String url) { 79 79 String topic = extractAbsoluteHelpTopic(url); 80 80 if (topic == null) … … 94 94 * @return the absolute help topic in the URL, i.e. "/De:Help/Action/New" 95 95 */ 96 static public String extractAbsoluteHelpTopic(String url) {96 public static String extractAbsoluteHelpTopic(String url) { 97 97 if (!url.startsWith(getWikiBaseHelpUrl())) return null; 98 98 url = url.substring(getWikiBaseHelpUrl().length()); … … 119 119 * @since 5915 120 120 */ 121 static privateString getHelpTopicPrefix(LocaleType type) {121 private static String getHelpTopicPrefix(LocaleType type) { 122 122 String ret = LanguageInfo.getWikiLanguagePrefix(type); 123 123 if(ret == null) … … 138 138 * @since 5915 139 139 */ 140 static public String buildAbsoluteHelpTopic(String topic, LocaleType type) {140 public static String buildAbsoluteHelpTopic(String topic, LocaleType type) { 141 141 String prefix = getHelpTopicPrefix(type); 142 142 if (prefix == null || topic == null || topic.trim().length() == 0 || topic.trim().equals("/")) … … 151 151 * @return the help topic. null, if no context specific help topic is found 152 152 */ 153 static public String getContextSpecificHelpTopic(Object context) {153 public static String getContextSpecificHelpTopic(Object context) { 154 154 if (context == null) 155 155 return null; … … 183 183 * @return instance of help action 184 184 */ 185 static privateAction getHelpAction() {186 try{185 private static Action getHelpAction() { 186 if (Main.main.menu != null) { 187 187 return Main.main.menu.help; 188 } catch(NullPointerException e) { 189 return new HelpAction(); 190 } 188 } 189 return new HelpAction(); 191 190 } 192 191 … … 201 200 * @param relativeHelpTopic the help topic. Set to the default help topic if null. 202 201 */ 203 static public void setHelpContext(JComponent component, String relativeHelpTopic) {202 public static void setHelpContext(JComponent component, String relativeHelpTopic) { 204 203 if (relativeHelpTopic == null) { 205 204 relativeHelpTopic = "/"; … … 224 223 * @param helpTopic 225 224 */ 226 static public String ht(String helpTopic) {225 public static String ht(String helpTopic) { 227 226 // this is just a marker method 228 227 return helpTopic;
Note:
See TracChangeset
for help on using the changeset viewer.