From 8bfc7697e9e3d355c9162535cc064b7ef3b37ad6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E7=A3=8A?= <294531121@qq.com> Date: Fri, 26 Nov 2021 11:37:24 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-62439=20=E5=9B=BD=E9=99=85=E5=8C=96-?= =?UTF-8?q?=E5=B1=8F=E8=94=BD=E6=B5=B7=E5=A4=96=E8=AE=BE=E8=AE=A1=E5=99=A8?= =?UTF-8?q?=E5=86=85=E7=99=BB=E5=BD=95=E5=85=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/config/DesignerProperties.java | 52 +++++++++++++++++++ .../mainframe/NorthRegionContainerPane.java | 16 +----- .../com/fr/design/os/impl/SupportOSImpl.java | 7 +-- .../fr/start/module/DesignerActivator.java | 13 +++-- 4 files changed, 63 insertions(+), 25 deletions(-) create mode 100644 designer-base/src/main/java/com/fr/design/config/DesignerProperties.java diff --git a/designer-base/src/main/java/com/fr/design/config/DesignerProperties.java b/designer-base/src/main/java/com/fr/design/config/DesignerProperties.java new file mode 100644 index 0000000000..d14c7938a9 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/config/DesignerProperties.java @@ -0,0 +1,52 @@ +package com.fr.design.config; + +import com.fr.general.IOUtils; +import com.fr.log.FineLoggerFactory; +import com.fr.stable.StableUtils; +import com.fr.stable.StringUtils; + +import java.io.BufferedInputStream; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.InputStream; +import java.util.Properties; + +public class DesignerProperties { + private static DesignerProperties holder = null; + private boolean supportLoginEntry = true; + + public DesignerProperties() { + String filePath = StableUtils.pathJoin(StableUtils.getInstallHome(), "/config/config.properties"); + InputStream is = null; + try { + is = new BufferedInputStream(new FileInputStream(filePath)); + Properties ps = new Properties(); + ps.load(is); + this.initProperties(ps); + } catch (FileNotFoundException e) { + // ignore + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e, e.getMessage()); + } finally { + IOUtils.close(is); + } + } + + public static DesignerProperties getInstance() { + if (holder == null) { + holder = new DesignerProperties(); + } + return holder; + } + + private void initProperties(Properties ps) { + String supportLoginEntry = ps.getProperty("supportLoginEntry"); + if (StringUtils.isNotEmpty(supportLoginEntry)) { + this.supportLoginEntry = Boolean.valueOf(supportLoginEntry); + } + } + + public boolean isSupportLoginEntry() { + return supportLoginEntry; + } +} \ No newline at end of file diff --git a/designer-base/src/main/java/com/fr/design/mainframe/NorthRegionContainerPane.java b/designer-base/src/main/java/com/fr/design/mainframe/NorthRegionContainerPane.java index 6802024eac..68d783ba3b 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/NorthRegionContainerPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/NorthRegionContainerPane.java @@ -2,8 +2,6 @@ package com.fr.design.mainframe; import com.fr.design.DesignState; import com.fr.design.DesignerEnvManager; -import com.fr.design.ExtraDesignClassManager; -import com.fr.design.fun.TitlePlaceProcessor; import com.fr.design.gui.imenu.UIMenuHighLight; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.loghandler.LogMessageBar; @@ -25,7 +23,6 @@ import javax.swing.JMenuBar; import javax.swing.JPanel; import javax.swing.SwingUtilities; import java.awt.BorderLayout; -import java.awt.Component; import java.awt.FlowLayout; /** @@ -143,17 +140,6 @@ public class NorthRegionContainerPane extends JPanel { northEastPane.removeAll(); northEastPane.setLayout(new FlowLayout(FlowLayout.RIGHT, 0, 0)); northEastPane.add(LogMessageBar.getInstance()); - TitlePlaceProcessor processor = ExtraDesignClassManager.getInstance().getSingle(TitlePlaceProcessor.MARK_STRING); - if (processor != null) { - final Component[] bbsLoginPane = {null}; - OSSupportCenter.buildAction(new OSBasedAction() { - @Override - public void execute(Object... objects) { - bbsLoginPane[0] = ad.createBBSLoginPane(); - } - }, SupportOSImpl.USERINFOPANE); - processor.hold(northEastPane, LogMessageBar.getInstance(), bbsLoginPane[0]); - } northEastPane.add(ad.createAlphaFinePane()); if (!DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().isEnabled()) { ad.createAlphaFinePane().setVisible(false); @@ -166,7 +152,7 @@ public class NorthRegionContainerPane extends JPanel { public void execute(Object... objects) { northEastPane.add(ad.createBBSLoginPane()); } - }, SupportOSImpl.USERINFOPANE); + }, SupportOSImpl.BBS_USER_LOGIN_PANE); } diff --git a/designer-base/src/main/java/com/fr/design/os/impl/SupportOSImpl.java b/designer-base/src/main/java/com/fr/design/os/impl/SupportOSImpl.java index 949d770456..e8871154e6 100644 --- a/designer-base/src/main/java/com/fr/design/os/impl/SupportOSImpl.java +++ b/designer-base/src/main/java/com/fr/design/os/impl/SupportOSImpl.java @@ -1,6 +1,7 @@ package com.fr.design.os.impl; import com.fr.base.FRContext; +import com.fr.design.config.DesignerProperties; import com.fr.design.jdk.JdkVersion; import com.fr.general.CloudCenter; import com.fr.general.GeneralContext; @@ -22,11 +23,11 @@ import java.util.Locale; public enum SupportOSImpl implements SupportOS { /** - * ARM下屏蔽登录 + * 屏蔽登录入口 */ - USERINFOPANE{ + BBS_USER_LOGIN_PANE { public boolean support(){ - return Arch.getArch() != Arch.ARM; + return Arch.getArch() != Arch.ARM && DesignerProperties.getInstance().isSupportLoginEntry(); } }, /** 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 921d8efe77..477ac8ae38 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 @@ -6,10 +6,10 @@ import com.fr.base.MultiFieldParameter; import com.fr.base.passport.FinePassportListenerAdapter; import com.fr.base.passport.FinePassportManager; import com.fr.base.process.ProcessOperator; -import com.fr.chart.chartattr.ChartCollection; -import com.fr.config.MarketConfig; import com.fr.base.theme.migrator.FormThemeConfigMigrator; import com.fr.base.theme.migrator.ReportThemeConfigMigrator; +import com.fr.chart.chartattr.ChartCollection; +import com.fr.config.MarketConfig; import com.fr.decision.update.backup.RecoverManager; import com.fr.design.DesignerEnvManager; import com.fr.design.ExtraDesignClassManager; @@ -29,9 +29,9 @@ import com.fr.design.actions.insert.flot.ImageFloatAction; import com.fr.design.actions.insert.flot.TextBoxFloatAction; import com.fr.design.bridge.DesignToolbarProvider; import com.fr.design.constants.DesignerLaunchStatus; +import com.fr.design.env.DesignerWorkspaceLoader; import com.fr.design.fit.NewJForm; import com.fr.design.fit.common.TemplateTool; -import com.fr.design.env.DesignerWorkspaceLoader; import com.fr.design.form.parameter.FormParaDesigner; import com.fr.design.fun.ElementUIProvider; import com.fr.design.gui.controlpane.NameObjectCreator; @@ -62,7 +62,6 @@ import com.fr.design.mainframe.form.FormECDesignerProvider; import com.fr.design.mainframe.form.FormElementCaseDesigner; import com.fr.design.mainframe.form.FormReportComponentComposite; import com.fr.design.mainframe.guide.GuideRegister; -import com.fr.design.mainframe.guide.collect.GuideCollector; import com.fr.design.mainframe.loghandler.DesignerLogAppender; import com.fr.design.mainframe.share.constants.ShareEntryKey; import com.fr.design.mainframe.socketio.DesignerSocketIO; @@ -131,11 +130,11 @@ import com.fr.task.Once; import com.fr.workspace.WorkContext; import com.fr.xml.ReportXMLUtils; +import java.awt.Image; +import java.awt.image.BufferedImage; import java.util.ArrayList; import java.util.List; import java.util.Set; -import java.awt.Image; -import java.awt.image.BufferedImage; /** * Created by juhaoyu on 2018/1/31. @@ -175,7 +174,7 @@ public class DesignerActivator extends Activator implements Prepare { public void execute(Object... objects) { UserInfoPane.getInstance().updateBBSUserInfo(); } - }, SupportOSImpl.USERINFOPANE); + }, SupportOSImpl.BBS_USER_LOGIN_PANE); storePassport(); AlphaFineHelper.switchConfig4Locale(); RecoverManager.register(new RecoverForDesigner());