From 99244eb9ef0ac10aa9008748bb175fed566af410 Mon Sep 17 00:00:00 2001 From: kerry Date: Mon, 30 Jul 2018 09:59:49 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-10049=E3=80=9010.0=E4=BA=8C=E8=BD=AE?= =?UTF-8?q?=E5=9B=9E=E5=BD=92=E3=80=91=E8=AE=BE=E8=AE=A1=E5=99=A8=E5=8F=B3?= =?UTF-8?q?=E4=B8=8A=E8=A7=92=E7=99=BB=E5=BD=95=E5=90=8E=EF=BC=8C=E9=87=8D?= =?UTF-8?q?=E5=90=AF=E4=BB=8D=E7=84=B6=E6=98=BE=E7=A4=BA=E6=9C=AA=E7=99=BB?= =?UTF-8?q?=E5=BD=95=EF=BC=8C=E6=89=93=E5=BC=80=E4=B8=80=E4=B8=8B=E8=AE=BE?= =?UTF-8?q?=E8=AE=A1=E5=99=A8=E6=8F=92=E4=BB=B6=E7=AE=A1=E7=90=86=E6=89=8D?= =?UTF-8?q?=E5=87=BA=E6=9D=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/mainframe/bbs/UserInfoPane.java | 30 ++++++------------- .../fr/start/module/DesignerActivator.java | 2 ++ 2 files changed, 11 insertions(+), 21 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/bbs/UserInfoPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/bbs/UserInfoPane.java index d04e4aba1c..f02142e1f0 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/bbs/UserInfoPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/bbs/UserInfoPane.java @@ -4,18 +4,14 @@ package com.fr.design.mainframe.bbs; import com.fr.base.FRContext; -import com.fr.config.BaseDBEnv; import com.fr.config.MarketConfig; import com.fr.design.DesignerEnvManager; import com.fr.design.constants.UIConstants; import com.fr.design.dialog.BasicPane; import com.fr.design.mainframe.DesignerContext; import com.fr.general.DateUtils; -import com.fr.general.GeneralContext; - -import com.fr.stable.EnvChangedListener; +import com.fr.log.FineLoggerFactory; import com.fr.stable.StringUtils; - import java.awt.BorderLayout; import java.awt.Color; import java.awt.Dimension; @@ -73,7 +69,6 @@ public class UserInfoPane extends BasicPane { this.userInfoLabel = new UserInfoLabel(this); this.markUnSignIn(); - addEnvChangedListener(); autoPushLoginDialog(); this.add(userInfoLabel, BorderLayout.CENTER); @@ -115,20 +110,13 @@ public class UserInfoPane extends BasicPane { return StringUtils.EMPTY; } - private void addEnvChangedListener() { - GeneralContext.addEnvChangedListener(new EnvChangedListener() { - @Override - public void envChanged() { - if (BaseDBEnv.isDBEnvAvailable()) { - String username = MarketConfig.getInstance().getBbsUsername(); - if (StringUtils.isEmpty(username)) { - markUnSignIn(); - } else { - markSignIn(username); - } - } - } - }); + public void updateBBSUserInfo(){ + String username = MarketConfig.getInstance().getBbsUsername(); + if (StringUtils.isEmpty(username)) { + markUnSignIn(); + } else { + markSignIn(username); + } } @@ -154,7 +142,7 @@ public class UserInfoPane extends BasicPane { return dayNew - dayOld; } } catch (ParseException e) { - FRContext.getLogger().error(e.getMessage()); + FineLoggerFactory.getLogger().error(e.getMessage()); } return 1; } diff --git a/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java b/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java index 89a467443e..4922f3db4d 100644 --- a/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java +++ b/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java @@ -43,6 +43,7 @@ import com.fr.design.mainframe.WidgetPropertyPane; import com.fr.design.mainframe.WidgetToolBarPane; import com.fr.design.mainframe.actions.NewFormAction; import com.fr.design.mainframe.bbs.BBSGuestPane; +import com.fr.design.mainframe.bbs.UserInfoPane; import com.fr.design.mainframe.form.FormECCompositeProvider; import com.fr.design.mainframe.form.FormECDesignerProvider; import com.fr.design.mainframe.form.FormElementCaseDesigner; @@ -123,6 +124,7 @@ public class DesignerActivator extends Activator implements Prepare { preLoadPane(); loadLogAppender(); DesignerSocketIO.update(); + UserInfoPane.getInstance().updateBBSUserInfo(); } private void loadLogAppender() {