From 19767ee33b43f500e31a1d5e226f567746690fca Mon Sep 17 00:00:00 2001 From: pengda Date: Thu, 28 Jan 2021 11:26:01 +0800 Subject: [PATCH 1/3] =?UTF-8?q?REPORT-47606=20=E8=81=9A=E5=90=88=E6=8A=A5?= =?UTF-8?q?=E8=A1=A8=E6=8B=96=E6=8B=BD=E6=97=B6=E5=81=9C=E6=AD=A2=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E4=BC=9A=E5=9B=9E=E9=80=80=E5=88=B0=E5=8E=9F=E4=BD=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/poly/PolyBlockProperPane.java | 2 +- .../com/fr/poly/PolyBlockProperTable.java | 19 +++++++++++++------ 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/poly/PolyBlockProperPane.java b/designer-realize/src/main/java/com/fr/poly/PolyBlockProperPane.java index 316e86c28a..24a9272abe 100644 --- a/designer-realize/src/main/java/com/fr/poly/PolyBlockProperPane.java +++ b/designer-realize/src/main/java/com/fr/poly/PolyBlockProperPane.java @@ -41,7 +41,7 @@ public class PolyBlockProperPane extends DockingView { } public void update(){ - polyBlockProperTable.update(); + polyBlockProperTable.setBlockName(this.designer.getEditingTarget()); } @Override diff --git a/designer-realize/src/main/java/com/fr/poly/PolyBlockProperTable.java b/designer-realize/src/main/java/com/fr/poly/PolyBlockProperTable.java index cd98e66225..fa786dc1e3 100644 --- a/designer-realize/src/main/java/com/fr/poly/PolyBlockProperTable.java +++ b/designer-realize/src/main/java/com/fr/poly/PolyBlockProperTable.java @@ -111,12 +111,7 @@ public class PolyBlockProperTable extends JPanel { if (isPopulating || block == null) { return; } - if (blockPropertyPane.getWidgetNameField() != null) { - String toSetWidgetName = blockPropertyPane.getWidgetNameField().getText(); - if (isBlockNameValid(toSetWidgetName, block.getBlockName())) { - block.setBlockName(toSetWidgetName); - } - } + setBlockName(block); PolyBoundsGroup boundsgroup = new PolyBoundsGroup(block, designer.getTarget()); boundsgroup.setValue(x.getValue(), 0, 1); boundsgroup.setValue(y.getValue(), 1, 1); @@ -125,6 +120,18 @@ public class PolyBlockProperTable extends JPanel { firePropertyEdit(); } + public void setBlockName(TemplateBlock block){ + if (isPopulating || block == null || blockPropertyPane == null) { + return; + } + if (blockPropertyPane.getWidgetNameField() != null) { + String toSetWidgetName = blockPropertyPane.getWidgetNameField().getText(); + if (isBlockNameValid(toSetWidgetName, block.getBlockName())) { + block.setBlockName(toSetWidgetName); + } + } + } + /** *校验一下要设置的名称,不能为空,不能重名 * From 001e68b41c1b5e03ad1ddfdef85dba23510ade02 Mon Sep 17 00:00:00 2001 From: Yvan Date: Thu, 28 Jan 2021 16:44:10 +0800 Subject: [PATCH 2/3] =?UTF-8?q?REPORT-47632=20=E8=BF=9C=E7=A8=8B=E9=94=81?= =?UTF-8?q?=E5=AE=9A-=E4=BB=8E=E8=BF=9C=E7=A8=8B=E5=88=87=E6=8D=A2?= =?UTF-8?q?=E5=88=B0=E6=9C=AC=E5=9C=B0=E5=90=8E=EF=BC=8C=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E9=9B=86=E7=AA=97=E5=8F=A3=E7=9A=84=E9=94=81=E5=AE=9A=E5=9B=BE?= =?UTF-8?q?=E6=A0=87=E4=B8=8D=E6=B6=88=E5=A4=B1=20=E3=80=90=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E5=8E=9F=E5=9B=A0=E3=80=91=E4=B9=8B=E5=89=8D=E7=9A=84?= =?UTF-8?q?=E9=80=BB=E8=BE=91=E4=B8=8D=E5=AE=8C=E5=96=84=EF=BC=8C=E5=A6=82?= =?UTF-8?q?=E6=9E=9C=E5=A4=84=E4=BA=8E=E8=BF=9C=E7=A8=8B=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E4=B8=8B=E6=98=AF=E9=94=81=E5=AE=9A=E7=9A=84=EF=BC=8CisLock?= =?UTF-8?q?=E5=8F=98=E9=87=8F=E4=B8=BAtrue=EF=BC=8C=E7=84=B6=E5=90=8E?= =?UTF-8?q?=E5=88=87=E5=9B=9E=E6=9C=AC=E5=9C=B0=E4=BA=86=EF=BC=8C=E8=BF=99?= =?UTF-8?q?=E4=B8=AA=E5=8F=98=E9=87=8F=E6=B2=A1=E6=9C=89=E8=A2=AB=E7=BD=AE?= =?UTF-8?q?=E4=B8=BAfalse=EF=BC=8C=E4=BC=9A=E5=AF=BC=E8=87=B4=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E9=9B=86=E7=AA=97=E5=8F=A3=E5=9B=BE=E6=A0=87=E4=B8=80?= =?UTF-8?q?=E7=9B=B4=E4=B8=BA=E9=94=81=E5=AE=9A=E7=8A=B6=E6=80=81=20?= =?UTF-8?q?=E3=80=90=E6=94=B9=E5=8A=A8=E6=80=9D=E8=B7=AF=E3=80=91=E5=8A=A0?= =?UTF-8?q?=E4=B8=AA=E5=88=A4=E6=96=AD=EF=BC=8C=E5=A6=82=E6=9E=9C=E4=B8=8D?= =?UTF-8?q?=E6=98=AF=E8=BF=9C=E7=A8=8B=E8=AE=BE=E8=AE=A1=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E4=B8=94isLock=E4=B8=BAtrue=EF=BC=8C=E5=B0=86=E5=85=B6?= =?UTF-8?q?=E7=BD=AE=E4=B8=BAfalse=EF=BC=8C=E5=86=8D=E9=80=9A=E7=9F=A5?= =?UTF-8?q?=E8=A7=82=E5=AF=9F=E8=80=85=E4=BB=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/editlock/EditLockChangeChecker.java | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/editlock/EditLockChangeChecker.java b/designer-base/src/main/java/com/fr/design/editlock/EditLockChangeChecker.java index 8f276dfe89..d45c4c1813 100644 --- a/designer-base/src/main/java/com/fr/design/editlock/EditLockChangeChecker.java +++ b/designer-base/src/main/java/com/fr/design/editlock/EditLockChangeChecker.java @@ -40,13 +40,17 @@ public abstract class EditLockChangeChecker { try { EditLockOperator operator = WorkContext.getCurrent().get(EditLockOperator.class); boolean locked = operator.isLocked(lockItem); - if (isLocked != locked) { - isLocked = locked; + if (isLocked() != locked) { + setLocked(locked); fireChange(); } } catch (Exception e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); } + } else if (isLocked()){ + // 如果不是远程环境,且此前的远程状态下为锁定的话,切换回来后需要将其修改为不锁定 + setLocked(false); + fireChange(); } } }, 0, INTERVAL, TimeUnit.MILLISECONDS); @@ -65,9 +69,17 @@ public abstract class EditLockChangeChecker { @Override public void run() { for (EditLockChangeListener listener : EditLockChangeChecker.this.listeners) { - listener.updateLockedState(new EditLockChangeEvent(isLocked)); + listener.updateLockedState(new EditLockChangeEvent(isLocked())); } } }); } + + public boolean isLocked() { + return this.isLocked; + } + + public void setLocked(boolean locked) { + this.isLocked = locked; + } } From ebe3a7fa59e833ff2c7881c76ea4ac2b208f763a Mon Sep 17 00:00:00 2001 From: Hades Date: Fri, 29 Jan 2021 13:41:39 +0800 Subject: [PATCH 3/3] =?UTF-8?q?REPORT-47101=20=E6=B5=B7=E5=A4=96=E8=AE=BE?= =?UTF-8?q?=E8=AE=A1=E5=99=A8=E9=80=9A=E8=A1=8C=E8=AF=81=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E9=93=BE=E6=8E=A5=E6=9B=BF=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/extra/LoginWebBridge.java | 10 ++++- .../com/fr/design/extra/PluginWebBridge.java | 15 +++++-- .../design/locale/impl/BbsRegisterMark.java | 38 ++++++++++++++++++ .../fr/design/locale/impl/BbsResetMark.java | 38 ++++++++++++++++++ .../fr/design/locale/impl/BbsSpaceMark.java | 39 +++++++++++++++++++ .../java/com/fr/design/upm/UpmBridge.java | 15 +++++-- .../design/mainframe/bbs/BBSLoginDialog.java | 12 ++++-- .../design/mainframe/bbs/UserInfoLabel.java | 7 +++- 8 files changed, 159 insertions(+), 15 deletions(-) create mode 100644 designer-base/src/main/java/com/fr/design/locale/impl/BbsRegisterMark.java create mode 100644 designer-base/src/main/java/com/fr/design/locale/impl/BbsResetMark.java create mode 100644 designer-base/src/main/java/com/fr/design/locale/impl/BbsSpaceMark.java diff --git a/designer-base/src/main/java/com/fr/design/extra/LoginWebBridge.java b/designer-base/src/main/java/com/fr/design/extra/LoginWebBridge.java index 0862c74472..81e34335a2 100644 --- a/designer-base/src/main/java/com/fr/design/extra/LoginWebBridge.java +++ b/designer-base/src/main/java/com/fr/design/extra/LoginWebBridge.java @@ -6,8 +6,12 @@ import com.fr.config.MarketConfig; import com.fr.design.dialog.UIDialog; import com.fr.design.extra.exe.PluginLoginExecutor; import com.fr.design.gui.ilable.UILabel; +import com.fr.design.locale.impl.BbsRegisterMark; +import com.fr.design.locale.impl.BbsResetMark; import com.fr.general.CloudCenter; import com.fr.general.http.HttpClient; +import com.fr.general.locale.LocaleCenter; +import com.fr.general.locale.LocaleMark; import com.fr.log.FineLoggerFactory; import com.fr.stable.StringUtils; import javafx.concurrent.Task; @@ -118,7 +122,8 @@ public class LoginWebBridge { */ public void registerHref() { try { - Desktop.getDesktop().browse(new URI(CloudCenter.getInstance().acquireUrlByKind("bbs.register"))); + LocaleMark registerMark = LocaleCenter.getMark(BbsRegisterMark.class); + Desktop.getDesktop().browse(new URI(registerMark.getValue())); } catch (Exception e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); } @@ -129,7 +134,8 @@ public class LoginWebBridge { */ public void forgetHref() { try { - Desktop.getDesktop().browse(new URI(CloudCenter.getInstance().acquireUrlByKind("bbs.reset"))); + LocaleMark resetMark = LocaleCenter.getMark(BbsResetMark.class); + Desktop.getDesktop().browse(new URI(resetMark.getValue())); } catch (Exception e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); } diff --git a/designer-base/src/main/java/com/fr/design/extra/PluginWebBridge.java b/designer-base/src/main/java/com/fr/design/extra/PluginWebBridge.java index 159e6d6d9c..d709013506 100644 --- a/designer-base/src/main/java/com/fr/design/extra/PluginWebBridge.java +++ b/designer-base/src/main/java/com/fr/design/extra/PluginWebBridge.java @@ -13,8 +13,13 @@ import com.fr.design.extra.exe.PluginLoginExecutor; import com.fr.design.extra.exe.ReadUpdateOnlineExecutor; import com.fr.design.extra.exe.SearchOnlineExecutor; import com.fr.design.gui.ilable.UILabel; +import com.fr.design.locale.impl.BbsRegisterMark; +import com.fr.design.locale.impl.BbsResetMark; +import com.fr.design.locale.impl.BbsSpaceMark; import com.fr.design.utils.concurrent.ThreadFactoryBuilder; import com.fr.general.CloudCenter; +import com.fr.general.locale.LocaleCenter; +import com.fr.general.locale.LocaleMark; import com.fr.json.JSONObject; import com.fr.log.FineLoggerFactory; import com.fr.plugin.context.PluginMarker; @@ -434,8 +439,8 @@ public class PluginWebBridge { */ public void getPriviteMessage() { try { - String loginUrl = CloudCenter.getInstance().acquireUrlByKind("bbs.default"); - Desktop.getDesktop().browse(new URI(loginUrl)); + LocaleMark spaceMark = LocaleCenter.getMark(BbsSpaceMark.class); + Desktop.getDesktop().browse(new URI(spaceMark.getValue())); } catch (Exception exp) { FineLoggerFactory.getLogger().info(exp.getMessage()); } @@ -497,7 +502,8 @@ public class PluginWebBridge { */ public void registerHref() { try { - Desktop.getDesktop().browse(new URI(CloudCenter.getInstance().acquireUrlByKind("bbs.register"))); + LocaleMark registerMark = LocaleCenter.getMark(BbsRegisterMark.class); + Desktop.getDesktop().browse(new URI(registerMark.getValue())); } catch (Exception e) { FineLoggerFactory.getLogger().info(e.getMessage()); } @@ -511,7 +517,8 @@ public class PluginWebBridge { */ public void forgetHref() { try { - Desktop.getDesktop().browse(new URI(CloudCenter.getInstance().acquireUrlByKind("bbs.reset"))); + LocaleMark resetMark = LocaleCenter.getMark(BbsResetMark.class); + Desktop.getDesktop().browse(new URI(resetMark.getValue())); } catch (Exception e) { FineLoggerFactory.getLogger().info(e.getMessage()); } diff --git a/designer-base/src/main/java/com/fr/design/locale/impl/BbsRegisterMark.java b/designer-base/src/main/java/com/fr/design/locale/impl/BbsRegisterMark.java new file mode 100644 index 0000000000..d5afe26db6 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/locale/impl/BbsRegisterMark.java @@ -0,0 +1,38 @@ +package com.fr.design.locale.impl; + +import com.fr.general.CloudCenter; +import com.fr.general.GeneralContext; +import com.fr.general.locale.LocaleMark; + +import java.util.HashMap; +import java.util.Locale; +import java.util.Map; + +/** + * @author hades + * @version 10.0 + * Created by hades on 2021/1/29 + */ +public class BbsRegisterMark implements LocaleMark { + + private final Map map = new HashMap<>(); + private static final String BBS_REGISTER_CN = CloudCenter.getInstance().acquireUrlByKind("bbs.register"); + private static final String BBS_REGISTER_TW = CloudCenter.getInstance().acquireUrlByKind("bbs.register"); + private static final String BBS_REGISTER_EN = CloudCenter.getInstance().acquireUrlByKind("bbs.register.en_US"); + private static final String BBS_REGISTER_KR = CloudCenter.getInstance().acquireUrlByKind("bbs.register.en_US"); + private static final String BBS_REGISTER_JP = CloudCenter.getInstance().acquireUrlByKind("bbs.register.en_US"); + + public BbsRegisterMark() { + map.put(Locale.CHINA, BBS_REGISTER_CN); + map.put(Locale.KOREA, BBS_REGISTER_KR); + map.put(Locale.JAPAN, BBS_REGISTER_JP); + map.put(Locale.US, BBS_REGISTER_EN); + map.put(Locale.TAIWAN, BBS_REGISTER_TW); + } + + @Override + public String getValue() { + String result = map.get(GeneralContext.getLocale()); + return result == null ? BBS_REGISTER_EN : result; + } +} diff --git a/designer-base/src/main/java/com/fr/design/locale/impl/BbsResetMark.java b/designer-base/src/main/java/com/fr/design/locale/impl/BbsResetMark.java new file mode 100644 index 0000000000..4573aac3a6 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/locale/impl/BbsResetMark.java @@ -0,0 +1,38 @@ +package com.fr.design.locale.impl; + +import com.fr.general.CloudCenter; +import com.fr.general.GeneralContext; +import com.fr.general.locale.LocaleMark; + +import java.util.HashMap; +import java.util.Locale; +import java.util.Map; + +/** + * @author hades + * @version 10.0 + * Created by hades on 2021/1/29 + */ +public class BbsResetMark implements LocaleMark { + + private final Map map = new HashMap<>(); + private static final String BBS_RESET_CN = CloudCenter.getInstance().acquireUrlByKind("bbs.reset"); + private static final String BBS_RESET_TW = CloudCenter.getInstance().acquireUrlByKind("bbs.reset"); + private static final String BBS_RESET_EN = CloudCenter.getInstance().acquireUrlByKind("bbs.reset.en_US"); + private static final String BBS_RESET_KR = CloudCenter.getInstance().acquireUrlByKind("bbs.reset.en_US"); + private static final String BBS_RESET_JP = CloudCenter.getInstance().acquireUrlByKind("bbs.reset.en_US"); + + public BbsResetMark() { + map.put(Locale.CHINA, BBS_RESET_CN); + map.put(Locale.KOREA, BBS_RESET_KR); + map.put(Locale.JAPAN, BBS_RESET_JP); + map.put(Locale.US, BBS_RESET_EN); + map.put(Locale.TAIWAN, BBS_RESET_TW); + } + + @Override + public String getValue() { + String result = map.get(GeneralContext.getLocale()); + return result == null ? BBS_RESET_EN : result; + } +} diff --git a/designer-base/src/main/java/com/fr/design/locale/impl/BbsSpaceMark.java b/designer-base/src/main/java/com/fr/design/locale/impl/BbsSpaceMark.java new file mode 100644 index 0000000000..2303dc2509 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/locale/impl/BbsSpaceMark.java @@ -0,0 +1,39 @@ +package com.fr.design.locale.impl; + +import com.fr.general.CloudCenter; +import com.fr.general.GeneralContext; +import com.fr.general.locale.LocaleMark; + +import java.util.HashMap; +import java.util.Locale; +import java.util.Map; + +/** + * @author hades + * @version 10.0 + * Created by hades on 2021/1/29 + */ +public class BbsSpaceMark implements LocaleMark { + + private final Map map = new HashMap<>(); + private static final String BBS_SPACE_CN = CloudCenter.getInstance().acquireUrlByKind("bbs.default"); + private static final String BBS_SPACE_TW = CloudCenter.getInstance().acquireUrlByKind("bbs.default"); + private static final String BBS_SPACE_EN = CloudCenter.getInstance().acquireUrlByKind("bbs.default.en_US"); + private static final String BBS_SPACE_KR = CloudCenter.getInstance().acquireUrlByKind("bbs.default.en_US"); + private static final String BBS_SPACE_JP = CloudCenter.getInstance().acquireUrlByKind("bbs.default.en_US"); + + public BbsSpaceMark() { + map.put(Locale.CHINA, BBS_SPACE_CN); + map.put(Locale.KOREA, BBS_SPACE_KR); + map.put(Locale.JAPAN, BBS_SPACE_JP); + map.put(Locale.US, BBS_SPACE_EN); + map.put(Locale.TAIWAN, BBS_SPACE_TW); + } + + @Override + public String getValue() { + String result = map.get(GeneralContext.getLocale()); + return result == null ? BBS_SPACE_EN : result; + } + +} diff --git a/designer-base/src/main/java/com/fr/design/upm/UpmBridge.java b/designer-base/src/main/java/com/fr/design/upm/UpmBridge.java index 46bb11b3ce..0c25281d50 100644 --- a/designer-base/src/main/java/com/fr/design/upm/UpmBridge.java +++ b/designer-base/src/main/java/com/fr/design/upm/UpmBridge.java @@ -16,6 +16,9 @@ import com.fr.design.extra.exe.PluginLoginExecutor; import com.fr.design.extra.exe.ReadUpdateOnlineExecutor; import com.fr.design.extra.exe.SearchOnlineExecutor; import com.fr.design.i18n.Toolkit; +import com.fr.design.locale.impl.BbsRegisterMark; +import com.fr.design.locale.impl.BbsResetMark; +import com.fr.design.locale.impl.BbsSpaceMark; import com.fr.design.upm.event.CertificateEvent; import com.fr.design.upm.event.DownloadEvent; import com.fr.design.upm.exec.UpmBrowserExecutor; @@ -23,6 +26,8 @@ import com.fr.design.upm.task.UpmTaskWorker; import com.fr.event.EventDispatcher; import com.fr.general.CloudCenter; import com.fr.general.GeneralUtils; +import com.fr.general.locale.LocaleCenter; +import com.fr.general.locale.LocaleMark; import com.fr.json.JSONObject; import com.fr.log.FineLoggerFactory; import com.fr.plugin.context.PluginMarker; @@ -424,8 +429,8 @@ public class UpmBridge { @JSBridge public void getPriviteMessage() { try { - String loginUrl = CloudCenter.getInstance().acquireUrlByKind("bbs.default"); - Desktop.getDesktop().browse(new URI(loginUrl)); + LocaleMark spaceMark = LocaleCenter.getMark(BbsSpaceMark.class); + Desktop.getDesktop().browse(new URI(spaceMark.getValue())); } catch (Exception exp) { FineLoggerFactory.getLogger().info(exp.getMessage()); } @@ -437,7 +442,8 @@ public class UpmBridge { @JSBridge public void forgetHref() { try { - Desktop.getDesktop().browse(new URI(CloudCenter.getInstance().acquireUrlByKind("bbs.reset"))); + LocaleMark resetMark = LocaleCenter.getMark(BbsResetMark.class); + Desktop.getDesktop().browse(new URI(resetMark.getValue())); } catch (Exception e) { FineLoggerFactory.getLogger().info(e.getMessage()); } @@ -449,7 +455,8 @@ public class UpmBridge { @JSBridge public void registerHref() { try { - Desktop.getDesktop().browse(new URI(CloudCenter.getInstance().acquireUrlByKind("bbs.register"))); + LocaleMark registerMark = LocaleCenter.getMark(BbsRegisterMark.class); + Desktop.getDesktop().browse(new URI(registerMark.getValue())); } catch (Exception e) { FineLoggerFactory.getLogger().info(e.getMessage()); } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/bbs/BBSLoginDialog.java b/designer-realize/src/main/java/com/fr/design/mainframe/bbs/BBSLoginDialog.java index b37c048e92..114d2e8a6e 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/bbs/BBSLoginDialog.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/bbs/BBSLoginDialog.java @@ -8,11 +8,15 @@ import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ipasswordfield.UIPassWordField; import com.fr.design.gui.itextfield.UITextField; import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.locale.impl.BbsRegisterMark; +import com.fr.design.locale.impl.BbsResetMark; import com.fr.design.utils.DesignUtils; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.CloudCenter; import com.fr.general.ComparatorUtils; import com.fr.general.http.HttpClient; +import com.fr.general.locale.LocaleCenter; +import com.fr.general.locale.LocaleMark; import com.fr.log.FineLoggerFactory; import com.fr.stable.EncodeConstants; import com.fr.stable.StringUtils; @@ -65,6 +69,8 @@ public class BBSLoginDialog extends UIDialog { private UILabel tipLabel; private BoxCenterAligmentPane passwordReset; private BoxCenterAligmentPane registerLabel; + private LocaleMark resetMark = LocaleCenter.getMark(BbsResetMark.class); + private LocaleMark registerMark = LocaleCenter.getMark(BbsRegisterMark.class); private KeyListener keyListener = new KeyAdapter() { public void keyPressed(KeyEvent e) { @@ -113,8 +119,8 @@ public class BBSLoginDialog extends UIDialog { nameField = new UITextField(); passField = new UIPassWordField(); loginButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_BBSLogin_Login")); - passwordReset = getURLActionLabel(CloudCenter.getInstance().acquireUrlByKind("bbs.reset")); - registerLabel = getURLActionLabel(CloudCenter.getInstance().acquireUrlByKind("bbs.register")); + passwordReset = getURLActionLabel(resetMark.getValue()); + registerLabel = getURLActionLabel(registerMark.getValue()); loginButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent arg0) { @@ -311,7 +317,7 @@ public class BBSLoginDialog extends UIDialog { private BoxCenterAligmentPane getURLActionLabel(final String url) { ActionLabel actionLabel = new ActionLabel(url); - if (ComparatorUtils.equals(url, CloudCenter.getInstance().acquireUrlByKind("bbs.reset"))) { + if (ComparatorUtils.equals(url, resetMark.getValue())) { actionLabel.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_BBSLogin_Forgot-Password")); } else { actionLabel.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_BBSLogin_Register_Account")); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/bbs/UserInfoLabel.java b/designer-realize/src/main/java/com/fr/design/mainframe/bbs/UserInfoLabel.java index 4d168557f6..92a2882545 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/bbs/UserInfoLabel.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/bbs/UserInfoLabel.java @@ -15,6 +15,7 @@ import com.fr.design.extra.WebViewDlgHelper; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.imenu.UIMenuItem; import com.fr.design.gui.imenu.UIPopupMenu; +import com.fr.design.locale.impl.BbsSpaceMark; import com.fr.design.mainframe.DesignerContext; import com.fr.design.os.impl.SupportOSImpl; import com.fr.design.upm.event.CertificateEvent; @@ -27,6 +28,8 @@ import com.fr.general.CloudCenter; import com.fr.general.ComparatorUtils; import com.fr.general.DateUtils; import com.fr.general.http.HttpClient; +import com.fr.general.locale.LocaleCenter; +import com.fr.general.locale.LocaleMark; import com.fr.log.FineLoggerFactory; import com.fr.stable.EncodeConstants; import com.fr.stable.StableUtils; @@ -96,8 +99,8 @@ public class UserInfoLabel extends UILabel { public void mousePressed(MouseEvent e) { if (StringUtils.isNotEmpty(userName)) { try { - String loginUrl = CloudCenter.getInstance().acquireUrlByKind("bbs.default"); - Desktop.getDesktop().browse(new URI(loginUrl)); + LocaleMark spaceMark = LocaleCenter.getMark(BbsSpaceMark.class); + Desktop.getDesktop().browse(new URI(spaceMark.getValue())); } catch (Exception exp) { FineLoggerFactory.getLogger().info(exp.getMessage()); }