Browse Source

调整 SiteCenter 取值方式

master
plough 8 years ago
parent
commit
23b833b9d5
  1. 12
      designer_base/src/com/fr/design/actions/help/AboutPane.java
  2. 15
      designer_base/src/com/fr/design/actions/help/TutorialAction.java

12
designer_base/src/com/fr/design/actions/help/AboutPane.java

@ -80,16 +80,8 @@ public class AboutPane extends JPanel {
contentPane.add(boxCenterAlignmentPane); contentPane.add(boxCenterAlignmentPane);
} }
String locale; // SiteCenter 取值的 key 后缀 BoxCenterAligmentPane actionLabel = getURLActionLabel(SiteCenter.getInstance().acquireUrlByKind("website." + FRContext.getLocale(), ProductConstants.WEBSITE_URL));
if (FRContext.getLocale().equals(Locale.US)) { BoxCenterAligmentPane emailLabel = getEmailActionLabel(SiteCenter.getInstance().acquireUrlByKind("support.email", ProductConstants.SUPPORT_EMAIL));
locale = ".en";
} else if (FRContext.getLocale().equals(Locale.JAPAN)) {
locale = ".jp";
} else {
locale = "";
}
BoxCenterAligmentPane actionLabel = getURLActionLabel(SiteCenter.getInstance().acquireUrlByKind("website" + locale, ProductConstants.WEBSITE_URL));
BoxCenterAligmentPane emailLabel = getEmailActionLabel(SiteCenter.getInstance().acquireUrlByKind("register.email", ProductConstants.SUPPORT_EMAIL));
contentPane.add(actionLabel); contentPane.add(actionLabel);
contentPane.add(emailLabel); contentPane.add(emailLabel);

15
designer_base/src/com/fr/design/actions/help/TutorialAction.java

@ -59,20 +59,13 @@ public class TutorialAction extends UpdateAction {
* @param evt 事件 * @param evt 事件
*/ */
public void actionPerformed(ActionEvent evt) { public void actionPerformed(ActionEvent evt) {
Locale locale = FRContext.getLocale(); String helpURL = SiteCenter.getInstance().acquireUrlByKind("help." + FRContext.getLocale());
String helpKey = "";
if (ComparatorUtils.equals(locale, Locale.CHINA) || ComparatorUtils.equals(locale, Locale.TAIWAN)) { if (helpURL != null) {
helpKey = "help"; HttpClient client = new HttpClient(helpURL);
} else if (ComparatorUtils.equals(locale, Locale.US)) {
helpKey = "help.en";
}
if (!helpKey.isEmpty()) {
HttpClient client = new HttpClient(SiteCenter.getInstance().acquireUrlByKind(helpKey));
if(client.getResponseCode() != -1) { if(client.getResponseCode() != -1) {
try { try {
Desktop.getDesktop().browse(new URI(SiteCenter.getInstance().acquireUrlByKind(helpKey))); Desktop.getDesktop().browse(new URI(helpURL));
return; return;
} catch (Exception e) { } catch (Exception e) {
//出了异常的话, 依然打开本地教程 //出了异常的话, 依然打开本地教程

Loading…
Cancel
Save