# HG changeset patch # User nloodin # Date 1369317037 -7200 # Node ID 3cb70d5832aa40e419a03ed4948ef56843d026cd # Parent ce8517f5a2fe55a6eab8198d2e99a7b078bada37 8014048: Online user guide of jconsole points incorrect link Reviewed-by: mchung, sla, jbachorik diff -r ce8517f5a2fe -r 3cb70d5832aa jdk/src/share/classes/sun/tools/jconsole/AboutDialog.java --- a/jdk/src/share/classes/sun/tools/jconsole/AboutDialog.java Wed May 22 20:03:45 2013 -0700 +++ b/jdk/src/share/classes/sun/tools/jconsole/AboutDialog.java Thu May 23 15:50:37 2013 +0200 @@ -34,6 +34,7 @@ import javax.swing.border.*; import javax.swing.event.*; +import static sun.misc.Version.jdkMinorVersion; import static java.awt.BorderLayout.*; import static sun.tools.jconsole.Utilities.*; @@ -73,7 +74,7 @@ String jConsoleVersion = Version.getVersion(); String vmName = System.getProperty("java.vm.name"); String vmVersion = System.getProperty("java.vm.version"); - String urlStr = Messages.HELP_ABOUT_DIALOG_USER_GUIDE_LINK_URL; + String urlStr = getOnlineDocUrl(); if (isBrowseSupported()) { urlStr = "" + urlStr + ""; } @@ -86,8 +87,7 @@ "" + Resources.format(Messages.HELP_ABOUT_DIALOG_JCONSOLE_VERSION, jConsoleVersion) + "

" + Resources.format(Messages.HELP_ABOUT_DIALOG_JAVA_VERSION, (vmName +", "+ vmVersion)) + - "

" + Resources.format(Messages.HELP_ABOUT_DIALOG_USER_GUIDE_LINK, urlStr) + - ""); + "

" + urlStr + ""); helpLink.setOpaque(false); helpLink.setEditable(false); helpLink.setForeground(textColor); @@ -153,7 +153,7 @@ } static void browseUserGuide(JConsole jConsole) { - getAboutDialog(jConsole).browse(Messages.HELP_ABOUT_DIALOG_USER_GUIDE_LINK_URL); + getAboutDialog(jConsole).browse(getOnlineDocUrl()); } static boolean isBrowseSupported() { @@ -182,6 +182,12 @@ }; } + private static String getOnlineDocUrl() { + String version = Integer.toString(jdkMinorVersion()); + return Resources.format(Messages.HELP_ABOUT_DIALOG_USER_GUIDE_LINK_URL, + version); + } + private static class TPanel extends JPanel { TPanel(int hgap, int vgap) { super(new BorderLayout(hgap, vgap)); diff -r ce8517f5a2fe -r 3cb70d5832aa jdk/src/share/classes/sun/tools/jconsole/resources/messages.properties --- a/jdk/src/share/classes/sun/tools/jconsole/resources/messages.properties Wed May 22 20:03:45 2013 -0700 +++ b/jdk/src/share/classes/sun/tools/jconsole/resources/messages.properties Thu May 23 15:50:37 2013 +0200 @@ -105,7 +105,7 @@ HELP_ABOUT_DIALOG_MASTHEAD_TITLE=About JConsole HELP_ABOUT_DIALOG_TITLE=JConsole: About HELP_ABOUT_DIALOG_USER_GUIDE_LINK=JConsole &User Guide:
{0} -HELP_ABOUT_DIALOG_USER_GUIDE_LINK_URL=http://java.sun.com/javase/6/docs/technotes/guides/management/jconsole.html +HELP_ABOUT_DIALOG_USER_GUIDE_LINK_URL=http://docs.oracle.com/javase/{0}/docs/technotes/guides/management/jconsole.html HELP_MENU_ABOUT_TITLE=&About JConsole HELP_MENU_USER_GUIDE_TITLE=Online &User Guide HELP_MENU_TITLE=&Help diff -r ce8517f5a2fe -r 3cb70d5832aa jdk/src/share/classes/sun/tools/jconsole/resources/messages_ja.properties --- a/jdk/src/share/classes/sun/tools/jconsole/resources/messages_ja.properties Wed May 22 20:03:45 2013 -0700 +++ b/jdk/src/share/classes/sun/tools/jconsole/resources/messages_ja.properties Thu May 23 15:50:37 2013 +0200 @@ -105,7 +105,7 @@ HELP_ABOUT_DIALOG_MASTHEAD_TITLE=JConsole\u306B\u3064\u3044\u3066 HELP_ABOUT_DIALOG_TITLE=JConsole: \u8A73\u7D30 HELP_ABOUT_DIALOG_USER_GUIDE_LINK=JConsole\u30E6\u30FC\u30B6\u30FC\u30FB\u30AC\u30A4\u30C9(&U):
{0} -HELP_ABOUT_DIALOG_USER_GUIDE_LINK_URL=http://java.sun.com/javase/6/docs/technotes/guides/management/jconsole.html +HELP_ABOUT_DIALOG_USER_GUIDE_LINK_URL=http://docs.oracle.com/javase/{0}/docs/technotes/guides/management/jconsole.html HELP_MENU_ABOUT_TITLE=JConsole\u306B\u3064\u3044\u3066(&A) HELP_MENU_USER_GUIDE_TITLE=\u30AA\u30F3\u30E9\u30A4\u30F3\u30FB\u30E6\u30FC\u30B6\u30FC\u30FB\u30AC\u30A4\u30C9(&U) HELP_MENU_TITLE=\u30D8\u30EB\u30D7(&H) diff -r ce8517f5a2fe -r 3cb70d5832aa jdk/src/share/classes/sun/tools/jconsole/resources/messages_zh_CN.properties --- a/jdk/src/share/classes/sun/tools/jconsole/resources/messages_zh_CN.properties Wed May 22 20:03:45 2013 -0700 +++ b/jdk/src/share/classes/sun/tools/jconsole/resources/messages_zh_CN.properties Thu May 23 15:50:37 2013 +0200 @@ -105,7 +105,7 @@ HELP_ABOUT_DIALOG_MASTHEAD_TITLE=\u5173\u4E8E JConsole HELP_ABOUT_DIALOG_TITLE=JConsole: \u5173\u4E8E HELP_ABOUT_DIALOG_USER_GUIDE_LINK=JConsole \u7528\u6237\u6307\u5357(&U):
{0} -HELP_ABOUT_DIALOG_USER_GUIDE_LINK_URL=http://java.sun.com/javase/6/docs/technotes/guides/management/jconsole.html +HELP_ABOUT_DIALOG_USER_GUIDE_LINK_URL=http://docs.oracle.com/javase/{0}/docs/technotes/guides/management/jconsole.html HELP_MENU_ABOUT_TITLE=\u5173\u4E8E JConsole(&A) HELP_MENU_USER_GUIDE_TITLE=\u8054\u673A\u7528\u6237\u6307\u5357(&U) HELP_MENU_TITLE=\u5E2E\u52A9(&H)