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);
}
String locale; // SiteCenter 取值的 key 后缀
if (FRContext.getLocale().equals(Locale.US)) {
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));
BoxCenterAligmentPane actionLabel = getURLActionLabel(SiteCenter.getInstance().acquireUrlByKind("website." + FRContext.getLocale(), ProductConstants.WEBSITE_URL));
BoxCenterAligmentPane emailLabel = getEmailActionLabel(SiteCenter.getInstance().acquireUrlByKind("support.email", ProductConstants.SUPPORT_EMAIL));
contentPane.add(actionLabel);
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 事件
*/
public void actionPerformed(ActionEvent evt) {
Locale locale = FRContext.getLocale();
String helpKey = "";
String helpURL = SiteCenter.getInstance().acquireUrlByKind("help." + FRContext.getLocale());
if (ComparatorUtils.equals(locale, Locale.CHINA) || ComparatorUtils.equals(locale, Locale.TAIWAN)) {
helpKey = "help";
} else if (ComparatorUtils.equals(locale, Locale.US)) {
helpKey = "help.en";
}
if (!helpKey.isEmpty()) {
HttpClient client = new HttpClient(SiteCenter.getInstance().acquireUrlByKind(helpKey));
if (helpURL != null) {
HttpClient client = new HttpClient(helpURL);
if(client.getResponseCode() != -1) {
try {
Desktop.getDesktop().browse(new URI(SiteCenter.getInstance().acquireUrlByKind(helpKey)));
Desktop.getDesktop().browse(new URI(helpURL));
return;
} catch (Exception e) {
//出了异常的话, 依然打开本地教程

Loading…
Cancel
Save