diff --git a/designer-base/src/main/java/com/fr/design/actions/community/BBSAction.java b/designer-base/src/main/java/com/fr/design/actions/community/BBSAction.java index 1acbbe4170..ed487578c8 100644 --- a/designer-base/src/main/java/com/fr/design/actions/community/BBSAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/community/BBSAction.java @@ -1,14 +1,22 @@ package com.fr.design.actions.community; +import com.fr.design.i18n.LocaleLinkProvider; import com.fr.design.login.AbstractDesignerSSO; import com.fr.design.menu.MenuKeySet; -import com.fr.general.CloudCenter; - -import javax.swing.*; +import javax.swing.KeyStroke; public class BBSAction extends AbstractDesignerSSO { + /** + * 云中心帆软社区页在配置文件中对应的配置文件key + */ + private static final String PROPS_LINK_KEY = "Fine-Design-CloudCenter_Bbs"; + + /** + * 云中心帆软社区页默认链接在配置文件中对应的配置文件key + */ + private static final String PROPS_LINK_KEY_DEFAULT = "Fine-Design-CloudCenter_Bbs_Default"; public BBSAction() { this.setMenuKeySet(BBS); @@ -20,7 +28,7 @@ public class BBSAction extends AbstractDesignerSSO { @Override public String getJumpUrl() { - return CloudCenter.getInstance().acquireUrlByKind("bbs", "http://bbs.fanruan.com/"); + return LocaleLinkProvider.getInstance().getLink(PROPS_LINK_KEY, PROPS_LINK_KEY_DEFAULT); } public static final MenuKeySet BBS = new MenuKeySet() { diff --git a/designer-base/src/main/java/com/fr/design/actions/community/BugAction.java b/designer-base/src/main/java/com/fr/design/actions/community/BugAction.java index 5365e556b6..9da1539a5a 100644 --- a/designer-base/src/main/java/com/fr/design/actions/community/BugAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/community/BugAction.java @@ -1,13 +1,23 @@ package com.fr.design.actions.community; +import com.fr.design.i18n.LocaleLinkProvider; import com.fr.design.login.AbstractDesignerSSO; import com.fr.design.menu.MenuKeySet; -import com.fr.general.CloudCenter; -import javax.swing.*; +import javax.swing.KeyStroke; public class BugAction extends AbstractDesignerSSO { + /** + * 云中心产品反馈页在配置文件中对应的配置文件key + */ + private static final String PROPS_LINK_KEY = "Fine-Design-CloudCenter_Bugs"; + + /** + * 云中心产品反馈页默认链接在配置文件中对应的配置文件key + */ + private static final String PROPS_LINK_KEY_DEFAULT = "Fine-Design-CloudCenter_Bugs_Default"; + public BugAction() { this.setMenuKeySet(BUG); this.setName(getMenuKeySet().getMenuName()); @@ -17,7 +27,7 @@ public class BugAction extends AbstractDesignerSSO { @Override public String getJumpUrl() { - return CloudCenter.getInstance().acquireUrlByKind("bbs.bugs", "https://service.fanruan.com/PF/FR/feedback?type=2"); + return LocaleLinkProvider.getInstance().getLink(PROPS_LINK_KEY, PROPS_LINK_KEY_DEFAULT); } public static final MenuKeySet BUG = new MenuKeySet() { diff --git a/designer-base/src/main/java/com/fr/design/actions/community/CenterAction.java b/designer-base/src/main/java/com/fr/design/actions/community/CenterAction.java index 6ae03f1a8a..093070b55c 100644 --- a/designer-base/src/main/java/com/fr/design/actions/community/CenterAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/community/CenterAction.java @@ -1,7 +1,7 @@ package com.fr.design.actions.community; +import com.fr.design.i18n.LocaleLinkProvider; import com.fr.design.menu.MenuKeySet; -import com.fr.general.CloudCenter; import javax.swing.KeyStroke; @@ -9,6 +9,17 @@ import javax.swing.KeyStroke; * Created by XINZAI on 2018/8/23. */ public class CenterAction extends UpAction { + + /** + * 云中心活动中心页在配置文件中对应的配置文件key + */ + private static final String PROPS_LINK_KEY = "Fine-Design-CloudCenter_Act_Center"; + + /** + * 云中心活动中心页默认链接在配置文件中对应的配置文件key + */ + private static final String PROPS_LINK_KEY_DEFAULT = "Fine-Design-CloudCenter_Act_Center_Default"; + public CenterAction() { this.setMenuKeySet(CENTER); this.setName(getMenuKeySet().getMenuName()); @@ -18,7 +29,7 @@ public class CenterAction extends UpAction { @Override public String getJumpUrl() { - return CloudCenter.getInstance().acquireUrlByKind("bbs.center", "http://bbs.fanruan.com/events/"); + return LocaleLinkProvider.getInstance().getLink(PROPS_LINK_KEY, PROPS_LINK_KEY_DEFAULT); } public static final MenuKeySet CENTER = new MenuKeySet() { diff --git a/designer-base/src/main/java/com/fr/design/actions/community/CusDemandAction.java b/designer-base/src/main/java/com/fr/design/actions/community/CusDemandAction.java index 007eeb9abf..ef4cea39de 100644 --- a/designer-base/src/main/java/com/fr/design/actions/community/CusDemandAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/community/CusDemandAction.java @@ -1,18 +1,28 @@ package com.fr.design.actions.community; import com.fr.base.BaseUtils; - +import com.fr.design.i18n.LocaleLinkProvider; import com.fr.design.menu.MenuKeySet; import com.fr.design.utils.BrowseUtils; -import com.fr.general.CloudCenter; -import javax.swing.KeyStroke; +import javax.swing.KeyStroke; import java.awt.event.ActionEvent; /** * Created by XINZAI on 2018/8/23. */ public class CusDemandAction extends UpAction{ + + /** + * 云中心发布需求页在配置文件中对应的配置文件key + */ + private static final String PROPS_LINK_KEY = "Fine-Design-CloudCenter_Demand"; + + /** + * 云中心发布需求页默认链接在配置文件中对应的配置文件key + */ + private static final String PROPS_LINK_KEY_DEFAULT = "Fine-Design-CloudCenter_Demand_Default"; + public CusDemandAction() { this.setMenuKeySet(DEMAND); @@ -25,7 +35,7 @@ public class CusDemandAction extends UpAction{ @Override public void actionPerformed(ActionEvent arg0) { - String url = CloudCenter.getInstance().acquireUrlByKind("bbs.demand", "https://market.fanruan.com/demand"); + String url = LocaleLinkProvider.getInstance().getLink(PROPS_LINK_KEY, PROPS_LINK_KEY_DEFAULT); BrowseUtils.browser(url); } diff --git a/designer-base/src/main/java/com/fr/design/actions/community/FacebookFansAction.java b/designer-base/src/main/java/com/fr/design/actions/community/FacebookFansAction.java index e5ff4dd472..05ef85e44f 100644 --- a/designer-base/src/main/java/com/fr/design/actions/community/FacebookFansAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/community/FacebookFansAction.java @@ -1,14 +1,24 @@ package com.fr.design.actions.community; -import com.fr.base.svg.IconUtils; +import com.fr.design.i18n.LocaleLinkProvider; import com.fr.design.menu.MenuKeySet; import com.fr.design.utils.BrowseUtils; -import com.fr.general.CloudCenter; + import javax.swing.KeyStroke; import java.awt.event.ActionEvent; public class FacebookFansAction extends UpAction { + /** + * 云中心facebook页在配置文件中对应的配置文件key + */ + private static final String PROPS_LINK_KEY = "Fine-Design-CloudCenter_FaceBook"; + + /** + * 云中心facebook页默认链接在配置文件中对应的配置文件key + */ + private static final String PROPS_LINK_KEY_DEFAULT = "Fine-Design-CloudCenter_FaceBook_Default"; + public FacebookFansAction() { this.setMenuKeySet(FACEBOOKFANS); this.setName(getMenuKeySet().getMenuName()); @@ -18,7 +28,7 @@ public class FacebookFansAction extends UpAction { @Override public void actionPerformed(ActionEvent arg0) { - BrowseUtils.browser(CloudCenter.getInstance().acquireUrlByKind("facebook.fans.tw", "https://www.facebook.com/twfinereport")); + BrowseUtils.browser(LocaleLinkProvider.getInstance().getLink(PROPS_LINK_KEY, PROPS_LINK_KEY_DEFAULT)); } public static final MenuKeySet FACEBOOKFANS = new MenuKeySet() { diff --git a/designer-base/src/main/java/com/fr/design/actions/community/NeedAction.java b/designer-base/src/main/java/com/fr/design/actions/community/NeedAction.java index 62d4b9c95f..33279060b6 100644 --- a/designer-base/src/main/java/com/fr/design/actions/community/NeedAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/community/NeedAction.java @@ -1,13 +1,23 @@ package com.fr.design.actions.community; +import com.fr.design.i18n.LocaleLinkProvider; import com.fr.design.login.AbstractDesignerSSO; import com.fr.design.menu.MenuKeySet; -import com.fr.general.CloudCenter; -import javax.swing.*; +import javax.swing.KeyStroke; public class NeedAction extends AbstractDesignerSSO { + /** + * 云中心产品反馈页在配置文件中对应的配置文件key + */ + private static final String PROPS_LINK_KEY = "Fine-Design-CloudCenter_Need"; + + /** + * 云中心产品反馈页默认链接在配置文件中对应的配置文件key + */ + private static final String PROPS_LINK_KEY_DEFAULT = "Fine-Design-CloudCenter_Need_Default"; + public NeedAction() { this.setMenuKeySet(NEED); this.setName(getMenuKeySet().getMenuName()); @@ -18,7 +28,7 @@ public class NeedAction extends AbstractDesignerSSO { @Override public String getJumpUrl() { - return CloudCenter.getInstance().acquireUrlByKind("bbs.needs", "https://service.fanruan.com/PF/FR/feedback?type=1"); + return LocaleLinkProvider.getInstance().getLink(PROPS_LINK_KEY ,PROPS_LINK_KEY_DEFAULT); } public static final MenuKeySet NEED = new MenuKeySet() { diff --git a/designer-base/src/main/java/com/fr/design/actions/community/QuestionAction.java b/designer-base/src/main/java/com/fr/design/actions/community/QuestionAction.java index d6b95217a5..e56359139a 100644 --- a/designer-base/src/main/java/com/fr/design/actions/community/QuestionAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/community/QuestionAction.java @@ -1,13 +1,23 @@ package com.fr.design.actions.community; +import com.fr.design.i18n.LocaleLinkProvider; import com.fr.design.login.AbstractDesignerSSO; import com.fr.design.menu.MenuKeySet; -import com.fr.general.CloudCenter; -import javax.swing.*; +import javax.swing.KeyStroke; public class QuestionAction extends AbstractDesignerSSO { + /** + * 云中心问答页在配置文件中对应的配置文件key + */ + private static final String PROPS_LINK_KEY = "Fine-Design-CloudCenter_Question"; + + /** + * 云中心问答页默认链接在配置文件中对应的配置文件key + */ + private static final String PROPS_LINK_KEY_DEFAULT = "Fine-Design-CloudCenter_Question_Default"; + public QuestionAction() { this.setMenuKeySet(QUESTIONS); this.setName(getMenuKeySet().getMenuName()); @@ -18,7 +28,7 @@ public class QuestionAction extends AbstractDesignerSSO { @Override public String getJumpUrl() { - return CloudCenter.getInstance().acquireUrlByKind("bbs.questions", "https://home.fanruan.com/finereport/wenda"); + return LocaleLinkProvider.getInstance().getLink(PROPS_LINK_KEY ,PROPS_LINK_KEY_DEFAULT); } public static final MenuKeySet QUESTIONS = new MenuKeySet() { diff --git a/designer-base/src/main/java/com/fr/design/actions/community/SignAction.java b/designer-base/src/main/java/com/fr/design/actions/community/SignAction.java index 110af35340..29817e36a6 100644 --- a/designer-base/src/main/java/com/fr/design/actions/community/SignAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/community/SignAction.java @@ -1,14 +1,23 @@ package com.fr.design.actions.community; +import com.fr.design.i18n.LocaleLinkProvider; import com.fr.design.login.AbstractDesignerSSO; import com.fr.design.menu.MenuKeySet; -import com.fr.general.CloudCenter; - -import javax.swing.*; +import javax.swing.KeyStroke; public class SignAction extends AbstractDesignerSSO { + /** + * 云中心认证落地页在配置文件中对应的配置文件key + */ + private static final String PROPS_LINK_KEY = "Fine-Design-CloudCenter_Aut"; + + /** + * 云中心认证落地页默认链接在配置文件中对应的配置文件key + */ + private static final String PROPS_LINK_KEY_DEFAULT = "Fine-Design-CloudCenter_Aut_Default"; + public SignAction() { this.setMenuKeySet(SIGN); this.setName(getMenuKeySet().getMenuName()); @@ -18,7 +27,7 @@ public class SignAction extends AbstractDesignerSSO { @Override public String getJumpUrl() { - return CloudCenter.getInstance().acquireUrlByKind("bbs.aut", "https://cert.fanruan.com/"); + return LocaleLinkProvider.getInstance().getLink(PROPS_LINK_KEY ,PROPS_LINK_KEY_DEFAULT); } public static final MenuKeySet SIGN = new MenuKeySet() { diff --git a/designer-base/src/main/java/com/fr/design/actions/community/StudyPlanAction.java b/designer-base/src/main/java/com/fr/design/actions/community/StudyPlanAction.java index d0dcc4195d..0d2e79905d 100644 --- a/designer-base/src/main/java/com/fr/design/actions/community/StudyPlanAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/community/StudyPlanAction.java @@ -1,10 +1,21 @@ package com.fr.design.actions.community; +import com.fr.design.i18n.LocaleLinkProvider; import com.fr.design.i18n.Toolkit; import com.fr.design.login.AbstractDesignerSSO; -import com.fr.general.CloudCenter; public class StudyPlanAction extends AbstractDesignerSSO { + + /** + * 云中心帆软学院在配置文件中对应的配置文件key + */ + private static final String PROPS_LINK_KEY = "Fine-Design-CloudCenter_Study"; + + /** + * 云中心帆软学院默认链接在配置文件中对应的配置文件key + */ + private static final String PROPS_LINK_KEY_DEFAULT = "Fine-Design-CloudCenter_Study_Default"; + public StudyPlanAction() { this.setName(Toolkit.i18nText("Fine-Design_Study_Plan")); this.setSmallIcon("/com/fr/design/images/bbs/studyPlan"); @@ -12,6 +23,6 @@ public class StudyPlanAction extends AbstractDesignerSSO { @Override public String getJumpUrl() { - return CloudCenter.getInstance().acquireUrlByKind("bbs.studyPlan", "https://edu.fanruan.com/studypath/finereport"); + return LocaleLinkProvider.getInstance().getLink(PROPS_LINK_KEY ,PROPS_LINK_KEY_DEFAULT); } } diff --git a/designer-base/src/main/java/com/fr/design/actions/community/TechSolutionAction.java b/designer-base/src/main/java/com/fr/design/actions/community/TechSolutionAction.java index 9372304868..f0e4f3ac30 100644 --- a/designer-base/src/main/java/com/fr/design/actions/community/TechSolutionAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/community/TechSolutionAction.java @@ -1,8 +1,8 @@ package com.fr.design.actions.community; +import com.fr.design.i18n.LocaleLinkProvider; import com.fr.design.login.AbstractDesignerSSO; import com.fr.design.menu.MenuKeySet; -import com.fr.general.CloudCenter; import javax.swing.KeyStroke; @@ -10,6 +10,17 @@ import javax.swing.KeyStroke; * Created by XINZAI on 2018/8/23. */ public class TechSolutionAction extends AbstractDesignerSSO { + + /** + * 云中心社区在配置文件中对应的配置文件key + */ + private static final String PROPS_LINK_KEY = "Fine-Design-CloudCenter_Community"; + + /** + * 云中心社区默认链接在配置文件中对应的配置文件key + */ + private static final String PROPS_LINK_KEY_DEFAULT = "Fine-Design-CloudCenter_Community_Default"; + public TechSolutionAction() { this.setMenuKeySet(TSO); this.setName(getMenuKeySet().getMenuName()); @@ -20,7 +31,7 @@ public class TechSolutionAction extends AbstractDesignerSSO { @Override public String getJumpUrl() { - return CloudCenter.getInstance().acquireUrlByKind("bbs.solution", "https://home.fanruan.com/finereport/forum"); + return LocaleLinkProvider.getInstance().getLink(PROPS_LINK_KEY ,PROPS_LINK_KEY_DEFAULT); } public static final MenuKeySet TSO = new MenuKeySet() { diff --git a/designer-base/src/main/java/com/fr/design/actions/community/TemplateStoreAction.java b/designer-base/src/main/java/com/fr/design/actions/community/TemplateStoreAction.java index eec904ebd6..3c17df9b56 100644 --- a/designer-base/src/main/java/com/fr/design/actions/community/TemplateStoreAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/community/TemplateStoreAction.java @@ -1,21 +1,28 @@ package com.fr.design.actions.community; import com.fr.base.BaseUtils; -import com.fr.design.actions.UpdateAction; +import com.fr.design.i18n.LocaleLinkProvider; import com.fr.design.login.AbstractDesignerSSO; import com.fr.design.mainframe.share.collect.ComponentCollector; import com.fr.design.menu.MenuKeySet; -import com.fr.design.utils.BrowseUtils; -import com.fr.general.CloudCenter; import javax.swing.KeyStroke; -import java.awt.event.ActionEvent; /** * created by Harrison on 2020/03/24 **/ public class TemplateStoreAction extends AbstractDesignerSSO { - + + /** + * 云中心组件商城模板在配置文件中对应的配置文件key + */ + private static final String PROPS_LINK_KEY = "Fine-Design-CloudCenter_Market_Template"; + + /** + * 云中心组件商城模板默认链接在配置文件中对应的配置文件key + */ + private static final String PROPS_LINK_KEY_DEFAULT = "Fine-Design-CloudCenter_Market_Template_Default"; + public TemplateStoreAction() { this.setMenuKeySet(TEMPLATE); @@ -47,6 +54,6 @@ public class TemplateStoreAction extends AbstractDesignerSSO { @Override public String getJumpUrl() { ComponentCollector.getInstance().collectTepMenuEnterClick(); - return CloudCenter.getInstance().acquireUrlByKind("design.market.template", "https://market.fanruan.com/template"); + return LocaleLinkProvider.getInstance().getLink(PROPS_LINK_KEY ,PROPS_LINK_KEY_DEFAULT); } } diff --git a/designer-base/src/main/java/com/fr/design/actions/community/UpAction.java b/designer-base/src/main/java/com/fr/design/actions/community/UpAction.java index 05022ecf8c..e0c6404836 100644 --- a/designer-base/src/main/java/com/fr/design/actions/community/UpAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/community/UpAction.java @@ -1,14 +1,24 @@ package com.fr.design.actions.community; import com.fr.base.BaseUtils; +import com.fr.design.i18n.LocaleLinkProvider; import com.fr.design.login.AbstractDesignerSSO; import com.fr.design.menu.MenuKeySet; -import com.fr.general.CloudCenter; import javax.swing.KeyStroke; public class UpAction extends AbstractDesignerSSO { + /** + * 云中心工单中心在配置文件中对应的配置文件key + */ + private static final String PROPS_LINK_KEY = "Fine-Design-CloudCenter_Bbs_Update"; + + /** + * 云中心工单中心默认链接在配置文件中对应的配置文件key + */ + private static final String PROPS_LINK_KEY_DEFAULT = "Fine-Design-CloudCenter_Bbs_Update_Default"; + public UpAction() { this.setMenuKeySet(UPDATE); this.setName(getMenuKeySet().getMenuName()); @@ -18,7 +28,7 @@ public class UpAction extends AbstractDesignerSSO { @Override public String getJumpUrl() { - return CloudCenter.getInstance().acquireUrlByKind("bbs.update", "http://bbs.fanruan.com/forum.php?mod=collection&action=view&ctid=10"); + return LocaleLinkProvider.getInstance().getLink(PROPS_LINK_KEY ,PROPS_LINK_KEY_DEFAULT); } public static final MenuKeySet UPDATE = new MenuKeySet() { diff --git a/designer-base/src/main/java/com/fr/design/actions/community/WorkOrderCenterAction.java b/designer-base/src/main/java/com/fr/design/actions/community/WorkOrderCenterAction.java index d1168eca70..03e634a4ad 100644 --- a/designer-base/src/main/java/com/fr/design/actions/community/WorkOrderCenterAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/community/WorkOrderCenterAction.java @@ -1,7 +1,7 @@ package com.fr.design.actions.community; +import com.fr.design.i18n.LocaleLinkProvider; import com.fr.design.i18n.Toolkit; -import com.fr.general.CloudCenter; /** * @Description 工单中心 @@ -9,6 +9,17 @@ import com.fr.general.CloudCenter; * @Date 2021/3/8 14:02 **/ public class WorkOrderCenterAction extends UpAction { + + /** + * 云中心工单中心在配置文件中对应的配置文件key + */ + private static final String PROPS_LINK_KEY = "Fine-Design-CloudCenter_Work_Order_Center"; + + /** + * 云中心工单中心默认链接在配置文件中对应的配置文件key + */ + private static final String PROPS_LINK_KEY_DEFAULT = "Fine-Design-CloudCenter_Work_Order_Center_Default"; + public WorkOrderCenterAction() { this.setSmallIcon("/com/fr/design/images/bbs/workOrderCenter"); this.setName(Toolkit.i18nText("Fine-Design_Basic_Commuinity_Work_Order_Center")); @@ -16,6 +27,6 @@ public class WorkOrderCenterAction extends UpAction { @Override public String getJumpUrl() { - return CloudCenter.getInstance().acquireUrlByKind("bbs.work.order.center", "https://service.fanruan.com/ticket"); + return LocaleLinkProvider.getInstance().getLink(PROPS_LINK_KEY, PROPS_LINK_KEY_DEFAULT); } } \ No newline at end of file diff --git a/designer-base/src/main/java/com/fr/design/actions/file/SwitchExistEnv.java b/designer-base/src/main/java/com/fr/design/actions/file/SwitchExistEnv.java index 33761a92e2..e38a39895a 100644 --- a/designer-base/src/main/java/com/fr/design/actions/file/SwitchExistEnv.java +++ b/designer-base/src/main/java/com/fr/design/actions/file/SwitchExistEnv.java @@ -68,7 +68,7 @@ public class SwitchExistEnv extends MenuDef { EnvChangeEntrance.getInstance().chooseEnv(envName); } else { SaveSomeTemplatePane saveSomeTemplatePane = new SaveSomeTemplatePane(true); - if (saveSomeTemplatePane.showSavePane()) { + if (saveSomeTemplatePane.showSavePane(true)) { // 用户模板保存后,才进行切换目录操作 EnvChangeEntrance.getInstance().switch2Env(envName); } diff --git a/designer-base/src/main/java/com/fr/design/actions/help/TutorialAction.java b/designer-base/src/main/java/com/fr/design/actions/help/TutorialAction.java index 51a390c82d..1a4bccfa4a 100644 --- a/designer-base/src/main/java/com/fr/design/actions/help/TutorialAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/help/TutorialAction.java @@ -1,9 +1,9 @@ package com.fr.design.actions.help; +import com.fr.design.i18n.LocaleLinkProvider; import com.fr.design.i18n.Toolkit; import com.fr.design.login.AbstractDesignerSSO; import com.fr.design.menu.MenuKeySet; -import com.fr.general.CloudCenter; import com.fr.general.GeneralContext; import com.fr.general.http.HttpToolbox; import com.fr.stable.CommonUtils; @@ -18,6 +18,16 @@ import java.awt.event.KeyEvent; public class TutorialAction extends AbstractDesignerSSO { + /** + * 云中心社区帮助文档在配置文件中对应的配置文件key + */ + private static final String PROPS_LINK_KEY = "Fine-Design-CloudCenter_Help"; + + /** + * 云中心社区帮助文档默认链接在配置文件中对应的配置文件key + */ + private static final String PROPS_LINK_KEY_DEFAULT = "Fine-Design-CloudCenter_Help_Default"; + public TutorialAction() { this.setMenuKeySet(HELP_TUTORIAL); this.setName(getMenuKeySet().getMenuName()); @@ -28,7 +38,7 @@ public class TutorialAction extends AbstractDesignerSSO { @Override public String getJumpUrl() { - return CloudCenter.getInstance().acquireUrlByKind(createDocKey(), "http://help.finereport.com"); + return LocaleLinkProvider.getInstance().getLink(PROPS_LINK_KEY, PROPS_LINK_KEY_DEFAULT); } // 生成帮助文档 sitecenter key, help.zh_CN.10 diff --git a/designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java b/designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java index 175af0653f..712dcbd33b 100644 --- a/designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java +++ b/designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java @@ -669,6 +669,7 @@ public abstract class DesignTableDataManager { if (needLoadingBar) { MultiResultTableDataWrapper.loadingBar.start(); } + parameterMap.put(SqlNoteConstants.SQL_NOTE_TEMPLATE, HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().getEditingFILE().getPath()); return DataOperator.getInstance().previewMultiResultTableData(tableData, parameterMap, 0); } diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/ESDStrategyConfigPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/ESDStrategyConfigPane.java index f3df21df9c..0106654e8f 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/ESDStrategyConfigPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/ESDStrategyConfigPane.java @@ -6,6 +6,7 @@ import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.ilable.ActionLabel; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.itextfield.UITextField; +import com.fr.design.i18n.LocaleLinkProvider; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.esd.common.CacheConstants; @@ -29,8 +30,8 @@ import java.net.URI; import java.text.ParseException; import java.util.ArrayList; import java.util.Collections; -import java.util.List; import java.util.Date; +import java.util.List; /** * @author rinoux @@ -38,7 +39,18 @@ import java.util.Date; * Created by rinoux on 2020/7/22 */ public class ESDStrategyConfigPane extends BasicBeanPane { - private static final String CRON_HELP_URL = "http://help.fanruan.com/finereport/doc-view-693.html"; + + /** + * 云中心定时调度执行频率表达式设定帮助文档链接在配置文件中对应的配置文件key + */ + private static final String PROPS_LINK_KEY = "Fine-Design-CloudCenter_Cron_Help"; + + /** + * 云中心定时调度执行频率表达式设定帮助文档默认链接在配置文件中对应的配置文件key + */ + private static final String PROPS_LINK_KEY_DEFAULT = "Fine-Design-CloudCenter_Cron_Help_Default"; + + private static final String CRON_HELP_URL = LocaleLinkProvider.getInstance().getLink(PROPS_LINK_KEY, PROPS_LINK_KEY_DEFAULT); private UIRadioButton selectAutoUpdate; private UIRadioButton selectBySchema; private UICheckBox shouldEvolve; diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/common/DesensitizationOpenPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/common/DesensitizationOpenPane.java index 949069aaa8..e04c3fed0e 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/common/DesensitizationOpenPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/common/DesensitizationOpenPane.java @@ -8,10 +8,12 @@ import com.fr.design.gui.ilable.UILabel; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.VerticalFlowLayout; +import com.fr.design.locale.impl.DataMaskMark; +import com.fr.general.locale.LocaleCenter; +import com.fr.general.locale.LocaleMark; import com.fr.log.FineLoggerFactory; import javax.swing.JPanel; -import java.awt.BorderLayout; import java.awt.Desktop; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; @@ -58,7 +60,8 @@ public class DesensitizationOpenPane extends JPanel { @Override public void mouseClicked(MouseEvent event) { try { - URL url = new URL(Toolkit.i18nText("Fine-Design_Report_Desensitization_Help_Document_Url")); + LocaleMark dataMaskMark = LocaleCenter.getMark(DataMaskMark.class); + URL url = new URL(dataMaskMark.getValue()); Desktop.getDesktop().browse(url.toURI()); } catch (Exception e) { FineLoggerFactory.getLogger().error(e, "open browse of table data desensitization help document failed for {}", e.getMessage()); diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/preview/sql/PreviewPerformedSqlPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/preview/sql/PreviewPerformedSqlPane.java index c0239c8fad..c4996d539e 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/preview/sql/PreviewPerformedSqlPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/preview/sql/PreviewPerformedSqlPane.java @@ -11,12 +11,12 @@ import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.dialog.link.MessageWithLink; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ilable.UILabel; +import com.fr.design.i18n.LocaleLinkProvider; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.DesignerContext; import com.fr.design.parameter.ParameterInputPane; import com.fr.design.utils.gui.GUICoreUtils; -import com.fr.general.CloudCenter; import com.fr.general.GeneralContext; import com.fr.log.FineLoggerFactory; import com.fr.plugin.injectable.PluginModule; @@ -63,6 +63,16 @@ public class PreviewPerformedSqlPane extends JDialog implements ActionListener { private UILabel imageLabel; + /** + * 云中心防止sql注入帮助文档链接在配置文件中对应的配置文件key + */ + private static final String PROPS_LINK_KEY = "Fine-Design_Basic_Sql_Injection_Prevention_Help"; + + /** + * 云中心防止sql注入帮助文档默认链接在配置文件中对应的配置文件key + */ + private static final String PROPS_LINK_KEY_DEFAULT = "Fine-Design_Basic_Sql_Injection_Prevention_Help_Default"; + public PreviewPerformedSqlPane(Frame frame, String sql) { this(frame, sql, null, null, false); } @@ -84,7 +94,7 @@ public class PreviewPerformedSqlPane extends JDialog implements ActionListener { JLabel label = new JLabel(Toolkit.i18nText("Fine-Design_Basic_Preview_Performed_Sql_Message") + Toolkit.i18nText("Fine-Design_Basic_Sql_Injection_Prevention") + Toolkit.i18nText("Fine-Design_Basic_Preview_Special_Char_Sql_Back_Message")); messagePanel.add(label); } else { - MessageWithLink message = new MessageWithLink(Toolkit.i18nText("Fine-Design_Basic_Preview_Special_Char_Sql_Front_Message"), Toolkit.i18nText("Fine-Design_Basic_Sql_Injection_Prevention"), CloudCenter.getInstance().acquireConf(Toolkit.i18nText("Fine-Design_Basic_Sql_Injection_Prevention_Help"), "https://help.fanruan.com/finereport/doc-view-2219.html"), Toolkit.i18nText("Fine-Design_Basic_Preview_Special_Char_Sql_Back_Message")); + MessageWithLink message = new MessageWithLink(Toolkit.i18nText("Fine-Design_Basic_Preview_Special_Char_Sql_Front_Message"), Toolkit.i18nText("Fine-Design_Basic_Sql_Injection_Prevention"), LocaleLinkProvider.getInstance().getLink(PROPS_LINK_KEY, PROPS_LINK_KEY_DEFAULT), Toolkit.i18nText("Fine-Design_Basic_Preview_Special_Char_Sql_Back_Message")); messagePanel.add(message); } // 提示图标 diff --git a/designer-base/src/main/java/com/fr/design/extra/exe/callback/handle/PluginCallBackHelper.java b/designer-base/src/main/java/com/fr/design/extra/exe/callback/handle/PluginCallBackHelper.java index fc5f957f63..8fe64dc29a 100644 --- a/designer-base/src/main/java/com/fr/design/extra/exe/callback/handle/PluginCallBackHelper.java +++ b/designer-base/src/main/java/com/fr/design/extra/exe/callback/handle/PluginCallBackHelper.java @@ -2,6 +2,7 @@ package com.fr.design.extra.exe.callback.handle; import com.fr.design.dialog.FineJOptionPane; import com.fr.design.dialog.link.MessageWithLink; +import com.fr.design.i18n.LocaleLinkProvider; import com.fr.design.i18n.Toolkit; import com.fr.plugin.error.PluginErrorCode; import com.fr.plugin.manage.control.PluginTaskResult; @@ -16,7 +17,19 @@ public class PluginCallBackHelper { private static final String REFERENCE = Toolkit.i18nText("Fine-Design_Basic_Plugin_File_Validate_Reference"); private static final String HELP_DOCUMENT_NAME = Toolkit.i18nText("Fine-Design_Basic_Plugin_File_Validate_HELP_DOCUMENT_NAME"); private static final String CONNECTOR = "-"; - private static final String HELP_DOCUMENT_LINK = Toolkit.i18nText("Fine-Design_Basic_Plugin_File_Validate_HELP_DOCUMENT_LINK"); + + /** + * 云中心第三方插件安装失败说明帮助文档在配置文件中对应的配置文件key + */ + private static final String PROPS_LINK_KEY = "Fine-Design_Basic_Plugin_File_Validate_HELP_DOCUMENT_LINK"; + + /** + * 云中心第三方插件安装失败说明帮助文档默认链接在配置文件中对应的配置文件key + */ + private static final String PROPS_LINK_KEY_DEFAULT = "Fine-Design_Basic_Plugin_File_Validate_HELP_DOCUMENT_LINK_Default"; + + + private static final String HELP_DOCUMENT_LINK = LocaleLinkProvider.getInstance().getLink(PROPS_LINK_KEY, PROPS_LINK_KEY_DEFAULT); /** diff --git a/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java b/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java index 86820aa227..f895a4f5b4 100644 --- a/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java +++ b/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java @@ -268,7 +268,8 @@ public class HistoryTemplateListCache implements CallbackEvent { boolean replaceWithJVirtualTemplate = overTemplate.getEditingFILE().exists() && overTemplate.isALLSaved() && overTemplate != editingTemplate - && overTemplate.checkEnable(); + && overTemplate.checkEnable() + && overTemplate.supportCache(); if (replaceWithJVirtualTemplate) { closeVirtualSelectedReport(overTemplate); historyList.set(i, new JVirtualTemplate(overTemplate.getEditingFILE())); @@ -297,7 +298,9 @@ public class HistoryTemplateListCache implements CallbackEvent { int index = iterator.nextIndex(); if (size == index + 1 && index > 0) { //如果删除的是后一个Tab,则定位到前一个 - MultiTemplateTabPane.getInstance().setSelectedIndex(index - 1); + MultiTemplateTabPane.getInstance().setSelectedIndex( + MultiTemplateTabPane.getInstance().calNextShowJTemplateIndex(index - 1)); + } } } diff --git a/designer-base/src/main/java/com/fr/design/file/MultiTemplateTabMenuFactory.java b/designer-base/src/main/java/com/fr/design/file/MultiTemplateTabMenuFactory.java new file mode 100644 index 0000000000..64e28eabf4 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/file/MultiTemplateTabMenuFactory.java @@ -0,0 +1,349 @@ +package com.fr.design.file; + +import com.fr.design.constants.UIConstants; +import com.fr.design.gui.ibutton.UIButton; +import com.fr.design.gui.imenu.UIMenuItem; +import com.fr.design.gui.imenu.UIScrollPopUpMenu; +import com.fr.design.i18n.Toolkit; +import com.fr.design.mainframe.JTemplate; +import com.fr.design.utils.TemplateUtils; +import com.fr.general.IOUtils; +import com.fr.stable.StringUtils; +import com.fr.stable.collections.CollectionUtils; + +import javax.swing.BorderFactory; +import javax.swing.Icon; +import javax.swing.JPanel; +import javax.swing.SwingConstants; +import java.awt.BorderLayout; +import java.awt.Component; +import java.awt.Dimension; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +/** + * 右侧下拉菜单的工厂类 + * @author Carlson + * @since 11.0 + * created on 2023-04-14 + **/ +public class MultiTemplateTabMenuFactory { + + private static final Icon CLOSE = IOUtils.readIcon("/com/fr/design/images/buttonicon/close_icon.png"); + private static final Icon MOUSE_OVER_CLOSE = IOUtils.readIcon("/com/fr/design/images/buttonicon/mouseoverclose icon.png"); + private static final Icon MOUSE_PRESS_CLOSE = IOUtils.readIcon("/com/fr/design/images/buttonicon/pressclose icon.png"); + + private static final int ITEM_SIZE = 25; + + private UIScrollPopUpMenu menu = null; + + private static MultiTemplateTabMenuFactory INSTANCE = new MultiTemplateTabMenuFactory(); + + private MultiTemplateTabMenuFactory() { + + } + + /** + * 返回右侧下拉菜单的工厂类 + * @return + */ + public static MultiTemplateTabMenuFactory getInstance() { + return INSTANCE; + } + + /** + * tab上的下拉菜单 + */ + public UIScrollPopUpMenu createMenu() { + menu = new UIScrollPopUpMenu(); + menu.setBorder(BorderFactory.createEmptyBorder(-3, 3, 3, 0)); + + menu.add(initCloseOther()); + menu.add(createEmptyRow()); + menu.addSeparator(); + menu.add(createEmptyRow()); + menu.add(createCategory(Toolkit.i18nText("Fine-Design_Basic_Tab_Current_Category_Templates"))); + Component[] items = createCurrentCategory(); + for (Component item : items) { + menu.add(item); + } + items = createOtherCategory(); + if (items.length > 0) { + menu.addSeparator(); + menu.add(createEmptyRow()); + menu.add(createCategory(Toolkit.i18nText("Fine-Design_Basic_Tab_Other_Category_Templates"))); + for (Component item : items) { + menu.add(item); + } + } + Dimension dimension = menu.getPreferredSize(); + dimension.width += ITEM_SIZE; + menu.setPreferredSize(dimension); + return menu; + } + + /** + * 关闭其它按钮 + */ + private UIMenuItem initCloseOther() { + UIMenuItem closeOther = new UIMenuItem(Toolkit.i18nText("Fine-Design_Basic_Tab_Close_Other_Templates_Of_Current_Category")); + closeOther.setHorizontalAlignment(SwingConstants.CENTER); + Dimension dimension = closeOther.getPreferredSize(); + dimension.height = ITEM_SIZE; + closeOther.setPreferredSize(dimension); + String currentOperator = getCurrentTabOperatorType(); + closeOther.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + MultiTemplateTabPane.getInstance().closeOtherByOperatorType(currentOperator); + } + }); + if (MultiTemplateTabPane.getInstance().getOpenedJTemplatesByOperator(currentOperator).size() <= 1) { + closeOther.setEnabled(false); + } + return closeOther; + } + + + /** + * 美观用 + */ + private JPanel createEmptyRow() { + return new JPanel() { + @Override + public Dimension getPreferredSize() { + Dimension d = super.getPreferredSize(); + d.height = 1; + return d; + } + }; + } + + /** + * 模板分类item + */ + private UIButton createCategory(String categoryName) { + UIButton button = new UIButton(categoryName); + button.setBorderPainted(false); + button.setExtraPainted(false); + button.setPreferredSize(new Dimension(menu.getWidth(), ITEM_SIZE)); + button.setOpaque(true); + button.setBackground(UIConstants.NORMAL_BACKGROUND); + button.setHorizontalAlignment(SwingConstants.LEFT); + button.setForeground(UIConstants.FLESH_BLUE); + return button; + } + + /** + * 创建 当前分类模板 item数组 + */ + private Component[] createCurrentCategory() { + return createListDownItem(MultiTemplateTabPane.getInstance().getOpenedJTemplatesByOperator(getCurrentTabOperatorType())); + } + + private String getCurrentTabOperatorType(){ + JTemplate jTemplate= HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); + return jTemplate.getTemplateTabOperatorType(); + } + + /** + * 创建 其它分类模板 item数组 + */ + private Component[] createOtherCategory() { + String currentOperator = getCurrentTabOperatorType(); + List> openedTemplates = new ArrayList<>(); + Map>> map = MultiTemplateTabPane.getInstance().getOpenedJTemplatesByCategory(); + for (Map.Entry>> entry : map.entrySet()) { + if (!StringUtils.equals(currentOperator, entry.getKey())) { + openedTemplates.addAll(entry.getValue()); + } + } + return createListDownItem(openedTemplates); + } + + /** + * 根据template列表创建多个item + */ + private Component[] createListDownItem(List> openedTemplates) { + if (!CollectionUtils.isEmpty(openedTemplates)) { + Component[] templates = new Component[openedTemplates.size()]; + for (int i = 0; i < openedTemplates.size(); i++) { + templates[i] = createListDownMenuItem(openedTemplates.get(i)); + } + return templates; + } + return new Component[0]; + } + + /** + * 根据template对象创建item + */ + private Component createListDownMenuItem(JTemplate template) { + JPanel jPanel = new JPanel(); + jPanel.setPreferredSize(new Dimension(menu.getWidth(), ITEM_SIZE)); + jPanel.setLayout(new BorderLayout()); + + MenuItemButtonGroup menuItemButtonGroup = new MenuItemButtonGroup(template); + if (template == HistoryTemplateListCache.getInstance().getCurrentEditingTemplate()) { + menuItemButtonGroup.templateButton.setForeground(UIConstants.FLESH_BLUE); + } + + jPanel.add(menuItemButtonGroup.iconButton, BorderLayout.WEST); + jPanel.add(menuItemButtonGroup.templateButton, BorderLayout.CENTER); + jPanel.add(menuItemButtonGroup.closeButton, BorderLayout.EAST); + + return jPanel; + } + + /** + * menu的item由模板图标、模板名、模板关闭按钮组成 + */ + private class MenuItemButtonGroup { + + private final UIButton iconButton; + private final UIButton templateButton; + private final UIButton closeButton; + + public MenuItemButtonGroup(JTemplate template) { + iconButton = createIconButton(template); + templateButton = createTemplateButton(template); + closeButton = createCloseButton(); + initListener(template); + } + + /** + * item[0] 模板图标按钮初始化 + */ + private UIButton createIconButton(JTemplate template) { + UIButton button = new UIButton(template.getIcon(), template.getIcon(), template.getIcon()); + button.setPreferredSize(new Dimension(ITEM_SIZE, ITEM_SIZE)); + button.setOpaque(true); + button.setBackground(UIConstants.NORMAL_BACKGROUND); + return button; + } + + /** + * item[1] 切换模板按钮初始化 + */ + private UIButton createTemplateButton(JTemplate template) { + UIButton button = new UIButton(TemplateUtils.createLockeTemplatedName(template, template.getTemplateName())); + button.setBorderPainted(false); + button.setExtraPainted(false); + button.setPreferredSize(new Dimension(menu.getWidth() - ITEM_SIZE * 2, ITEM_SIZE)); + button.setOpaque(true); + button.setBackground(UIConstants.NORMAL_BACKGROUND); + button.setHorizontalAlignment(SwingConstants.LEFT); + return button; + } + + /** + * item[2] 关闭模板图标按钮初始化 + */ + private UIButton createCloseButton() { + UIButton button = new UIButton(CLOSE, MOUSE_OVER_CLOSE, MOUSE_PRESS_CLOSE); + button.setPreferredSize(new Dimension(ITEM_SIZE, ITEM_SIZE)); + button.setOpaque(true); + button.setBackground(UIConstants.NORMAL_BACKGROUND); + button.setVisible(false); + return button; + } + + private void initListener(JTemplate template) { + initIconButtonListener(); + initTemplateButtonListener(template); + initCloseButtonListener(template); + } + + /** + * item[0] 模板图标按钮鼠标事件 + */ + private void initIconButtonListener() { + iconButton.addMouseListener(new MouseAdapter() { + @Override + public void mouseEntered(MouseEvent e) { + fireMouseEnteredEvent(); + } + + @Override + public void mouseExited(MouseEvent e) { + fireMouseExitedEvent(); + } + }); + } + + /** + * item[1] 切换模板按钮鼠标事件 + */ + private void initTemplateButtonListener(JTemplate template) { + templateButton.addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent e) { + menu.setVisible(false); + MultiTemplateTabPane.getInstance().switchJTemplate(template); + } + + @Override + public void mouseEntered(MouseEvent e) { + fireMouseEnteredEvent(); + } + + @Override + public void mouseExited(MouseEvent e) { + fireMouseExitedEvent(); + } + }); + } + + /** + * item[2] 关闭模板按钮鼠标事件 + */ + private void initCloseButtonListener(JTemplate template) { + closeButton.addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent e) { + menu.setVisible(false); + MultiTemplateTabPane.getInstance().setIsCloseCurrent(template == HistoryTemplateListCache.getInstance().getCurrentEditingTemplate()); + MultiTemplateTabPane.getInstance().closeFormat(template); + MultiTemplateTabPane.getInstance().closeSpecifiedTemplate(template); + } + + @Override + public void mouseEntered(MouseEvent e) { + fireMouseEnteredEvent(); + } + + @Override + public void mouseExited(MouseEvent e) { + fireMouseExitedEvent(); + } + }); + } + + /** + * mouse移入item范围 + */ + private void fireMouseEnteredEvent() { + iconButton.setBackground(UIConstants.HOVER_BLUE); + templateButton.setBackground(UIConstants.HOVER_BLUE); + closeButton.setBackground(UIConstants.HOVER_BLUE); + closeButton.setVisible(true); + } + + /** + * mouse移出item范围 + */ + private void fireMouseExitedEvent() { + iconButton.setBackground(UIConstants.NORMAL_BACKGROUND); + templateButton.setBackground(UIConstants.NORMAL_BACKGROUND); + closeButton.setBackground(UIConstants.NORMAL_BACKGROUND); + closeButton.setVisible(false); + } + + } + +} diff --git a/designer-base/src/main/java/com/fr/design/file/MultiTemplateTabPane.java b/designer-base/src/main/java/com/fr/design/file/MultiTemplateTabPane.java index 8e302fd977..901a12154e 100644 --- a/designer-base/src/main/java/com/fr/design/file/MultiTemplateTabPane.java +++ b/designer-base/src/main/java/com/fr/design/file/MultiTemplateTabPane.java @@ -1,7 +1,6 @@ package com.fr.design.file; -import com.fr.base.BaseUtils; import com.fr.base.GraphHelper; import com.fr.base.svg.IconUtils; import com.fr.base.vcs.DesignerMode; @@ -19,7 +18,6 @@ import com.fr.design.mainframe.JTemplate; import com.fr.design.mainframe.TemplateSavingChecker; import com.fr.design.mainframe.manager.search.TemplateTreeSearchManager; import com.fr.design.utils.DesignUtils; -import com.fr.design.utils.TemplateUtils; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUIPaintUtils; import com.fr.design.worker.WorkerManager; @@ -42,7 +40,6 @@ import javax.swing.JComponent; import javax.swing.JMenu; import javax.swing.JMenuItem; import javax.swing.JOptionPane; -import javax.swing.JPanel; import javax.swing.JSeparator; import javax.swing.MenuElement; import javax.swing.SwingConstants; @@ -70,6 +67,8 @@ import java.awt.geom.Line2D; import java.awt.geom.Path2D; import java.awt.geom.RoundRectangle2D; import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; import static com.fr.design.dialog.FineJOptionPane.showConfirmDialog; import static javax.swing.JOptionPane.OK_CANCEL_OPTION; @@ -333,8 +332,10 @@ public class MultiTemplateTabPane extends JComponent { JTemplate currentTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); closeTemplate(templates, currentTemplate); - if (option == CloseOption.All) { + if (openedTemplate.size() == 0) { DesignerContext.getDesignerFrame().addAndActivateJTemplate(); + } else if (option == CloseOption.All){ + DesignerContext.getDesignerFrame().activateJTemplate(openedTemplate.get(0)); } else { DesignerContext.getDesignerFrame().activateJTemplate(currentTemplate); } @@ -344,8 +345,9 @@ public class MultiTemplateTabPane extends JComponent { } private void closeTemplate(JTemplate[] templates, JTemplate currentTemplate) { + String operator = currentTemplate.getTemplateTabOperatorType(); for (int i = 0; i < templates.length; i++) { - if (option.shouldClose(tplIndex, i)) { + if (option.shouldClose(tplIndex, i) && ComparatorUtils.equals(operator, templates[i].getTemplateTabOperatorType())) { JTemplate jTemplate = templates[i]; if (jTemplate == currentTemplate) { currentTemplate = option == CloseOption.All ? null : templates[tplIndex]; @@ -378,6 +380,46 @@ public class MultiTemplateTabPane extends JComponent { return openedTemplate.get(selectedIndex); } + /** + * 关闭所有指定模板tab操作类型的模板 + * @param operatorType + */ + public void closeOtherByOperatorType(String operatorType){ + JTemplate currentEditingTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); + SaveSomeTemplatePane saveSomeTempaltePane = new SaveSomeTemplatePane(false); + if (saveSomeTempaltePane.showSavePane()) { + List> openedTemplate = HistoryTemplateListCache.getInstance().getHistoryList(); + + JTemplate[] templates = new JTemplate[openedTemplate.size()]; + for (int i = 0; i < openedTemplate.size(); i++) { + templates[i] = openedTemplate.get(i); + } + closeTemplate(templates, currentEditingTemplate, operatorType); + + DesignerContext.getDesignerFrame().activateJTemplate(currentEditingTemplate); + MultiTemplateTabPane.getInstance().repaint(); + } + } + + /** + * 关闭指定的非当前编辑模板 + * @param templates + * @param operatorType + */ + private static void closeTemplate(JTemplate[] templates, JTemplate currentEditingTemplate, String operatorType) { + for (int i = 0; i < templates.length; i++) { + JTemplate jTemplate = templates[i]; + boolean needClose = ComparatorUtils.equals(operatorType, jTemplate.getTemplateTabOperatorType()) + && jTemplate != currentEditingTemplate; + if (!needClose) { + continue; + } + MultiTemplateTabPane.getInstance().closeFormat(jTemplate); + HistoryTemplateListCache.getInstance().closeSelectedReport(jTemplate); + MultiTemplateTabPane.getInstance().closeAndFreeLock(jTemplate); + } + } + /** * 关闭掉当前已打开文件列表中指定的文件 @@ -478,11 +520,7 @@ public class MultiTemplateTabPane extends JComponent { private String tempalteShowName(JTemplate template) { - String name = TemplateUtils.createLockeTemplatedName(template, template.getTemplateName()); - if (!template.isSaved() && !name.endsWith(" *")) { - name += " *"; - } - return name; + return template.getTabShowName(template); } /** @@ -500,40 +538,7 @@ public class MultiTemplateTabPane extends JComponent { private void showListDown() { - - UIScrollPopUpMenu menu = new UIScrollPopUpMenu(); - menu.setBorder(BorderFactory.createEmptyBorder(-3, 3, 3, 0)); - menu.add(initCloseOther()); - JSeparator separator = new JSeparator() { - @Override - public Dimension getPreferredSize() { - Dimension d = super.getPreferredSize(); - d.height = 1; - return d; - } - }; - menu.add(new JPanel() { - @Override - public Dimension getPreferredSize() { - Dimension d = super.getPreferredSize(); - d.height = 1; - return d; - } - }); - separator.setForeground(UIConstants.LINE_COLOR); - menu.add(separator); - menu.add(new JPanel() { - @Override - public Dimension getPreferredSize() { - Dimension d = super.getPreferredSize(); - d.height = 1; - return d; - } - }); - UIMenuItem[] items = createListDownTemplate(); - for (int i = 0; i < items.length; i++) { - menu.add(items[i]); - } + UIScrollPopUpMenu menu = MultiTemplateTabMenuFactory.getInstance().createMenu(); GUICoreUtils.showPopupMenu(menu, MultiTemplateTabPane.getInstance(), MultiTemplateTabPane.getInstance().getWidth() - menu.getPreferredSize().width, getY() - 1 + getHeight()); } @@ -583,6 +588,9 @@ public class MultiTemplateTabPane extends JComponent { //从可以开始展示在tab面板上的tab开始画 for (int i = minPaintIndex; i <= maxPaintIndex; i++) { JTemplate template = openedTemplate.get(i); + if (!showJTemplateTab(template)){ + continue; + } Icon icon = template.getIcon(); String name = tempalteShowName(template); //如果tab名字的长度大于最大能显示的英文字符长度,则进行省略号处理 @@ -722,8 +730,10 @@ public class MultiTemplateTabPane extends JComponent { //个数小于最多能容纳的个数的情况下,看看宽度每个要画多少 private void calculateRealAverageWidth(double maxwidth, int templateNum) { + JTemplate jTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); + List> showTemplates = getOpenedJTemplatesByOperator(jTemplate.getTemplateTabOperatorType()); - int num = openedTemplate.size() > templateNum ? templateNum : openedTemplate.size(); + int num = Math.min(showTemplates.size(), templateNum); realWidth = (int) (maxwidth / (num)); if (realWidth > MAXWIDTH) { realWidth = MAXWIDTH; @@ -932,7 +942,7 @@ public class MultiTemplateTabPane extends JComponent { activePrevTemplateAfterClose(); } - private void closeAndFreeLock(@Nonnull JTemplate template) { + public void closeAndFreeLock(@Nonnull JTemplate template) { FILE file = template.getEditingFILE(); // 只有是环境内的文件,才执行释放锁 if (file != null && file.isEnvFile()) { @@ -988,7 +998,7 @@ public class MultiTemplateTabPane extends JComponent { // 如果当前关闭的模板在最右侧,那么预览上一个,防止数组越界 if (selectedIndex >= maxPaintIndex) { // selectIndex 不会 <0 因为如果关闭的是打开的最后一个模板,那么关闭之后 openedTemplate.isEmpty() = true - selectedIndex--; + selectedIndex = calNextShowJTemplateIndex(selectedIndex - 1); } isCloseCurrent = false; } @@ -1005,6 +1015,26 @@ public class MultiTemplateTabPane extends JComponent { } } + /** + * 计算下一个可以展示的模板index + * @param currentIndex + * @return + */ + public int calNextShowJTemplateIndex(int currentIndex) { + //先看是否有可以展示的模板 + for (int i = currentIndex; i >= 0; i--) { + if (showJTemplateTab(openedTemplate.get(i))) { + return i; + } + } + for (int i = currentIndex; i >= 0; i--) { + if (!showJTemplateTab(openedTemplate.get(i))) { + return i; + } + } + return -1; + } + private boolean isOverCloseIcon(int evtX) { boolean isOverCloseIcon = false; @@ -1027,7 +1057,7 @@ public class MultiTemplateTabPane extends JComponent { private int getTemplateIndex(int evtX) { int textX = 0; for (int i = minPaintIndex; i <= maxPaintIndex; i++) { - int textWidth = realWidth; + int textWidth = showJTemplateTab(openedTemplate.get(i)) ? realWidth : 0; if (evtX >= textX && evtX < textX + textWidth) { return i; } @@ -1184,29 +1214,44 @@ public class MultiTemplateTabPane extends JComponent { //没有点击关闭和ListDown按钮,则切换到点击的模板处 closeIconIndex = -1; clodeMode = CLOSE; - int tempSelectedIndex = selectedIndex; - if (selectedIndex != getTemplateIndex(evtX) && getTemplateIndex(evtX) != -1) { - openedTemplate.get(selectedIndex).stopEditing(); - selectedIndex = getTemplateIndex(evtX); - //如果在权限编辑情况下,不允许切换到表单类型的工作簿 - if (DesignerMode.isAuthorityEditing() && !openedTemplate.get(selectedIndex).isJWorkBook()) { - DesignerContext.getDesignerFrame().addAndActivateJTemplate(openedTemplate.get(tempSelectedIndex)); - FineJOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Toolkit.i18nText("Fine-Design_Basic_Form_Authority_Edited_Cannot_Be_Supported") - + "!", Toolkit.i18nText("Fine-Design_Basic_Alert"), JOptionPane.WARNING_MESSAGE); - MultiTemplateTabPane.this.repaint(); - return; - } - JTemplate evtXTemplate = openedTemplate.get(getTemplateIndex(evtX)); - evtXTemplate.activeNewJTemplate(); - } + switchJTemplate(getTemplateIndex(evtX)); isShowList = false; } MultiTemplateTabPane.this.repaint(); - - } + } + /** + * 切换到指定模板 + * @param jTemplate + */ + public void switchJTemplate(JTemplate jTemplate) { + int switchIndex = this.openedTemplate.indexOf(jTemplate); + if (switchIndex >= 0) { + switchJTemplate(switchIndex); + } + } + /** + * 切换到指定index + * @param switchIndex + */ + private void switchJTemplate(int switchIndex){ + int tempSelectedIndex = selectedIndex; + if (selectedIndex != switchIndex && switchIndex != -1) { + openedTemplate.get(selectedIndex).stopEditing(); + selectedIndex = switchIndex; + //如果在权限编辑情况下,不允许切换到表单类型的工作簿 + if (DesignerMode.isAuthorityEditing() && !openedTemplate.get(selectedIndex).isJWorkBook()) { + DesignerContext.getDesignerFrame().addAndActivateJTemplate(openedTemplate.get(tempSelectedIndex)); + FineJOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Toolkit.i18nText("Fine-Design_Basic_Form_Authority_Edited_Cannot_Be_Supported") + + "!", Toolkit.i18nText("Fine-Design_Basic_Alert"), JOptionPane.WARNING_MESSAGE); + MultiTemplateTabPane.this.repaint(); + return; + } + JTemplate evtXTemplate = openedTemplate.get(switchIndex); + evtXTemplate.activeNewJTemplate(); + } } private boolean checkCurrentClose(JTemplate template) { @@ -1251,5 +1296,34 @@ public class MultiTemplateTabPane extends JComponent { } } + /** + * 判断是否显示在tab栏上 + * @param jTemplate + * @return + */ + private boolean showJTemplateTab(JTemplate jTemplate){ + JTemplate current = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); + return ComparatorUtils.equals(current.getTemplateTabOperatorType(), jTemplate.getTemplateTabOperatorType()); + } + + /** + * 获取tab操作类型的模板 + * @param operator + * @return + */ + public List> getOpenedJTemplatesByOperator(String operator) { + return openedTemplate.stream().filter((jTemplate) -> ComparatorUtils.equals(jTemplate.getTemplateTabOperatorType(), operator)) + .collect(Collectors.toList()); + } + + /** + * 根据tab操作类型进行分类 + * @return + */ + public Map>> getOpenedJTemplatesByCategory() { + return openedTemplate.stream() + .collect(Collectors.groupingBy(JTemplate::getTemplateTabOperatorType)); + } + } diff --git a/designer-base/src/main/java/com/fr/design/file/NewTemplatePane.java b/designer-base/src/main/java/com/fr/design/file/NewTemplatePane.java index dae921a1c8..81f82e78c6 100644 --- a/designer-base/src/main/java/com/fr/design/file/NewTemplatePane.java +++ b/designer-base/src/main/java/com/fr/design/file/NewTemplatePane.java @@ -81,11 +81,19 @@ public abstract class NewTemplatePane extends JComponent implements MouseListene } if (isOverNewIcon(evtX) && newWorkBookIconMode != GRAY_NEW_CPT) { newWorkBookIconMode = getMousePressNew(); - DesignerContext.getDesignerFrame().addAndActivateJTemplate(); + createNewTemplate(); } this.repaint(); } + + /** + * 新建模板 + */ + protected void createNewTemplate() { + DesignerContext.getDesignerFrame().addAndActivateJTemplate(); + } + /** *鼠标松开 * @param e 事件 diff --git a/designer-base/src/main/java/com/fr/design/file/SaveSomeTemplatePane.java b/designer-base/src/main/java/com/fr/design/file/SaveSomeTemplatePane.java index 72945b31c9..fa8e3d385d 100644 --- a/designer-base/src/main/java/com/fr/design/file/SaveSomeTemplatePane.java +++ b/designer-base/src/main/java/com/fr/design/file/SaveSomeTemplatePane.java @@ -47,6 +47,7 @@ public class SaveSomeTemplatePane extends BasicPane { /** * 支持自定义设置 dialog的父窗口 + * * @param isNeedTojudgeCurrent * @param parent */ @@ -79,11 +80,14 @@ public class SaveSomeTemplatePane extends BasicPane { this.isJudgeCurrentEditingTemplate = isNeedTojudgeCurrent; } - private void initTemplatesChoosePane() { + + private void initTemplatesChoosePane(boolean judgeJTemplateMustSave) { templatesChoosePane.setBorder(BorderFactory.createTitledBorder("")); for (int i = 0; i < unSavedTemplate.size(); i++) { templateCheckBoxes[i] = new UICheckBox(unSavedTemplate.get(i).getEditingFILE().getName()); templateCheckBoxes[i].setSelected(true); + boolean needSave = judgeJTemplateMustSave && unSavedTemplate.get(i).needSaveBeforeSwitchEnv(); + templateCheckBoxes[i].setEnabled(!needSave); } final UIList templatesList = new UIList(templateCheckBoxes); @@ -103,7 +107,10 @@ public class SaveSomeTemplatePane extends BasicPane { boolean isSelected = chooseAllCheckBox.isSelected(); for (int i = 0; i < templatesList.getModel().getSize(); i++) { UICheckBox checkBox = (UICheckBox) templatesList.getModel().getElementAt(i); - checkBox.setSelected(isSelected); + boolean mustSaveBeforeSwitchEnv = judgeJTemplateMustSave && unSavedTemplate.get(i).needSaveBeforeSwitchEnv(); + checkBox.setSelected(mustSaveBeforeSwitchEnv || isSelected); + templateCheckBoxes[i].setEnabled(!mustSaveBeforeSwitchEnv); + } templatesList.repaint(); } @@ -139,7 +146,7 @@ public class SaveSomeTemplatePane extends BasicPane { /** * 获取templateCheckBoxes中状态为选中状态的CheckBox数量 - * */ + */ private int calculateSelectedNum() { int count = 0; for (UICheckBox checkBox : templateCheckBoxes) { @@ -152,7 +159,11 @@ public class SaveSomeTemplatePane extends BasicPane { public boolean showSavePane() { - populate(); + return showSavePane(false); + } + + public boolean showSavePane(boolean judgeJTemplateMustSave) { + populate(judgeJTemplateMustSave); //如果有未保存的文件 ,则跳出保存对话框,选择要存储的项目 if (!unSavedTemplate.isEmpty()) { dialog.setVisible(true); @@ -162,8 +173,12 @@ public class SaveSomeTemplatePane extends BasicPane { return isAllSaved; } - public void populate() { - java.util.List> opendedTemplate = HistoryTemplateListPane.getInstance().getHistoryList(); + protected java.util.List> getOpenedTemplatesToProcess(){ + return HistoryTemplateListPane.getInstance().getHistoryList(); + } + + public void populate(boolean judgeJTemplateMustSave) { + java.util.List> opendedTemplate = getOpenedTemplatesToProcess(); JTemplate currentTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); for (int i = 0; i < opendedTemplate.size(); i++) { if (isneedToAdd(opendedTemplate.get(i), currentTemplate)) { @@ -171,10 +186,10 @@ public class SaveSomeTemplatePane extends BasicPane { } } templateCheckBoxes = new UICheckBox[unSavedTemplate.size()]; - initTemplatesChoosePane(); + initTemplatesChoosePane(judgeJTemplateMustSave); } - private boolean isneedToAdd(JTemplate template, JTemplate currentTemplate) { + protected boolean isneedToAdd(JTemplate template, JTemplate currentTemplate) { //所有模板都判断是不是保存 if (isJudgeCurrentEditingTemplate) { return !template.isALLSaved(); @@ -194,7 +209,7 @@ public class SaveSomeTemplatePane extends BasicPane { specifiedTemplate.stopEditing(); return specifiedTemplate.saveTemplate(); } - FineLoggerFactory.getLogger().info( com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Template_Already_Saved", specifiedTemplate.getEditingFILE().getName())); + FineLoggerFactory.getLogger().info(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Template_Already_Saved", specifiedTemplate.getEditingFILE().getName())); return true; } diff --git a/designer-base/src/main/java/com/fr/design/gui/controlpane/JListControlPane.java b/designer-base/src/main/java/com/fr/design/gui/controlpane/JListControlPane.java index 37134ec995..93cdc4e4e2 100644 --- a/designer-base/src/main/java/com/fr/design/gui/controlpane/JListControlPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/controlpane/JListControlPane.java @@ -376,16 +376,16 @@ public abstract class JListControlPane extends JControlPane implements ListContr Nameable nameable = element.wrapper; this.textLabel.setText(nameable.getName()); boolean iconSet = false; + if(isSelected) { + this.textLabel.setBackground(selectedBgColor); + this.textLabel.setForeground(Color.WHITE); + } else { + this.textLabel.setBackground(Color.WHITE); + this.textLabel.setForeground(Color.BLACK); + } for (NameableCreator creator : JListControlPane.this.creators()) { if (creator.menuIcon() != null && creator.acceptObject2Populate(nameable) != null) { this.iconLabel.setIcon(creator.menuIcon()); - if(isSelected) { - this.textLabel.setBackground(selectedBgColor); - this.textLabel.setForeground(Color.WHITE); - } else { - this.textLabel.setBackground(Color.WHITE); - this.textLabel.setForeground(Color.BLACK); - } this.setToolTipText(creator.createTooltip()); iconSet = true; break; diff --git a/designer-base/src/main/java/com/fr/design/gui/style/TranslucentBorderSpecialPane.java b/designer-base/src/main/java/com/fr/design/gui/style/TranslucentBorderSpecialPane.java index cc49820de5..0fb3706afb 100644 --- a/designer-base/src/main/java/com/fr/design/gui/style/TranslucentBorderSpecialPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/style/TranslucentBorderSpecialPane.java @@ -16,6 +16,7 @@ import com.fr.design.gui.frpane.UIPercentDragPane; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.icombobox.LineComboBox; import com.fr.design.gui.ilable.UILabel; +import com.fr.design.i18n.LocaleLinkProvider; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; @@ -26,8 +27,8 @@ import com.fr.design.style.color.NewColorSelectBox; import com.fr.env.utils.DesignerInteractionHistory; import com.fr.general.Background; import com.fr.general.IOUtils; -import com.fr.i18n.UrlI18nManager; import com.fr.general.act.BorderPacker; +import com.fr.i18n.UrlI18nManager; import com.fr.stable.Constants; import com.fr.stable.GraphDrawHelper; import com.fr.stable.ProjectLibrary; @@ -78,7 +79,18 @@ import java.util.Arrays; public class TranslucentBorderSpecialPane extends AbstractBorderPackerPane implements UIObserver { private final int SETTING_LABEL_WIDTH = 60; private final Style DEFAULT_IMAGE_LAYOUT_STYLE = Style.DEFAULT_STYLE.deriveImageLayout(Constants.IMAGE_DEFAULT); - private final String TWEAK_NINE_POINT_HELP_URL = "https://help.fanruan.com/finereport/doc-view-4135.html"; + + /** + * 云中心点九图帮助文档在配置文件中对应的配置文件key + */ + private static final String PROPS_LINK_KEY = "Fine-Design-CloudCenter_Nine_Patch"; + + /** + * 云中心点九图帮助文档默认链接在配置文件中对应的配置文件key + */ + private static final String PROPS_LINK_KEY_DEFAULT = "Fine-Design-CloudCenter_Nine_Patch_Default"; + + private final String TWEAK_NINE_POINT_HELP_URL = LocaleLinkProvider.getInstance().getLink(PROPS_LINK_KEY, PROPS_LINK_KEY_DEFAULT); private UIObserverListener uiObserverListener; diff --git a/designer-base/src/main/java/com/fr/design/i18n/LocaleLinkProvider.java b/designer-base/src/main/java/com/fr/design/i18n/LocaleLinkProvider.java new file mode 100644 index 0000000000..4a819069a7 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/i18n/LocaleLinkProvider.java @@ -0,0 +1,47 @@ +package com.fr.design.i18n; + +import com.fr.general.CloudCenter; +import com.fr.stable.StringUtils; + +/** + * 国际化链接获取工具 + * 根据配置文件key获取云中心key对应的链接或者默认链接 + * + * @author obo + * @since 11.0 + * Created on 2023/4/7 + */ +public final class LocaleLinkProvider { + + private LocaleLinkProvider(){}; + + /** + * 单一实例 + */ + private static final LocaleLinkProvider INSTANCE = new LocaleLinkProvider(); + + /** + * 返回LocaleLinkProvider的单一实例 + * + * @return LocaleLinkProvider单一实例 + */ + public static LocaleLinkProvider getInstance(){ + return INSTANCE; + } + + /** + * 根据配置文件项中的key获取链接 + * + * @param propsKey 配置项key + * @param defaultKey 默认链接项key + * @return 对应的生成器 + */ + public String getLink(String propsKey, String defaultKey) { + String cloudKey = DesignI18nImpl.getInstance().i18nText(propsKey); + String url = CloudCenter.getInstance().acquireUrlByKind(cloudKey); + if(StringUtils.isEmpty(url)) { + return DesignI18nImpl.getInstance().i18nText(defaultKey); + } + return url; + } +} diff --git a/designer-base/src/main/java/com/fr/design/javascript/JSContentWithDescriptionPane.java b/designer-base/src/main/java/com/fr/design/javascript/JSContentWithDescriptionPane.java index e2a8dd0d5c..74b1596207 100644 --- a/designer-base/src/main/java/com/fr/design/javascript/JSContentWithDescriptionPane.java +++ b/designer-base/src/main/java/com/fr/design/javascript/JSContentWithDescriptionPane.java @@ -14,11 +14,11 @@ import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.itextarea.UITextArea; import com.fr.design.gui.itextfield.PlaceholderTextField; +import com.fr.design.i18n.LocaleLinkProvider; import com.fr.design.i18n.Toolkit; import com.fr.design.javascript.jsapi.JSAPITreeHelper; import com.fr.design.javascript.jsapi.JSAPIUserObject; import com.fr.design.layout.FRGUIPaneFactory; -import com.fr.general.CloudCenter; import com.fr.general.ComparatorUtils; import com.fr.general.http.HttpToolbox; import com.fr.json.JSONArray; @@ -26,6 +26,26 @@ import com.fr.json.JSONException; import com.fr.json.JSONObject; import com.fr.log.FineLoggerFactory; import com.fr.stable.StringUtils; + +import javax.swing.BorderFactory; +import javax.swing.DefaultListCellRenderer; +import javax.swing.DefaultListModel; +import javax.swing.JComponent; +import javax.swing.JList; +import javax.swing.JPanel; +import javax.swing.JPopupMenu; +import javax.swing.JScrollPane; +import javax.swing.JTree; +import javax.swing.SwingWorker; +import javax.swing.event.ListSelectionEvent; +import javax.swing.event.ListSelectionListener; +import javax.swing.event.TreeSelectionEvent; +import javax.swing.event.TreeSelectionListener; +import javax.swing.tree.DefaultMutableTreeNode; +import javax.swing.tree.DefaultTreeCellRenderer; +import javax.swing.tree.DefaultTreeModel; +import javax.swing.tree.TreeNode; +import javax.swing.tree.TreePath; import java.awt.BorderLayout; import java.awt.CardLayout; import java.awt.Color; @@ -51,25 +71,6 @@ import java.util.Collections; import java.util.Comparator; import java.util.List; import java.util.concurrent.ExecutionException; -import javax.swing.BorderFactory; -import javax.swing.DefaultListCellRenderer; -import javax.swing.DefaultListModel; -import javax.swing.JComponent; -import javax.swing.JList; -import javax.swing.JPanel; -import javax.swing.JPopupMenu; -import javax.swing.JScrollPane; -import javax.swing.JTree; -import javax.swing.SwingWorker; -import javax.swing.event.ListSelectionEvent; -import javax.swing.event.ListSelectionListener; -import javax.swing.event.TreeSelectionEvent; -import javax.swing.event.TreeSelectionListener; -import javax.swing.tree.DefaultMutableTreeNode; -import javax.swing.tree.DefaultTreeCellRenderer; -import javax.swing.tree.DefaultTreeModel; -import javax.swing.tree.TreeNode; -import javax.swing.tree.TreePath; public class JSContentWithDescriptionPane extends JSContentPane implements KeyListener { @@ -119,6 +120,15 @@ public class JSContentWithDescriptionPane extends JSContentPane implements KeyLi private static final String RELOAD_CARD = "reloadCard"; private static final String DOC_LIST_CARD = "docListCard"; + /** + * 云中心Js高级编辑器帮助链接前缀在配置文件中对应的配置文件key + */ + private static final String PROPS_LINK_KEY = "Fine-Design-CloudCenter_Js_Editor"; + + /** + * 云中心Js高级编辑器帮助链接前缀在配置文件中对应的配置文件key + */ + private static final String PROPS_LINK_KEY_DEFAULT = "Fine-Design-CloudCenter_Js_Editor_Default"; public JSContentWithDescriptionPane(String[] args) { this.setLayout(new BorderLayout()); //=============================== @@ -381,7 +391,7 @@ public class JSContentWithDescriptionPane extends JSContentPane implements KeyLi } private void updateHelpDocuments(Object value, List helpDocuments) { - String url = CloudCenter.getInstance().acquireUrlByKind("af.doc_search", DOCUMENT_SEARCH_URL) + value.toString(); + String url = LocaleLinkProvider.getInstance().getLink(PROPS_LINK_KEY, PROPS_LINK_KEY_DEFAULT) + value.toString(); try { String result = HttpToolbox.get(url); JSONObject jsonObject = new JSONObject(result); 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 index afe1c8eef3..dfa425a3c0 100644 --- 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 @@ -1,13 +1,8 @@ package com.fr.design.locale.impl; -import com.fr.general.CloudCenter; -import com.fr.general.GeneralContext; +import com.fr.design.i18n.LocaleLinkProvider; import com.fr.general.locale.LocaleMark; -import java.util.HashMap; -import java.util.Locale; -import java.util.Map; - /** * @author hades * @version 10.0 @@ -15,24 +10,19 @@ import java.util.Map; */ public class BbsRegisterMark implements LocaleMark { - private final Map map = new HashMap<>(); - private static final String BBS_REGISTER_CN = CloudCenter.getInstance().acquireUrlByKind("bbs.register", "https://id.fanruan.com/register/register.php?clueSource=activityfr"); - private static final String BBS_REGISTER_TW = CloudCenter.getInstance().acquireUrlByKind("bbs.register", "https://id.fanruan.com/register/register.php?clueSource=activityfr"); - private static final String BBS_REGISTER_EN = CloudCenter.getInstance().acquireUrlByKind("bbs.register.en_US", "https://id.fanruan.com/en/register/register.php"); - private static final String BBS_REGISTER_KR = CloudCenter.getInstance().acquireUrlByKind("bbs.register.en_US", "https://id.fanruan.com/en/register/register.php"); - private static final String BBS_REGISTER_JP = CloudCenter.getInstance().acquireUrlByKind("bbs.register.en_US", "https://id.fanruan.com/en/register/register.php"); + /** + * 云中心新账户中心链接在配置文件中对应的配置文件key + */ + private static final String PROPS_LINK_KEY = "Fine-Design-CloudCenter_New_Account_Center"; - 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); - } + /** + * 云中心新账户中心链接在配置文件中对应的配置文件key + */ + private static final String PROPS_LINK_KEY_DEFAULT = "Fine-Design-CloudCenter_New_Account_Center_Default"; + public BbsRegisterMark() {} @Override public String getValue() { - String result = map.get(GeneralContext.getLocale()); - return result == null ? BBS_REGISTER_EN : result; + return LocaleLinkProvider.getInstance().getLink(PROPS_LINK_KEY, PROPS_LINK_KEY_DEFAULT); } } 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 index 27db28e416..49092d4f25 100644 --- 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 @@ -1,13 +1,8 @@ package com.fr.design.locale.impl; -import com.fr.general.CloudCenter; -import com.fr.general.GeneralContext; +import com.fr.design.i18n.LocaleLinkProvider; import com.fr.general.locale.LocaleMark; -import java.util.HashMap; -import java.util.Locale; -import java.util.Map; - /** * @author hades * @version 10.0 @@ -15,24 +10,21 @@ import java.util.Map; */ public class BbsResetMark implements LocaleMark { - private final Map map = new HashMap<>(); - private static final String BBS_RESET_CN = CloudCenter.getInstance().acquireUrlByKind("bbs.reset", "https://id.fanruan.com/forget/forget.php?clue=activityfr"); - private static final String BBS_RESET_TW = CloudCenter.getInstance().acquireUrlByKind("bbs.reset", "https://id.fanruan.com/forget/forget.php?clue=activityfr"); - private static final String BBS_RESET_EN = CloudCenter.getInstance().acquireUrlByKind("bbs.reset.en_US", "https://id.fanruan.com/en/forget/forget.php"); - private static final String BBS_RESET_KR = CloudCenter.getInstance().acquireUrlByKind("bbs.reset.en_US", "https://id.fanruan.com/en/forget/forget.php"); - private static final String BBS_RESET_JP = CloudCenter.getInstance().acquireUrlByKind("bbs.reset.en_US", "https://id.fanruan.com/en/forget/forget.php"); - 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); - } + /** + * 云中心老账户中心链接在配置文件中对应的配置文件key + */ + private static final String PROPS_LINK_KEY = "Fine-Design-CloudCenter_Account_Center"; + + /** + * 云中心老账户中心链接在配置文件中对应的配置文件key + */ + private static final String PROPS_LINK_KEY_DEFAULT = "Fine-Design-CloudCenter_Account_Center_Default"; + + public BbsResetMark() {} @Override public String getValue() { - String result = map.get(GeneralContext.getLocale()); - return result == null ? BBS_RESET_EN : result; + return LocaleLinkProvider.getInstance().getLink(PROPS_LINK_KEY, PROPS_LINK_KEY_DEFAULT); } } 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 index 999c732845..a0b21d271a 100644 --- 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 @@ -1,13 +1,8 @@ package com.fr.design.locale.impl; -import com.fr.general.CloudCenter; -import com.fr.general.GeneralContext; +import com.fr.design.i18n.LocaleLinkProvider; import com.fr.general.locale.LocaleMark; -import java.util.HashMap; -import java.util.Locale; -import java.util.Map; - /** * @author hades * @version 10.0 @@ -15,25 +10,20 @@ import java.util.Map; */ public class BbsSpaceMark implements LocaleMark { - private final Map map = new HashMap<>(); - private static final String BBS_SPACE_CN = CloudCenter.getInstance().acquireUrlByKind("bbs.default", "http://bbs.fanruan.com/home.php?mod=space&do=pm"); - private static final String BBS_SPACE_TW = CloudCenter.getInstance().acquireUrlByKind("bbs.default", "http://bbs.fanruan.com/home.php?mod=space&do=pm"); - private static final String BBS_SPACE_EN = CloudCenter.getInstance().acquireUrlByKind("bbs.default.en_US", "https://community.finereport.com/home.php?mod=space&do=pm"); - private static final String BBS_SPACE_KR = CloudCenter.getInstance().acquireUrlByKind("bbs.default.en_US", "https://community.finereport.com/home.php?mod=space&do=pm"); - private static final String BBS_SPACE_JP = CloudCenter.getInstance().acquireUrlByKind("bbs.default.en_US", "https://community.finereport.com/home.php?mod=space&do=pm"); + /** + * 云中心帆软社区消息中心链接在配置文件中对应的配置文件key + */ + private static final String PROPS_LINK_KEY = "Fine-Design-CloudCenter_Message_Center"; - 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); - } + /** + * 云中心帆软社区消息中心链接在配置文件中对应的配置文件key + */ + private static final String PROPS_LINK_KEY_DEFAULT = "Fine-Design-CloudCenter_Message_Center_Default"; + + public BbsSpaceMark() {} @Override public String getValue() { - String result = map.get(GeneralContext.getLocale()); - return result == null ? BBS_SPACE_EN : result; + return LocaleLinkProvider.getInstance().getLink(PROPS_LINK_KEY, PROPS_LINK_KEY_DEFAULT); } - } diff --git a/designer-base/src/main/java/com/fr/design/locale/impl/DataMaskMark.java b/designer-base/src/main/java/com/fr/design/locale/impl/DataMaskMark.java new file mode 100644 index 0000000000..11312657b9 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/locale/impl/DataMaskMark.java @@ -0,0 +1,30 @@ +package com.fr.design.locale.impl; + +import com.fr.design.i18n.LocaleLinkProvider; +import com.fr.general.locale.LocaleMark; + + +/** + * 根据图片信息生成获取国际化服务器图标工具 + * + * @author obo + * @since 11.0 + * Created on 2023/4/19 + */ +public class DataMaskMark implements LocaleMark { + + /** + * 云中心数据脱敏帮助链接链接在配置文件中对应的配置文件key + */ + private static final String PROPS_LINK_KEY = "Fine-Design-CloudCenter_Data_Mask"; + + /** + * 云中心数据脱敏默认帮助链接在配置文件中对应的配置文件key + */ + private static final String PROPS_LINK_KEY_DEFAULT = "Fine-Design_Report_Desensitization_Help_Document_Url"; + + @Override + public String getValue() { + return LocaleLinkProvider.getInstance().getLink(PROPS_LINK_KEY, PROPS_LINK_KEY_DEFAULT); + } +} diff --git a/designer-base/src/main/java/com/fr/design/locale/impl/LineEngineMark.java b/designer-base/src/main/java/com/fr/design/locale/impl/LineEngineMark.java new file mode 100644 index 0000000000..ebb5fd09a3 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/locale/impl/LineEngineMark.java @@ -0,0 +1,28 @@ +package com.fr.design.locale.impl; + +import com.fr.design.i18n.LocaleLinkProvider; +import com.fr.general.locale.LocaleMark; + +/** + * 根据国际化获取启用行式引擎执行层式报表帮助文档链接 + * + * @author obo + * @since 11.0 + * Created on 2023/4/19 + */ +public class LineEngineMark implements LocaleMark { + + /** + * 云中心启用行式引擎执行层式报表帮助链接链接在配置文件中对应的配置文件key + */ + private static final String PROPS_LINK_KEY = "Fine-Design-CloudCenter_Line_Engine"; + + /** + * 云中心启用行式引擎执行层式报表默认帮助链接在配置文件中对应的配置文件key + */ + private static final String PROPS_LINK_KEY_DEFAULT = "Fine-Design-CloudCenter_Line_Engine_Default"; + @Override + public String getValue() { + return LocaleLinkProvider.getInstance().getLink(PROPS_LINK_KEY, PROPS_LINK_KEY_DEFAULT); + } +} diff --git a/designer-base/src/main/java/com/fr/design/login/DesignerLoginBridge.java b/designer-base/src/main/java/com/fr/design/login/DesignerLoginBridge.java index 4d0ba8a41c..4789cc4f9b 100644 --- a/designer-base/src/main/java/com/fr/design/login/DesignerLoginBridge.java +++ b/designer-base/src/main/java/com/fr/design/login/DesignerLoginBridge.java @@ -5,6 +5,7 @@ import com.fr.design.bridge.exec.JSCallback; import com.fr.design.dialog.FineJOptionPane; import com.fr.design.gui.ilable.ActionLabel; import com.fr.design.gui.ilable.UILabel; +import com.fr.design.i18n.LocaleLinkProvider; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.locale.impl.BbsResetMark; @@ -23,15 +24,16 @@ import com.fr.log.FineLoggerFactory; import com.teamdev.jxbrowser.chromium.Browser; import com.teamdev.jxbrowser.chromium.JSFunction; import com.teamdev.jxbrowser.chromium.JSObject; + +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.SwingUtilities; import java.awt.Desktop; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.net.URI; import java.util.Map; import java.util.Set; -import javax.swing.JOptionPane; -import javax.swing.JPanel; -import javax.swing.SwingUtilities; /** * @author Lanlan @@ -40,6 +42,16 @@ import javax.swing.SwingUtilities; */ public class DesignerLoginBridge { + /** + * 云中心组件商城模板在配置文件中对应的配置文件key + */ + private static final String PROPS_LINK_KEY = "Fine-Design-CloudCenter_Market_Template"; + + /** + * 云中心组件商城模板默认链接在配置文件中对应的配置文件key + */ + private static final String PROPS_LINK_KEY_DEFAULT = "Fine-Design-CloudCenter_Market_Template_Default"; + private Map params; public static DesignerLoginBridge getBridge(Browser browser, Map params) { @@ -71,7 +83,7 @@ public class DesignerLoginBridge { getHyperlinkPane( com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_Guide_Login_Success_Title"), com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_Guide_Login_Success_Hyperlink_Text"), - CloudCenter.getInstance().acquireUrlByKind("designer.premium.template", "https://market.fanruan.com/template") + LocaleLinkProvider.getInstance().getLink(PROPS_LINK_KEY, PROPS_LINK_KEY_DEFAULT) ) ); } else if (source == DesignerLoginSource.BBS_JUMP) { diff --git a/designer-base/src/main/java/com/fr/design/mainframe/CenterRegionContainerPane.java b/designer-base/src/main/java/com/fr/design/mainframe/CenterRegionContainerPane.java index b18b346525..3cceff5a75 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/CenterRegionContainerPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/CenterRegionContainerPane.java @@ -230,12 +230,11 @@ public class CenterRegionContainerPane extends JPanel { // 颜色,字体那些按钮的工具栏 toolbarPane.add(toolbarComponent = ad.resetToolBar(toolbarComponent, plus), BorderLayout.CENTER); - if (strategy.hasToolBarPane(plus)) { - this.add(toolbarPane, BorderLayout.NORTH); - } else { - this.remove(toolbarPane); + JPanel customNorthPane = strategy.customNorthPane(toolbarPane,plus); + if (!isExist(customNorthPane)){ + this.removeNorth(); + this.add(customNorthPane, BorderLayout.NORTH); } - if (strategy.hasTemplateTabPane(plus)) { eastCenterPane.add(templateTabPane, BorderLayout.CENTER); } else { @@ -250,6 +249,26 @@ public class CenterRegionContainerPane extends JPanel { resetByDesignMode(); } + private void removeNorth(){ + Component[] components = this.getComponents(); + for(Component c : components){ + if (c!= centerTemplateCardPane){ + this.remove(c); + } + } + } + + + private boolean isExist(JPanel customNorthPane) { + Component[] components = this.getComponents(); + for (Component component : components) { + if (component == customNorthPane) { + return true; + } + } + return false; + } + private void resetByDesignMode() { if (DesignModeContext.isDuchampMode()) { eastPane.remove(largeToolbar); @@ -292,4 +311,11 @@ public class CenterRegionContainerPane extends JPanel { return toolbarComponentState; } + /** + * 重置下RegionContainerpane + */ + public void resetCenterRegionContainerPane(){ + templateTabPane.add(MultiTemplateTabPane.getInstance(), BorderLayout.CENTER); + } + } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/DefaultToolKitConfig.java b/designer-base/src/main/java/com/fr/design/mainframe/DefaultToolKitConfig.java index 305c44aa21..73daf052f1 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/DefaultToolKitConfig.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/DefaultToolKitConfig.java @@ -2,6 +2,8 @@ package com.fr.design.mainframe; import com.fr.design.base.mode.DesignModeContext; import com.fr.design.mainframe.toolbar.ToolBarMenuDockPlus; +import javax.swing.JPanel; + public class DefaultToolKitConfig implements ToolKitConfigStrategy { @Override @@ -18,4 +20,10 @@ public class DefaultToolKitConfig implements ToolKitConfigStrategy { public boolean hasToolBarPane(ToolBarMenuDockPlus plus) { return plus.hasToolBarPane(); } + + @Override + public JPanel customNorthPane(JPanel toolBarPane, ToolBarMenuDockPlus plus) { + CenterRegionContainerPane.getInstance().resetCenterRegionContainerPane(); + return toolBarPane; + } } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java index 0082e091f3..17a5afb2b6 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java @@ -58,9 +58,12 @@ import com.fr.design.module.DesignModuleFactory; import com.fr.design.preview.PagePreview; import com.fr.design.ui.util.UIUtil; import com.fr.design.utils.DesignUtils; +import com.fr.design.utils.TemplateUtils; import com.fr.design.worker.save.CallbackSaveWorker; import com.fr.design.worker.save.EmptyCallBackSaveWorker; import com.fr.design.worker.save.SaveFailureHandler; +import com.fr.design.worker.save.type.SaveType; +import com.fr.design.worker.save.type.SaveTypeWorker; import com.fr.design.write.submit.DBManipulationInWidgetEventPane; import com.fr.design.write.submit.DBManipulationPane; import com.fr.event.EventDispatcher; @@ -118,6 +121,8 @@ import java.util.concurrent.Callable; * 报表设计和表单设计的编辑区域(设计器编辑的IO文件) */ public abstract class JTemplate> extends TargetComponent implements ToolBarMenuDockPlus, DesignerProxy, JTemplateSave, TabChangeListener, ThemedTemplate { + + private static final String DEFAULT_TAB_OPERATOR = "DefaultTabOperator"; // TODO ALEX_SEP editingFILE这个属性一定要吗?如果非要不可,有没有可能保证不为null private static final int PREDEFINED_ICON_WIDTH = 27; @@ -1687,24 +1692,7 @@ public abstract class JTemplate> if (!editingFILE.exists()) { return saveAs(showLoc); } - - CallbackSaveWorker worker = new CallbackSaveWorker(new Callable() { - @Override - public Boolean call() throws Exception { - return saveRealFileByWorker(); - } - }, this); - - worker.addSuccessCallback(new Runnable() { - @Override - public void run() { - callBackForSave(); - //在保存后的回调中执行预编译流程 - CptCompileUtil.compile(JTemplate.this); - } - }); - - return worker; + return getSaveCallBackSaveWorker(); } /** @@ -1750,6 +1738,8 @@ public abstract class JTemplate> } } + + private CallbackSaveWorker saveAs(boolean showLoc) { FILE editingFILE = this.getEditingFILE(); if (editingFILE == null) { @@ -1771,7 +1761,6 @@ public abstract class JTemplate> // 目标文件 editingFILE = fileChooser.getSelectedFILE(); } - FILE finalEditingFILE = editingFILE; CallbackSaveWorker worker = new CallbackSaveWorker(new Callable() { @Override @@ -1872,10 +1861,95 @@ public abstract class JTemplate> return saveAs(true); } + /** + * 获取保存用到的saveWorker + */ + private CallbackSaveWorker getSaveCallBackSaveWorker() { + CallbackSaveWorker worker = new CallbackSaveWorker(new Callable() { + @Override + public Boolean call() throws Exception { + return saveRealFileByWorker(); + } + }, this); + + worker.addSuccessCallback(new Runnable() { + @Override + public void run() { + callBackForSave(); + //在保存后的回调中执行预编译流程 + CptCompileUtil.compile(JTemplate.this); + } + }); + return worker; + } + + /** + * 获取保存的类别执行的callable + */ + private Callable getSaveTypeCallable() { + return () -> { + fireJTemplateSaveBefore(); + FILE editingFILE = getEditingFILE(); + // carl:editingFILE没有,当然不存了,虽然不会有这种情况 + if (editingFILE == null) { + return SaveType.TypeEnum.EMPTY; + } + // 检查一下editingFILE是不是已存在的文件,如果不存在则用saveAs + if (!editingFILE.exists()) { + return SaveType.TypeEnum.SAVE_AS; + } + return SaveType.TypeEnum.SAVE; + }; + } + + /** + * 根据保存类型获取对应的saveWorker + * + * @param saveType 保存类型 + */ + private CallbackSaveWorker getSaveTypeWorker(SaveType saveType) { + CallbackSaveWorker callbackSaveWorker; + switch (saveType.getType()) { + case EMPTY: + callbackSaveWorker = new EmptyCallBackSaveWorker(); + break; + case SAVE: + callbackSaveWorker = getSaveCallBackSaveWorker(); + break; + default: + callbackSaveWorker = saveAs(true); + } + return callbackSaveWorker; + } + + + @Override public void saveDirectly() { - CallbackSaveWorker worker = save(); - worker.start(getRuntimeId()); + new SaveTypeWorker(getSaveTypeCallable(), this) { + @Override + protected void done() { + try { + SaveType saveType = get(); + CallbackSaveWorker callbackSaveWorker = getSaveTypeWorker(saveType); + //告诉一下后面执行的saveWorker,当前判断文件是否存在的操作是否已经进行了开始转圈的那个等待动画,避免重复 + callbackSaveWorker.setSlowly(saveType.isSlowly()); + callbackSaveWorker.start(getRuntimeId()); + //如果是空也就是不保存,需要恢复一下界面(如果saveTypeWorker里进行了操作的话) + if (callbackSaveWorker instanceof EmptyCallBackSaveWorker) { + setSaving(false); + if (saveType.isSlowly()) { + if (ComparatorUtils.equals(getName(), HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().getName())) { + DesignerContext.getDesignerFrame().getCenterTemplateCardPane().hideCover(); + } + } + DesignerFrameFileDealerPane.getInstance().stateChange(); + } + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } + } + }.start(); } @Override @@ -1979,7 +2053,7 @@ public abstract class JTemplate> public void setDesignerUIMode() { DesignerUIModeConfig.getInstance().setAbsoluteMeasureUIMode(); } - + /** * 判断当前的模板是否是有效的模板 * @@ -1989,4 +2063,50 @@ public abstract class JTemplate> public static boolean isValid(JTemplate jt) { return jt != null && jt != JNullTemplate.NULL; } + + /** + * 获取此模板所使用的tab栏操作类型 + * @return + */ + public String getTemplateTabOperatorType(){ + return DEFAULT_TAB_OPERATOR; + } + + /** + * 当前模板是否可以被保存 + * @return 是/否 + */ + public boolean canBeSaved(){ + return true; + } + + /** + * 当前的模板是否支持缓存 + * + * @return 是/否 + */ + public boolean supportCache(){ + return true; + } + + /** + * 获取此模板在tab栏中显示的名称 + * @return + */ + public String getTabShowName(JTemplate jTemplate){ + String name = TemplateUtils.createLockeTemplatedName(jTemplate, jTemplate.getTemplateName()); + if (!jTemplate.isSaved() && !name.endsWith(" *")) { + name += " *"; + } + return name; + } + + /** + * 切换环境之前是否需要保存 + * @return + */ + public boolean needSaveBeforeSwitchEnv(){ + return false; + } + } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/ToolKitConfigStrategy.java b/designer-base/src/main/java/com/fr/design/mainframe/ToolKitConfigStrategy.java index 67b1409b36..f2feff8042 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/ToolKitConfigStrategy.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/ToolKitConfigStrategy.java @@ -2,6 +2,9 @@ package com.fr.design.mainframe; import com.fr.design.mainframe.toolbar.ToolBarMenuDockPlus; +import javax.swing.JPanel; + + public interface ToolKitConfigStrategy { /** @@ -24,4 +27,11 @@ public interface ToolKitConfigStrategy { * @return */ boolean hasToolBarPane(ToolBarMenuDockPlus plus); + /** + * 定制工具栏 + * @param toolBarPane + * @param plus + * @return + */ + JPanel customNorthPane(JPanel toolBarPane, ToolBarMenuDockPlus plus); } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/check/CheckFontInfoDialog.java b/designer-base/src/main/java/com/fr/design/mainframe/check/CheckFontInfoDialog.java index 0671ed1b63..8274b65355 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/check/CheckFontInfoDialog.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/check/CheckFontInfoDialog.java @@ -4,10 +4,10 @@ import com.fr.design.dialog.link.MessageWithLink; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ilable.UILabel; import com.fr.design.i18n.DesignSizeI18nManager; +import com.fr.design.i18n.LocaleLinkProvider; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.utils.gui.GUICoreUtils; -import com.fr.general.CloudCenter; import com.fr.general.IOUtils; import javax.swing.BorderFactory; @@ -39,17 +39,27 @@ public class CheckFontInfoDialog extends JDialog implements ActionListener { private UILabel directUiLabel; private UILabel detailLabel; + /** + * 云中心插件管理帮助文档在配置文件中对应的配置文件key + */ + private static final String PROPS_LINK_KEY = "Fine-Design-CloudCenter_Server_Install_Font"; + + /** + * 云中心插件管理默认帮助文档在配置文件中对应的配置文件key + */ + private static final String PROPS_LINK_KEY_DEFAULT = "Fine-Design-CloudCenter_Server_Install_Font_Default"; + public CheckFontInfoDialog(Frame parent, String areaText) { super(parent,true); //提示信息 JPanel imagePanel = new JPanel(); imageLabel = new UILabel(IOUtils.readIcon("com/fr/design/images/warnings/warning32.png")); imagePanel.add(imageLabel); - + String link = LocaleLinkProvider.getInstance().getLink(PROPS_LINK_KEY, PROPS_LINK_KEY_DEFAULT); JPanel messagePanel = FRGUIPaneFactory.createVerticalFlowLayout_S_Pane(true); MessageWithLink linkMessage = new MessageWithLink(Toolkit.i18nText("Fine_Designer_Check_Font_Message"), Toolkit.i18nText("Fine_Designer_Check_Font_Install_Font"), - CloudCenter.getInstance().acquireUrlByKind("help.install.font", "https://help.fanruan.com/finereport/doc-view-3999.html")); + link); linkMessage.setPreferredSize(DesignSizeI18nManager.getInstance().i18nDimension("com.fr.design.mainframe.check.CheckFontInfoDialog.messageWithLink")); messagePanel.add(linkMessage); diff --git a/designer-base/src/main/java/com/fr/design/update/actions/NewFeatureAction.java b/designer-base/src/main/java/com/fr/design/update/actions/NewFeatureAction.java index 56db4cee9e..320a2a23dc 100644 --- a/designer-base/src/main/java/com/fr/design/update/actions/NewFeatureAction.java +++ b/designer-base/src/main/java/com/fr/design/update/actions/NewFeatureAction.java @@ -1,9 +1,8 @@ package com.fr.design.update.actions; -import com.fr.common.util.Strings; +import com.fr.design.i18n.LocaleLinkProvider; import com.fr.design.utils.BrowseUtils; -import com.fr.general.CloudCenter; import com.fr.log.FineLoggerFactory; import java.awt.event.ActionEvent; @@ -16,17 +15,22 @@ import java.awt.event.ActionListener; * */ public class NewFeatureAction implements ActionListener { + /** + * 云中心更新日志索引在配置文件中对应的配置文件key + */ + private static final String PROPS_LINK_KEY = "Fine-Design-CloudCenter_Latest_Update_Detail"; - public static String DEFAULT_UPDATE_DETAIL_URL = "https://help.fanruan.com/finereport/doc-view-4699.html"; + /** + * 云中心更新日志索引默认链接在配置文件中对应的配置文件key + */ + private static final String PROPS_LINK_KEY_DEFAULT = "Fine-Design-CloudCenter_Latest_Update_Detail_Default"; + + public static String DEFAULT_UPDATE_DETAIL_URL = LocaleLinkProvider.getInstance().getLink(PROPS_LINK_KEY, PROPS_LINK_KEY_DEFAULT); @Override public void actionPerformed(ActionEvent e) { try { - String url = CloudCenter.getInstance().acquireConf("fr.latest.update.detil"); - if (Strings.isEmpty(url)) { - url = DEFAULT_UPDATE_DETAIL_URL; - } - BrowseUtils.browser(url); + BrowseUtils.browser(DEFAULT_UPDATE_DETAIL_URL); } catch (Exception ex) { FineLoggerFactory.getLogger().error(ex.getMessage()); } diff --git a/designer-base/src/main/java/com/fr/design/widget/btn/ButtonConstants.java b/designer-base/src/main/java/com/fr/design/widget/btn/ButtonConstants.java index 9be9a8fba4..3efc320d84 100644 --- a/designer-base/src/main/java/com/fr/design/widget/btn/ButtonConstants.java +++ b/designer-base/src/main/java/com/fr/design/widget/btn/ButtonConstants.java @@ -44,4 +44,20 @@ public class ButtonConstants { StableFactory.getMarkedClass(BridgeMark.SUBMIT_BUTTON, Widget.class), StableFactory.getMarkedClass(BridgeMark.TREE_NODE_TOGGLE_BUTTON, Widget.class) }; + + public static final String[] TYPES_BUTTON_NO_FREE = { + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Common"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Utils_Insert_Row"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Utils_Delete_Row"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Button_Type_Parameter_Submit"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_TreeNode") + }; + + public static final Class[] CLASSES_BUTTON_NO_FREE = { + Button.class, + StableFactory.getMarkedClass(BridgeMark.APPEND_ROW_BUTTON, Widget.class), + StableFactory.getMarkedClass(BridgeMark.DELETE_ROW_BUTTON, Widget.class), + StableFactory.getMarkedClass(BridgeMark.SUBMIT_BUTTON, Widget.class), + StableFactory.getMarkedClass(BridgeMark.TREE_NODE_TOGGLE_BUTTON, Widget.class) + }; } diff --git a/designer-base/src/main/java/com/fr/design/widget/btn/ButtonDetailPane.java b/designer-base/src/main/java/com/fr/design/widget/btn/ButtonDetailPane.java index 63d678577a..2b73a3fe7f 100644 --- a/designer-base/src/main/java/com/fr/design/widget/btn/ButtonDetailPane.java +++ b/designer-base/src/main/java/com/fr/design/widget/btn/ButtonDetailPane.java @@ -1,11 +1,9 @@ package com.fr.design.widget.btn; +import com.fr.design.beans.BasicBeanPane; import com.fr.design.gui.icombobox.DictionaryComboBox; import com.fr.design.dialog.BasicPane; -import com.fr.design.widget.btn.ButtonConstants; import com.fr.form.ui.Button; - - import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import java.awt.event.ActionEvent; @@ -13,6 +11,7 @@ import java.awt.event.ActionListener; import java.util.ArrayList; import java.util.List; + /** * Created by IntelliJ IDEA. * Author : Richer @@ -22,7 +21,7 @@ import java.util.List; */ public abstract class ButtonDetailPane extends BasicPane { private List ls = new ArrayList(); - + protected final List> extraPaneList = new ArrayList<>(); @Override public String title4PopupWindow() { return com.fr.design.i18n.Toolkit.i18nText("Button"); @@ -49,7 +48,10 @@ public abstract class ButtonDetailPane extends BasicPane { public abstract Class classType(); protected DictionaryComboBox createButtonTypeComboBox() { - final DictionaryComboBox dictionaryComboBox = new DictionaryComboBox(ButtonConstants.CLASSES4BUTTON, ButtonConstants.TYPES4BUTTON, false); + return createButtonTypeComboBox(false); + } + + private DictionaryComboBox initDictionaryComboBox(DictionaryComboBox dictionaryComboBox) { dictionaryComboBox.setSelectedItem(classType()); dictionaryComboBox.addActionListener(new ActionListener() { @Override @@ -59,4 +61,14 @@ public abstract class ButtonDetailPane extends BasicPane { }); return dictionaryComboBox; } + + protected DictionaryComboBox createButtonTypeComboBox(Boolean containsExtraPane) { + final DictionaryComboBox dictionaryComboBox; + if (!containsExtraPane) { + dictionaryComboBox = new DictionaryComboBox(ButtonConstants.CLASSES4BUTTON, ButtonConstants.TYPES4BUTTON, false); + } else { + dictionaryComboBox = new DictionaryComboBox(ButtonConstants.CLASSES_BUTTON_NO_FREE, ButtonConstants.TYPES_BUTTON_NO_FREE, false); + } + return initDictionaryComboBox(dictionaryComboBox); + } } \ No newline at end of file diff --git a/designer-base/src/main/java/com/fr/design/widget/btn/ButtonWithHotkeysDetailPane.java b/designer-base/src/main/java/com/fr/design/widget/btn/ButtonWithHotkeysDetailPane.java index b75aeaa81f..d146c73099 100644 --- a/designer-base/src/main/java/com/fr/design/widget/btn/ButtonWithHotkeysDetailPane.java +++ b/designer-base/src/main/java/com/fr/design/widget/btn/ButtonWithHotkeysDetailPane.java @@ -6,6 +6,7 @@ import javax.swing.*; import com.fr.design.designer.IntervalConstants; import com.fr.design.foldablepane.UIExpandablePane; +import com.fr.design.gui.icombobox.DictionaryComboBox; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.itextfield.UITextField; import com.fr.design.layout.FRGUIPaneFactory; @@ -42,8 +43,9 @@ public abstract class ButtonWithHotkeysDetailPane extends Butt JPanel labelPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); iconPane = new AccessibleIconEditor(); labelPane.add(iconPane); + Component comp = createCenterPane(); Component[][] n_components = { - {new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Button_Type")), createButtonTypeComboBox()}, + {new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Button_Type")), createCustomButtonTypeComboBox()}, {new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Button_Name")), buttonNameTextField = new UITextField()}, {new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Button_Icon")), iconPane}, {new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Button_Hot_keys")), hotkeysTextField = new UITextField()}, @@ -52,7 +54,6 @@ public abstract class ButtonWithHotkeysDetailPane extends Butt JPanel panel = TableLayoutHelper.createGapTableLayoutPane(n_components, rowSize, columnSize, IntervalConstants.INTERVAL_W1, IntervalConstants.INTERVAL_L1); panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0)); advancePane.add(panel, BorderLayout.NORTH); - Component comp = createCenterPane(); if(comp != null ) { advancePane.add(comp,BorderLayout.CENTER); } @@ -63,6 +64,13 @@ public abstract class ButtonWithHotkeysDetailPane extends Butt protected abstract Component createCenterPane(); + /** + * 判断是按钮控件下拉框的种类:1.有自定义按钮 2.无自定义按钮 + */ + protected DictionaryComboBox createCustomButtonTypeComboBox() { + return createButtonTypeComboBox(); + } + @Override public void populate(T button) { if (button == null) { diff --git a/designer-base/src/main/java/com/fr/design/worker/save/SaveWorker.java b/designer-base/src/main/java/com/fr/design/worker/save/SaveWorker.java index 60d797c3e9..83b7c50d49 100644 --- a/designer-base/src/main/java/com/fr/design/worker/save/SaveWorker.java +++ b/designer-base/src/main/java/com/fr/design/worker/save/SaveWorker.java @@ -5,12 +5,16 @@ import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerFrameFileDealerPane; import com.fr.design.mainframe.EastRegionContainerPane; import com.fr.design.mainframe.JTemplate; +import com.fr.design.ui.util.UIUtil; import com.fr.design.worker.WorkerManager; +import com.fr.design.worker.save.type.SaveTypeWorker; import com.fr.general.ComparatorUtils; import com.fr.log.FineLoggerFactory; + import java.util.concurrent.Callable; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.TimeoutException; + +import com.fr.third.org.apache.commons.lang3.time.StopWatch; + import javax.swing.SwingWorker; /** @@ -34,6 +38,14 @@ public class SaveWorker extends SwingWorker { private boolean slowly; + public boolean isSlowly() { + return slowly; + } + + public void setSlowly(boolean slowly) { + this.slowly = slowly; + } + public SaveWorker(Callable callable, JTemplate template) { this.callable = callable; this.template = template; @@ -47,10 +59,11 @@ public class SaveWorker extends SwingWorker { @Override protected void done() { try { - success = get(); + success = get(); } catch (Exception e) { processResult(); FineLoggerFactory.getLogger().error(e.getMessage(), e); + WorkerManager.getInstance().removeWorker(taskName); SaveFailureHandler.getInstance().process(e); return; } @@ -62,6 +75,7 @@ public class SaveWorker extends SwingWorker { // 恢复界面 if (slowly && ComparatorUtils.equals(this.template.getName(), HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().getName())) { DesignerContext.getDesignerFrame().getCenterTemplateCardPane().hideCover(); + slowly = false; } DesignerFrameFileDealerPane.getInstance().stateChange(); WorkerManager.getInstance().removeWorker(taskName); @@ -69,21 +83,29 @@ public class SaveWorker extends SwingWorker { public void start(String taskName) { this.taskName = taskName; + StopWatch stopWatch = StopWatch.createStarted(); this.template.setSaving(true); this.execute(); // worker纳入管理 WorkerManager.getInstance().registerWorker(taskName, this); - try { - this.get(TIME_OUT, TimeUnit.MILLISECONDS); - } catch (TimeoutException timeoutException) { - slowly = true; - // 开始禁用 - EastRegionContainerPane.getInstance().updateAllPropertyPane(); - DesignerContext.getDesignerFrame().getCenterTemplateCardPane().showCover(); - DesignerFrameFileDealerPane.getInstance().stateChange(); - } catch (Exception exception) { - FineLoggerFactory.getLogger().error(exception.getMessage(), exception); - WorkerManager.getInstance().removeWorker(taskName); - } + SaveTypeWorker.SAVE_TYPE_POOL.execute(() -> { + while (true) { + if (stopWatch.getTime() > TIME_OUT || isDone()) { + if (!isDone()) { + slowly = true; + UIUtil.invokeLaterIfNeeded(() -> { + // 开始禁用 + if (slowly) { + EastRegionContainerPane.getInstance().updateAllPropertyPane(); + DesignerContext.getDesignerFrame().getCenterTemplateCardPane().showCover(); + DesignerFrameFileDealerPane.getInstance().stateChange(); + } + }); + } + stopWatch.stop(); + break; + } + } + }); } } diff --git a/designer-base/src/main/java/com/fr/design/worker/save/type/SaveType.java b/designer-base/src/main/java/com/fr/design/worker/save/type/SaveType.java new file mode 100644 index 0000000000..63cf6c4c7e --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/worker/save/type/SaveType.java @@ -0,0 +1,50 @@ +package com.fr.design.worker.save.type; + +/** + * 保存的类别 + * + * @author John.Ying + * @since 11.0 + * Created on 2023/4/14 + */ +public class SaveType { + + private TypeEnum type; + //保存时间是否慢(是否展示了保存中的UI界面) + private boolean slowly; + + public TypeEnum getType() { + return type; + } + + public void setType(TypeEnum saveType) { + this.type = saveType; + } + + public boolean isSlowly() { + return slowly; + } + + public void setSlowly(boolean slowly) { + this.slowly = slowly; + } + + /** + * 保存类型:save or saveAs or empty + */ + public enum TypeEnum { + /** + * 保存 + */ + SAVE, + /** + * 另存 + */ + SAVE_AS, + /** + * 空保存 + */ + EMPTY; + } + +} diff --git a/designer-base/src/main/java/com/fr/design/worker/save/type/SaveTypeWorker.java b/designer-base/src/main/java/com/fr/design/worker/save/type/SaveTypeWorker.java new file mode 100644 index 0000000000..d415537eb4 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/worker/save/type/SaveTypeWorker.java @@ -0,0 +1,81 @@ +package com.fr.design.worker.save.type; + + +import com.fr.concurrent.FineExecutors; +import com.fr.design.mainframe.DesignerContext; +import com.fr.design.mainframe.DesignerFrameFileDealerPane; +import com.fr.design.mainframe.EastRegionContainerPane; +import com.fr.design.mainframe.JTemplate; +import com.fr.design.ui.util.UIUtil; +import com.fr.third.org.apache.commons.lang3.time.StopWatch; + +import javax.swing.SwingWorker; +import java.util.concurrent.Callable; +import java.util.concurrent.ExecutorService; + +/** + * 判断保存类别时执行的worker + * + * @author John.Ying + * @since 11.0 + * Created on 2023/4/14 + */ +public class SaveTypeWorker extends SwingWorker { + + public static final ExecutorService SAVE_TYPE_POOL = FineExecutors.newSingleThreadExecutor(); + + private final Callable callable; + + private static final int TIME_OUT = 400; + + private final JTemplate template; + + private final SaveType saveType; + + + + public SaveTypeWorker(Callable callable, JTemplate template) { + this.callable = callable; + this.template = template; + this.saveType = new SaveType(); + } + + @Override + protected SaveType doInBackground() throws Exception { + this.saveType.setType(callable.call()); + return this.saveType; + } + + @Override + protected void done() { + + } + + /** + * 启动saveTypeWorker + */ + public void start() { + StopWatch stopWatch = StopWatch.createStarted(); + this.template.setSaving(true); + this.execute(); + SAVE_TYPE_POOL.execute(() -> { + while (true) { + //大于最大等待时间或者worker已经完成该线程都要结束循环 + if (stopWatch.getTime() > TIME_OUT || isDone()) { + //如果是大于最大等待时间结束的,就需要进行等待中界面的覆盖 + if (!isDone()) { + saveType.setSlowly(true); + UIUtil.invokeLaterIfNeeded(() -> { + // 开始禁用 + EastRegionContainerPane.getInstance().updateAllPropertyPane(); + DesignerContext.getDesignerFrame().getCenterTemplateCardPane().showCover(); + DesignerFrameFileDealerPane.getInstance().stateChange(); + }); + } + stopWatch.stop(); + break; + } + } + }); + } +} diff --git a/designer-base/src/main/java/com/fr/env/RemoteDesignLocaleMark.java b/designer-base/src/main/java/com/fr/env/RemoteDesignLocaleMark.java index 877a9224b2..dd95323617 100644 --- a/designer-base/src/main/java/com/fr/env/RemoteDesignLocaleMark.java +++ b/designer-base/src/main/java/com/fr/env/RemoteDesignLocaleMark.java @@ -1,11 +1,7 @@ package com.fr.env; -import com.fr.general.CloudCenter; -import com.fr.general.GeneralContext; +import com.fr.design.i18n.LocaleLinkProvider; import com.fr.general.locale.LocaleMark; -import java.util.HashMap; -import java.util.Locale; -import java.util.Map; /** * @author hades @@ -14,23 +10,21 @@ import java.util.Map; */ public class RemoteDesignLocaleMark implements LocaleMark { - private Map map = new HashMap<>(); - private static final String REMOTE_DESIGN_CN = CloudCenter.getInstance().acquireUrlByKind("help.remote.design.zh_CN", "https://help.fanruan.com/finereport/doc-view-3925.html"); - private static final String REMOTE_DESIGN_EN = CloudCenter.getInstance().acquireUrlByKind("help.remote.design.en_US", "https://help.fanruan.com/finereport-en/doc-view-3862.html"); + /** + * 云中心远程设计常见问题链接在配置文件中对应的配置文件key + */ + private static final String PROPS_LINK_KEY = "Fine-Design-CloudCenter_Remote_Design_Question"; + /** + * 云中心远程设计常见问题链接在配置文件中对应的配置文件key + */ + private static final String PROPS_LINK_KEY_DEFAULT = "Fine-Design-CloudCenter_Remote_Design_Question_Default"; - public RemoteDesignLocaleMark() { - map.put(Locale.CHINA, REMOTE_DESIGN_CN); - map.put(Locale.KOREA, REMOTE_DESIGN_EN); - map.put(Locale.JAPAN, REMOTE_DESIGN_EN); - map.put(Locale.US, REMOTE_DESIGN_EN); - map.put(Locale.TAIWAN, REMOTE_DESIGN_CN); - } + public RemoteDesignLocaleMark() {} @Override public String getValue() { - String result = map.get(GeneralContext.getLocale()); - return result == null ? REMOTE_DESIGN_CN : result; + return LocaleLinkProvider.getInstance().getLink(PROPS_LINK_KEY, PROPS_LINK_KEY_DEFAULT); } } diff --git a/designer-base/src/main/java/com/fr/env/SyncFailedPluginsDialog.java b/designer-base/src/main/java/com/fr/env/SyncFailedPluginsDialog.java index fd4b98e33e..a0b07bd2c0 100644 --- a/designer-base/src/main/java/com/fr/env/SyncFailedPluginsDialog.java +++ b/designer-base/src/main/java/com/fr/env/SyncFailedPluginsDialog.java @@ -6,25 +6,18 @@ import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.itextarea.UITextArea; import com.fr.design.i18n.DesignSizeI18nManager; +import com.fr.design.i18n.LocaleLinkProvider; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.DesignerContext; import com.fr.design.utils.gui.GUICoreUtils; -import com.fr.general.CloudCenter; import com.fr.general.ComparatorUtils; import com.fr.general.GeneralContext; import com.fr.general.IOUtils; import com.fr.json.JSONArray; import com.fr.json.JSONObject; import com.fr.stable.StringUtils; -import java.awt.BorderLayout; -import java.awt.Dimension; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; -import java.awt.event.MouseListener; -import java.awt.event.WindowAdapter; -import java.awt.event.WindowEvent; -import java.util.Locale; + import javax.swing.BorderFactory; import javax.swing.Icon; import javax.swing.JDialog; @@ -33,6 +26,14 @@ import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.UIManager; +import java.awt.BorderLayout; +import java.awt.Dimension; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; +import java.util.Locale; /** * @author pengda @@ -47,6 +48,16 @@ public class SyncFailedPluginsDialog extends JDialog { private RestartHelper restartHelper = new RestartHelper(); private UIButton restartButton; private boolean show = false; + + /** + * 云中心插件管理帮助文档在配置文件中对应的配置文件key + */ + private static final String PROPS_LINK_KEY = "Fine-Design-CloudCenter_Plugin_Management"; + + /** + * 云中心插件管理默认帮助文档在配置文件中对应的配置文件key + */ + private static final String PROPS_LINK_KEY_DEFAULT = "Fine-Design-CloudCenter_Plugin_Management_Default"; public SyncFailedPluginsDialog(JFrame parent, JSONArray syncFailedPlugins) { super(parent, true); JPanel body = FRGUIPaneFactory.createBorderLayout_L_Pane(); @@ -62,7 +73,7 @@ public class SyncFailedPluginsDialog extends JDialog { JPanel messagePane = FRGUIPaneFactory.createBorderLayout_S_Pane(); MessageWithLink messageWithLink = new MessageWithLink(Toolkit.i18nText("Fine-Design_Basic_Sync_Plugin_Fail_Suggestion"),Toolkit.i18nText("Fine-Design_Basic_Sync_Deal_Immediately"), - CloudCenter.getInstance().acquireUrlByKind("help.installplugins", "https://help.fanruan.com/finereport/doc-view-2198.html")); + LocaleLinkProvider.getInstance().getLink(PROPS_LINK_KEY, PROPS_LINK_KEY_DEFAULT)); messageWithLink.setPreferredSize(DesignSizeI18nManager.getInstance().i18nDimension("com.fr.env.SyncFailedPluginsDialog.messageWithLink")); messagePane.add(messageWithLink); diff --git a/designer-base/src/main/java/com/fr/env/detect/base/DetectorConstants.java b/designer-base/src/main/java/com/fr/env/detect/base/DetectorConstants.java index 4e4592dcde..61f08c344c 100644 --- a/designer-base/src/main/java/com/fr/env/detect/base/DetectorConstants.java +++ b/designer-base/src/main/java/com/fr/env/detect/base/DetectorConstants.java @@ -1,13 +1,33 @@ package com.fr.env.detect.base; +import com.fr.design.i18n.LocaleLinkProvider; + /** * created by Harrison on 2022/05/25 **/ public class DetectorConstants { + /** + * 云中心FineDB异常检测帮助文档在配置文件中对应的配置文件key + */ + private static final String FINE_DB_HELP_PROPS_LINK_KEY = "Fine-Design-CloudCenter_FineDB_Exception_Check"; + + /** + * 云中心FineDB异常检测帮助文档默认链接在配置文件中对应的配置文件key + */ + private static final String FINE_DB_HELP_PROPS_LINK_KEY_DEFAULT = "Fine-Design-CloudCenter_FineDB_Exception_Check_Default"; + + /** + * 云中心FineDB异常检测帮助文档在配置文件中对应的配置文件key + */ + private static final String JAR_HELP_PROPS_LINK_KEY = "Fine-Design-CloudCenter_Jar_Exception_Check"; + + /** + * 云中心FineDB异常检测帮助文档默认链接在配置文件中对应的配置文件key + */ + private static final String JAR_HELP_PROPS_LINK_KEY_DEFAULT = "Fine-Design-CloudCenter_Jar_Exception_Check_Default"; + public static final String JAR_HELP_LINK = LocaleLinkProvider.getInstance().getLink(JAR_HELP_PROPS_LINK_KEY, JAR_HELP_PROPS_LINK_KEY_DEFAULT);; - public static final String JAR_HELP_LINK = "https://help.fanruan.com/finereport/doc-view-4700.html?source=3"; - - public static final String FINE_DB_HELP_LINK = "https://help.fanruan.com/finereport/doc-view-4701.html?source=3"; + public static final String FINE_DB_HELP_LINK = LocaleLinkProvider.getInstance().getLink(FINE_DB_HELP_PROPS_LINK_KEY, FINE_DB_HELP_PROPS_LINK_KEY_DEFAULT); public static final String SEPARATOR = "、"; public static final String BR_TAG = "
"; diff --git a/designer-base/src/main/java/com/fr/file/FILEChooserPane.java b/designer-base/src/main/java/com/fr/file/FILEChooserPane.java index 0561319db4..66b9d12d3d 100644 --- a/designer-base/src/main/java/com/fr/file/FILEChooserPane.java +++ b/designer-base/src/main/java/com/fr/file/FILEChooserPane.java @@ -129,6 +129,10 @@ public class FILEChooserPane extends BasicPane { public static final int JOPTIONPANE_CANCEL_OPTION = 3; + public static final String SEPARATOR_STRING = "/"; + + public static final char SEPARATOR_CHAR = '/'; + /** * alex:之所以在Pattern那里加个+,是因为有些路径会有两个甚至多个分隔符放在一起 @@ -1466,10 +1470,17 @@ public class FILEChooserPane extends BasicPane { for (int i = 0; i < this.buttonList.size(); i++) { this.buttonList.get(i).setForeground(null); if (((SetDirectoryAction) this.buttonList.get(i).getAction()).getDir() != null - && this.buttonList.get(i).getAction() instanceof SetDirectoryAction - && (ComparatorUtils.equals(((SetDirectoryAction) this.buttonList.get(i).getAction()).getDir().getPath(), dir.getPath()))) { - - this.buttonList.get(i).setForeground(Color.BLUE); + && this.buttonList.get(i).getAction() instanceof SetDirectoryAction) { + String actionPath = ((SetDirectoryAction) this.buttonList.get(i).getAction()).getDir().getPath(); + String dirPath = dir.getPath(); + //如果是报表环境,button的Action最后会跟上"/",这个是特意处理的,但是对应代码没有说明原因,不做修改 + //FILE的getPath不会带"/",这边针对这种情况加个处理,不建议直接改FILE + if (actionPath.endsWith(SEPARATOR_STRING) && !dirPath.endsWith(SEPARATOR_STRING)) { + dirPath = dirPath + SEPARATOR_STRING; + } + if (ComparatorUtils.equals(actionPath, dirPath)) { + this.buttonList.get(i).setForeground(Color.BLUE); + } } } } @@ -1479,7 +1490,7 @@ public class FILEChooserPane extends BasicPane { } public void populate(FILE dir) { - if (popDir != null && dir != null && popDir.toString().indexOf(dir.toString()) == 0) { + if (checkOnlyHighLight(dir)) { highLightButton(dir); return; } @@ -1530,6 +1541,24 @@ public class FILEChooserPane extends BasicPane { highLightButton(dir); } + /** + * 检查是不是只需要设置高亮即可 + * + * @param dir FILE + * @return 如果还要进行别的设置就返回false,如果只需要更新下高亮(通过点击上面的路径才会只需要更新高亮),返回true + */ + private boolean checkOnlyHighLight(FILE dir) { + if (popDir == null || dir == null) { + return false; + } + String popDirStr = popDir.toString(); + String dirStr = dir.toString(); + //前缀匹配是不够的,还要看下前缀匹配的下一位是不是'/' + //否则"test"和"test副本"明明不属于同个路径逻辑,也只更新高亮,应该是"test"和"test/副本"这样才可以通过 + //如果通过了indexOf的检查,因为不会存在相同的路径,popDirStr只会比dirStr大,看一下前缀匹配的下一位是不是'/',如果不是就得更新路径文本,不能只设置高亮 + return popDirStr.indexOf(dirStr) == 0 && popDirStr.length() > dirStr.length() && popDirStr.charAt(dirStr.length()) == SEPARATOR_CHAR; + } + // doLayout @Override public void doLayout() { diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/ChartPropertyPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/ChartPropertyPane.java index 4efe977ff3..297245960d 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/ChartPropertyPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/ChartPropertyPane.java @@ -9,6 +9,7 @@ import com.fr.base.chart.BaseChartCollection; import com.fr.chart.chartattr.ChartCollection; import com.fr.chart.charttypes.ChartTypeManager; import com.fr.chartx.attr.ChartProvider; +import com.fr.decision.webservice.v10.map.geojson.helper.GEOJSONHelper; import com.fr.design.ChartTypeInterfaceManager; import com.fr.design.designer.TargetComponent; import com.fr.design.gui.chart.BaseChartPropertyPane; @@ -19,6 +20,7 @@ import com.fr.design.utils.gui.GUICoreUtils; import javax.swing.BorderFactory; import javax.swing.Icon; +import javax.swing.SwingWorker; import java.awt.BorderLayout; import java.awt.Component; diff --git a/designer-chart/src/main/java/com/fr/van/chart/custom/component/VanChartHyperLinkPane.java b/designer-chart/src/main/java/com/fr/van/chart/custom/component/VanChartHyperLinkPane.java index 75ec5d3ce2..5b17494da9 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/custom/component/VanChartHyperLinkPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/custom/component/VanChartHyperLinkPane.java @@ -154,24 +154,23 @@ public class VanChartHyperLinkPane extends VanChartUIListControlPane { } HashMap paneMap = getHyperlinkMap(); - //安装平台内打开插件时,添加相应按钮 - Set providers = ExtraDesignClassManager.getInstance().getArray(HyperlinkProvider.XML_TAG); java.util.List list = refreshList(paneMap); + Map creators = new ListMap<>(); int size = list.size(); - NameObjectCreator[] creators = new NameObjectCreator[size + providers.size()]; for (int i = 0; i < size; i++) { UIMenuNameableCreator uiMenuNameableCreator = list.get(i); - creators[i] = new NameObjectCreator(uiMenuNameableCreator.getName(), uiMenuNameableCreator.getObj().getClass(), uiMenuNameableCreator.getPaneClazz()); + NameObjectCreator creator = new NameObjectCreator(uiMenuNameableCreator.getName(), uiMenuNameableCreator.getObj().getClass(), uiMenuNameableCreator.getPaneClazz()); + creators.put(uiMenuNameableCreator.getName(), creator); } + //安装平台内打开插件时, 添加/替换 相应按钮 + Set providers = ExtraDesignClassManager.getInstance().getArray(HyperlinkProvider.XML_TAG); for (HyperlinkProvider provider : providers) { NameableCreator creator = provider.createHyperlinkCreator(); if (creator != null) { - creators[size] = new NameObjectCreator(creator.menuName(), creator.getHyperlink(), creator.getUpdatePane()); - size++; + creators.put(creator.menuName(), new NameObjectCreator(creator.menuName(), creator.getHyperlink(), creator.getUpdatePane())); } } - - refreshNameableCreator(creators); + refreshNameableCreator(creators.values().toArray(new NameObjectCreator[0])); } public void populate(Plot plot) { @@ -303,18 +302,30 @@ public class VanChartHyperLinkPane extends VanChartUIListControlPane { @Override protected void initCreatorsFilter() { - this.creatorsFilter = nameableCreator -> { + this.creatorsFilter = nameableCreator -> { Class clazz = nameableCreator.getHyperlink(); JTemplate template = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); if (!JTemplate.isValid(template)) { return false; } - Class[] classes = new Class[]{ChartHyperRelateCellLink.class, ChartHyperRelateFloatLink.class}; - for (Class aClass : classes) { - if (template.getEditingReportIndex() == BaseJForm.FORM_TAB) { - // 编辑的是决策报表中的图表,那么没有ChartHyperRelateFloatLink 和 ChartHyperRelateCellLink 选项,有FormHyperlink 选项 - if (ComparatorUtils.equals(aClass, clazz)) { - return false; + + if (template.isJWorkBook()) { + // 如果是普通报表单元格,那么没有 FormHyperlink 选项 + FormHyperlinkProvider formHyperlink = StableFactory.getMarkedInstanceObjectFromClass(FormHyperlinkProvider.XML_TAG, FormHyperlinkProvider.class); + return !ComparatorUtils.equals(clazz, formHyperlink.getClass()); + } else { + // 如果是决策报表 + if (template.getEditingReportIndex() == BaseJForm.ELEMENTCASE_TAB) { + // 编辑的是决策报表中的报表块,那么没有 ChartHyperRelateFloatLink选项 + return !ComparatorUtils.equals(clazz, ChartHyperRelateFloatLink.class); + } + Class[] classes = new Class[]{ChartHyperRelateCellLink.class, ChartHyperRelateFloatLink.class}; + for (Class aClass : classes) { + if (template.getEditingReportIndex() == BaseJForm.FORM_TAB) { + // 编辑的是决策报表中的图表,那么没有 ChartHyperRelateFloatLink 和 ChartHyperRelateCellLink 选项 + if (ComparatorUtils.equals(aClass, clazz)) { + return false; + } } } } diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XNumberEditor.java b/designer-form/src/main/java/com/fr/design/designer/creator/XNumberEditor.java index fc359976e2..8dbe1e716a 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XNumberEditor.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XNumberEditor.java @@ -6,7 +6,9 @@ package com.fr.design.designer.creator; import com.fr.base.BaseUtils; import com.fr.base.ScreenResolution; import com.fr.base.Style; +import com.fr.design.designer.properties.mobile.NumberEditorMobilePropertyUI; import com.fr.design.form.util.XCreatorConstants; +import com.fr.design.fun.WidgetPropertyUIProvider; import com.fr.design.mainframe.widget.editors.InChangeBooleanEditor; import com.fr.design.mainframe.widget.editors.SpinnerMaxNumberEditor; import com.fr.design.mainframe.widget.editors.SpinnerMinNumberEditor; @@ -92,14 +94,18 @@ public class XNumberEditor extends XWrapperedFieldEditor { } @Override - protected JComponent initEditor() { - setBorder(FIELDBORDER); - return this; - } + protected JComponent initEditor() { + setBorder(FIELDBORDER); + return this; + } - @Override - protected String getIconName() { - return "number_field_16.png"; - } + @Override + protected String getIconName() { + return "number_field_16.png"; + } + @Override + public WidgetPropertyUIProvider[] getWidgetPropertyUIProviders() { + return new WidgetPropertyUIProvider[]{new NumberEditorMobilePropertyUI(this)}; + } } diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XPassword.java b/designer-form/src/main/java/com/fr/design/designer/creator/XPassword.java index 4194e4be03..29de6c9d05 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XPassword.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XPassword.java @@ -3,7 +3,9 @@ */ package com.fr.design.designer.creator; +import com.fr.design.designer.properties.mobile.PasswordMobilePropertyUI; import com.fr.design.form.util.XCreatorConstants; +import com.fr.design.fun.WidgetPropertyUIProvider; import com.fr.design.gui.ibutton.UIPasswordField; import com.fr.design.mainframe.widget.editors.RegexEditor; import com.fr.design.mainframe.widget.editors.WidgetValueEditor; @@ -68,4 +70,8 @@ public class XPassword extends XWrapperedFieldEditor { (CRPropertyDescriptor[]) ArrayUtils.addAll(sup, new CRPropertyDescriptor[]{regex, waterMark}); } + @Override + public WidgetPropertyUIProvider[] getWidgetPropertyUIProviders() { + return new WidgetPropertyUIProvider[]{new PasswordMobilePropertyUI(this)}; + } } diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XTextArea.java b/designer-form/src/main/java/com/fr/design/designer/creator/XTextArea.java index 845fe43d9e..88d0391ceb 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XTextArea.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XTextArea.java @@ -6,7 +6,9 @@ package com.fr.design.designer.creator; import com.fr.base.BaseUtils; import com.fr.base.ScreenResolution; import com.fr.base.Style; +import com.fr.design.designer.properties.mobile.TextAreaMobilePropertyUI; import com.fr.design.form.util.XCreatorConstants; +import com.fr.design.fun.WidgetPropertyUIProvider; import com.fr.design.mainframe.widget.editors.RegexEditor; import com.fr.design.mainframe.widget.editors.WidgetValueEditor; import com.fr.design.mainframe.widget.renderer.RegexCellRencerer; @@ -25,8 +27,9 @@ import java.beans.IntrospectionException; /** * @author richer * @since 6.5.3 + * Created on 2016/3/29 */ -public class XTextArea extends XFieldEditor { +public class XTextArea extends XWrapperedFieldEditor { public XTextArea(TextArea widget, Dimension initSize) { super(widget, initSize); @@ -81,4 +84,10 @@ public class XTextArea extends XFieldEditor { protected String getIconName() { return "text_area_16.png"; } + + @Override + public WidgetPropertyUIProvider[] getWidgetPropertyUIProviders() { + return new WidgetPropertyUIProvider[]{new TextAreaMobilePropertyUI(this)}; + } + } diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XTextEditor.java b/designer-form/src/main/java/com/fr/design/designer/creator/XTextEditor.java index 00daae7c7d..a1aca00ed0 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XTextEditor.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XTextEditor.java @@ -6,7 +6,7 @@ package com.fr.design.designer.creator; import com.fr.base.BaseUtils; import com.fr.base.ScreenResolution; import com.fr.base.Style; -import com.fr.design.designer.properties.mobile.ScanCodeMobilePropertyUI; +import com.fr.design.designer.properties.mobile.TextEditorMobilePropertyUI; import com.fr.design.form.util.XCreatorConstants; import com.fr.design.fun.WidgetPropertyUIProvider; import com.fr.design.mainframe.widget.editors.RegexEditor; @@ -86,6 +86,6 @@ public class XTextEditor extends XWrapperedFieldEditor { @Override public WidgetPropertyUIProvider[] getWidgetPropertyUIProviders() { - return new WidgetPropertyUIProvider[] {new ScanCodeMobilePropertyUI(this)}; + return new WidgetPropertyUIProvider[]{new TextEditorMobilePropertyUI(this)}; } } diff --git a/designer-form/src/main/java/com/fr/design/designer/properties/mobile/NumberEditorMobilePropertyUI.java b/designer-form/src/main/java/com/fr/design/designer/properties/mobile/NumberEditorMobilePropertyUI.java new file mode 100644 index 0000000000..67a8569f72 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/designer/properties/mobile/NumberEditorMobilePropertyUI.java @@ -0,0 +1,37 @@ +package com.fr.design.designer.properties.mobile; + +import com.fr.design.designer.creator.XCreator; +import com.fr.design.dialog.BasicPane; +import com.fr.design.fun.impl.AbstractWidgetPropertyUIProvider; +import com.fr.design.gui.itable.AbstractPropertyTable; +import com.fr.design.widget.ui.designer.mobile.NumberEditorMobileDefinePane; + +/** + * 数字控件属性面板注册 + * + * @author Coral.Chen + * @since 11.0 + * Created on 2023/3/30 + */ +public class NumberEditorMobilePropertyUI extends AbstractWidgetPropertyUIProvider { + private XCreator xCreator; + + public NumberEditorMobilePropertyUI(XCreator xCreator) { + this.xCreator = xCreator; + } + + @Override + public AbstractPropertyTable createWidgetAttrTable() { + return null; + } + + @Override + public BasicPane createWidgetAttrPane() { + return new NumberEditorMobileDefinePane(xCreator); + } + + @Override + public String tableTitle() { + return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Mobile_Attr"); + } +} \ No newline at end of file diff --git a/designer-form/src/main/java/com/fr/design/designer/properties/mobile/PasswordMobilePropertyUI.java b/designer-form/src/main/java/com/fr/design/designer/properties/mobile/PasswordMobilePropertyUI.java new file mode 100644 index 0000000000..2c3b3b2270 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/designer/properties/mobile/PasswordMobilePropertyUI.java @@ -0,0 +1,37 @@ +package com.fr.design.designer.properties.mobile; + +import com.fr.design.designer.creator.XCreator; +import com.fr.design.dialog.BasicPane; +import com.fr.design.fun.impl.AbstractWidgetPropertyUIProvider; +import com.fr.design.gui.itable.AbstractPropertyTable; +import com.fr.design.widget.ui.designer.mobile.PasswordMobileDefinePane; + +/** + * 密码控件移动端属性注册 + * + * @author Coral.Chen + * @since 11.0 + * Created on 2023/3/30 + */ +public class PasswordMobilePropertyUI extends AbstractWidgetPropertyUIProvider { + private XCreator xCreator; + + public PasswordMobilePropertyUI(XCreator xCreator) { + this.xCreator = xCreator; + } + + @Override + public AbstractPropertyTable createWidgetAttrTable() { + return null; + } + + @Override + public BasicPane createWidgetAttrPane() { + return new PasswordMobileDefinePane(xCreator); + } + + @Override + public String tableTitle() { + return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Mobile_Attr"); + } +} \ No newline at end of file diff --git a/designer-form/src/main/java/com/fr/design/designer/properties/mobile/TextAreaMobilePropertyUI.java b/designer-form/src/main/java/com/fr/design/designer/properties/mobile/TextAreaMobilePropertyUI.java new file mode 100644 index 0000000000..1c24e06bce --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/designer/properties/mobile/TextAreaMobilePropertyUI.java @@ -0,0 +1,37 @@ +package com.fr.design.designer.properties.mobile; + +import com.fr.design.designer.creator.XCreator; +import com.fr.design.dialog.BasicPane; +import com.fr.design.fun.impl.AbstractWidgetPropertyUIProvider; +import com.fr.design.gui.itable.AbstractPropertyTable; +import com.fr.design.widget.ui.designer.mobile.TextAreaAdvancedDefinePane; + +/** + * 文本域控件移动端属性 + * + * @author Coral.Chen + * @since 11.0 + * Created on 2023/3/29 + */ +public class TextAreaMobilePropertyUI extends AbstractWidgetPropertyUIProvider { + private XCreator xCreator; + + public TextAreaMobilePropertyUI(XCreator xCreator) { + this.xCreator = xCreator; + } + + @Override + public AbstractPropertyTable createWidgetAttrTable() { + return null; + } + + @Override + public BasicPane createWidgetAttrPane() { + return new TextAreaAdvancedDefinePane(xCreator); + } + + @Override + public String tableTitle() { + return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Mobile_Attr"); + } +} \ No newline at end of file diff --git a/designer-form/src/main/java/com/fr/design/designer/properties/mobile/ScanCodeMobilePropertyUI.java b/designer-form/src/main/java/com/fr/design/designer/properties/mobile/TextEditorMobilePropertyUI.java similarity index 65% rename from designer-form/src/main/java/com/fr/design/designer/properties/mobile/ScanCodeMobilePropertyUI.java rename to designer-form/src/main/java/com/fr/design/designer/properties/mobile/TextEditorMobilePropertyUI.java index 85011ee2b9..531e2c4fc8 100644 --- a/designer-form/src/main/java/com/fr/design/designer/properties/mobile/ScanCodeMobilePropertyUI.java +++ b/designer-form/src/main/java/com/fr/design/designer/properties/mobile/TextEditorMobilePropertyUI.java @@ -5,13 +5,20 @@ import com.fr.design.designer.creator.XTextEditor; import com.fr.design.dialog.BasicPane; import com.fr.design.fun.impl.AbstractWidgetPropertyUIProvider; import com.fr.design.gui.itable.AbstractPropertyTable; -import com.fr.design.widget.ui.designer.mobile.ScanCodeMobileDefinePane; +import com.fr.design.widget.ui.designer.mobile.TextEditorMobileDefinePane; -public class ScanCodeMobilePropertyUI extends AbstractWidgetPropertyUIProvider { +/** + * 文本控件 + * + * @author Coral.Chen + * @since 11.0 + * Created on 2023/3/30 + */ +public class TextEditorMobilePropertyUI extends AbstractWidgetPropertyUIProvider { private XCreator xCreator; - public ScanCodeMobilePropertyUI(XTextEditor xTextEditor) { + public TextEditorMobilePropertyUI(XTextEditor xTextEditor) { this.xCreator = xTextEditor; } @@ -22,7 +29,7 @@ public class ScanCodeMobilePropertyUI extends AbstractWidgetPropertyUIProvider { @Override public BasicPane createWidgetAttrPane() { - return new ScanCodeMobileDefinePane(xCreator); + return new TextEditorMobileDefinePane(xCreator); } @Override diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/actions/Jump2DetailAction.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/actions/Jump2DetailAction.java index 9df0313820..b4d546727b 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/actions/Jump2DetailAction.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/actions/Jump2DetailAction.java @@ -1,17 +1,11 @@ package com.fr.design.mainframe.share.ui.actions; -import com.fr.design.actions.UpdateAction; -import com.fr.design.gui.imenu.UIMenuItem; -import com.fr.design.gui.imenu.UIMenuItemUI; +import com.fr.design.i18n.LocaleLinkProvider; import com.fr.design.i18n.Toolkit; -import com.fr.design.mainframe.share.ui.constants.ColorConstants; import com.fr.design.mainframe.share.ui.online.CarouselStateManger; import com.fr.stable.StringUtils; import javax.swing.Action; -import javax.swing.BorderFactory; -import javax.swing.SwingConstants; -import java.awt.Color; import java.awt.Desktop; import java.awt.event.ActionEvent; import java.io.IOException; @@ -24,7 +18,18 @@ import java.net.URISyntaxException; * Created by Starryi on 2021/9/28 */ public class Jump2DetailAction extends SharedComponentPopupAction { - private static final String ONLINE_WIDGET_DETAIL_FORMATTED_URL = "https://market.fanruan.com/reuse/%s"; + + /** + * 云中心组件市场组件详情在配置文件中对应的配置文件key + */ + private static final String PROPS_LINK_KEY = "Fine-Design-CloudCenter_Market_Detail"; + + /** + * 云中心组件市场组件详情默认链接在配置文件中对应的配置文件key + */ + private static final String PROPS_LINK_KEY_DEFAULT = "Fine-Design-CloudCenter_Market_Detail_Default"; + + private static final String ONLINE_WIDGET_DETAIL_FORMATTED_URL = LocaleLinkProvider.getInstance().getLink(PROPS_LINK_KEY, PROPS_LINK_KEY_DEFAULT); private final String id; public Jump2DetailAction(String id) { diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/OnlineWidgetRepoPane.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/OnlineWidgetRepoPane.java index b4d3bcc68d..e7b60ce926 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/OnlineWidgetRepoPane.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/OnlineWidgetRepoPane.java @@ -2,35 +2,30 @@ package com.fr.design.mainframe.share.ui.online; import com.fr.base.BaseUtils; import com.fr.base.Style; -import com.fr.config.constant.Constant; import com.fr.design.dialog.BasicPane; import com.fr.design.form.util.FontTransformUtil; import com.fr.design.gui.ilable.UILabel; +import com.fr.design.i18n.LocaleLinkProvider; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.share.ui.base.LoadingPane; import com.fr.design.mainframe.share.ui.base.MouseClickListener; import com.fr.design.mainframe.share.ui.online.mini.MiniComponentShopDialog; import com.fr.design.mainframe.share.util.OnlineShopUtils; -import com.fr.design.mainframe.theme.edit.ui.LabelUtils; import com.fr.form.share.bean.OnlineShareWidget; import com.fr.general.FRFont; import com.fr.general.IOUtils; import com.fr.log.FineLoggerFactory; -import com.fr.stable.Constants; import com.fr.stable.StringUtils; import javax.swing.BorderFactory; -import javax.swing.BoxLayout; import javax.swing.JPanel; -import javax.swing.JTextArea; import javax.swing.JTextField; import javax.swing.SwingConstants; import javax.swing.SwingWorker; import java.awt.BorderLayout; import java.awt.CardLayout; import java.awt.Color; -import java.awt.Component; import java.awt.Cursor; import java.awt.Dimension; import java.awt.FlowLayout; @@ -47,7 +42,18 @@ import java.util.concurrent.ExecutionException; * Created by kerry on 2020-10-16 */ public class OnlineWidgetRepoPane extends BasicPane { - private static final String MARKET_URL = "https://market.fanruan.com/reuse"; + + /** + * 云中心组件市场在配置文件中对应的配置文件key + */ + private static final String PROPS_LINK_KEY = "Fine-Design-CloudCenter_Market"; + + /** + * 云中心组件市场默认链接在配置文件中对应的配置文件key + */ + private static final String PROPS_LINK_KEY_DEFAULT = "Fine-Design-CloudCenter_Market_Default"; + + private static final String MARKET_URL = LocaleLinkProvider.getInstance().getLink(PROPS_LINK_KEY, PROPS_LINK_KEY_DEFAULT); private static List[] sharableWidgets; private OnlineWidgetTabPane componentTabPane; private boolean isShowPackagePanel = false; diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/btn/AbstractExtraButtonPane.java b/designer-form/src/main/java/com/fr/design/widget/ui/btn/AbstractExtraButtonPane.java new file mode 100644 index 0000000000..67b8e4d26c --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/widget/ui/btn/AbstractExtraButtonPane.java @@ -0,0 +1,126 @@ +package com.fr.design.widget.ui.btn; + +import com.fr.design.ExtraDesignClassManager; +import com.fr.design.beans.BasicBeanPane; +import com.fr.design.dialog.BasicPane; +import com.fr.design.fun.WidgetAdvancedPaneProvider; +import com.fr.design.gui.icombobox.DictionaryComboBox; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.layout.TableLayout; +import com.fr.design.layout.TableLayoutHelper; +import com.fr.design.widget.btn.ButtonWithHotkeysDetailPane; +import com.fr.form.ui.Button; +import com.fr.general.GeneralContext; +import com.fr.plugin.observer.PluginEvent; +import com.fr.plugin.observer.PluginEventListener; +import org.jetbrains.annotations.Nullable; + +import javax.swing.JPanel; +import java.awt.Component; +import java.util.Set; + + + +/** + * 用来处理额外的按钮属性 + * + * @author John.Ying + * @since 11.0 + * Created on 2023/4/19 + */ +public abstract class AbstractExtraButtonPane extends ButtonWithHotkeysDetailPane { + protected JPanel extraPane; + protected boolean containsExtraPane; + protected static double F = TableLayout.FILL; + protected static double P = TableLayout.PREFERRED; + + protected void initExtraPane() { + initPluginListener(); + refreshExtraAdvancedPane(classType()); + } + + + /** + * 根据按钮类别判断需要返回什么类型的属性界面 + */ + protected void refreshExtraAdvancedPane(Class cls) { + extraPaneList.clear(); + boolean containsExtraPane = false; + Set> providers = ExtraDesignClassManager.getInstance().getArray(WidgetAdvancedPaneProvider.XML_TAG); + for (WidgetAdvancedPaneProvider provider : providers) { + if (!provider.accept(cls)) { + continue; + } + insertShortCut(provider.getInsertPosition(extraPaneList.size()), provider.createExtraAdvancedPane()); + containsExtraPane = true; + } + if (containsExtraPane) { + extraPane = FRGUIPaneFactory.createYBoxEmptyBorderPane(); + for (BasicBeanPane pane : extraPaneList) { + extraPane.add(pane); + } + } + this.containsExtraPane = containsExtraPane; + + } + + protected void initPluginListener() { + GeneralContext.listenPluginRunningChanged(new PluginEventListener() { + @Override + public void on(PluginEvent event) { + refreshExtraAdvancedPane(classType()); + } + }, pluginContext -> pluginContext.getRuntime().contain(WidgetAdvancedPaneProvider.XML_TAG)); + } + + /** + * 插入配置项面板 + * + * @param index 插入的位置 + * @param pane 配置项面板 + */ + protected void insertShortCut(int index, BasicBeanPane pane) { + int size = extraPaneList.size(); + index = Math.min(index, size); + extraPaneList.add(index, pane); + } + + @Override + public void populate(T button) { + super.populate(button); + for (BasicBeanPane pane : extraPaneList) { + pane.populateBean(button); + } + } + + @Override + public T update() { + T button = super.update(); + for (BasicBeanPane pane : extraPaneList) { + pane.updateBean(button); + } + return button; + } + + + @Override + protected DictionaryComboBox createCustomButtonTypeComboBox() { + return createButtonTypeComboBox(containsExtraPane); + } + + /** + * 生成额外的属性界面 + */ + protected Component createExtraPane(@Nullable BasicPane pane) { + initExtraPane(); + Component[][] components = new Component[][]{ + new Component[]{pane, null}, + new Component[]{extraPane, null} + }; + double[] rowSize = {P, P}; + double[] columnSize = {P, F}; + int[][] rowCount = {{1, 1},{1, 1}}; + return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 10, 7); + } + +} diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/btn/FormSubmitButtonDetailPane.java b/designer-form/src/main/java/com/fr/design/widget/ui/btn/FormSubmitButtonDetailPane.java index acc2e76c4e..77a735df54 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/btn/FormSubmitButtonDetailPane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/btn/FormSubmitButtonDetailPane.java @@ -1,22 +1,21 @@ package com.fr.design.widget.ui.btn; import com.fr.form.parameter.FormSubmitButton; -import com.fr.design.widget.btn.ButtonWithHotkeysDetailPane; import java.awt.*; /** - * Created by IntelliJ IDEA. - * Author : Richer - * Version: 6.5.6 - * Date : 11-11-15 - * Time : 下午6:25 + * 提交参数按钮 + * + * @author John.Ying + * @since 11.0 + * Created on 2023/4/19 */ -public class FormSubmitButtonDetailPane extends ButtonWithHotkeysDetailPane { +public class FormSubmitButtonDetailPane extends AbstractExtraButtonPane { @Override protected Component createCenterPane() { - return null; + return createExtraPane(null); } @Override @@ -37,4 +36,5 @@ public class FormSubmitButtonDetailPane extends ButtonWithHotkeysDetailPane
extends AbstractDataMod protected UITextField labelNameTextField; private final List> extraPaneList = new ArrayList<>(); private JPanel extraPane; + protected boolean containsExtraPane; public ButtonDefinePane(XCreator creator){ super(creator); @@ -63,7 +64,7 @@ public abstract class ButtonDefinePane extends AbstractDataMod private void refreshAdvancedPane() { extraPaneList.clear(); - boolean containsExtraPane = false; + containsExtraPane = false; Set> providers = ExtraDesignClassManager.getInstance().getArray(WidgetAdvancedPaneProvider.XML_TAG); for (WidgetAdvancedPaneProvider provider : providers) { if (!provider.accept(creator)) { diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/FreeButtonDefinePane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/FreeButtonDefinePane.java index 843f402f01..16a31b85ed 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/FreeButtonDefinePane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/FreeButtonDefinePane.java @@ -41,10 +41,13 @@ public class FreeButtonDefinePane extends ButtonDefinePane { } public void populateSubButtonPane(FreeButton e) { + if (containsExtraPane) { + return; + } backgroundCompPane.populate(e); frFontPane.setVisible(e.isCustomStyle()); fontLabel.setVisible(e.isCustomStyle()); - if(e.isCustomStyle()){ + if (e.isCustomStyle()) { FRFont frFont = e.getFont(); if (frFont != null) { frFontPane.populateBean(e.getFont()); @@ -54,12 +57,14 @@ public class FreeButtonDefinePane extends ButtonDefinePane { public FreeButton updateSubButtonPane() { FreeButton freeButton = (FreeButton) creator.toData(); - backgroundCompPane.update(freeButton); - frFontPane.setVisible(freeButton.isCustomStyle()); - fontLabel.setVisible(freeButton.isCustomStyle()); - if(freeButton.isCustomStyle()){ - FRFont frFont = freeButton.getFont() == null ? FRFont.getInstance() : freeButton.getFont(); - freeButton.setFont(frFontPane.update(frFont)); + if (!containsExtraPane) { + backgroundCompPane.update(freeButton); + frFontPane.setVisible(freeButton.isCustomStyle()); + fontLabel.setVisible(freeButton.isCustomStyle()); + if (freeButton.isCustomStyle()) { + FRFont frFont = freeButton.getFont() == null ? FRFont.getInstance() : freeButton.getFont(); + freeButton.setFont(frFontPane.update(frFont)); + } } return freeButton; } diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/BaseTextEditorMobileDefinePane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/BaseTextEditorMobileDefinePane.java new file mode 100644 index 0000000000..57faab6a72 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/BaseTextEditorMobileDefinePane.java @@ -0,0 +1,94 @@ +package com.fr.design.widget.ui.designer.mobile; + +import com.fr.design.designer.creator.XCreator; +import com.fr.design.foldablepane.UIExpandablePane; +import com.fr.design.gui.frpane.AttributeChangeListener; +import com.fr.design.i18n.Toolkit; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.mainframe.DesignerContext; +import com.fr.design.mainframe.FormDesigner; +import com.fr.design.widget.ui.designer.mobile.component.MobileTextEditSettingPane; +import com.fr.form.ui.TextEditor; + +import javax.swing.JPanel; +import java.awt.BorderLayout; +import java.awt.FlowLayout; + +/** + *

文本类组件移动端高级属性的定义面板,基础扩展可以直接继承此面板 + *

往内部添加其他配置 + * + * @author Coral.Chen + * @since 11.0 + * Created on 2023/3/30 + */ +public class BaseTextEditorMobileDefinePane extends MobileWidgetDefinePane { + + private XCreator xCreator; + protected MobileTextEditSettingPane textSettingPane; + + public BaseTextEditorMobileDefinePane(XCreator xCreator) { + this.xCreator = xCreator; + } + + @Override + public void initPropertyGroups(Object source) { + this.setLayout(FRGUIPaneFactory.createBorderLayout()); + JPanel container = FRGUIPaneFactory.createVerticalFlowLayout_Pane(true, FlowLayout.LEADING, 0, 5); + addPropertyPanesToContainer(container); + this.add(new UIExpandablePane(Toolkit.i18nText("Fine-Design_Report_Advanced"), 280, 20, container), BorderLayout.NORTH); + this.repaint(); + } + + /** + * 添加其他属性面板 + * + * @param container 展开容器 + */ + protected void addPropertyPanesToContainer(JPanel container) { + initSettingPane(container); + } + + /** + * 初始化文本类基础面板 + * + * @param container + */ + protected void initSettingPane(JPanel container) { + textSettingPane = new MobileTextEditSettingPane(); + container.add(textSettingPane); + } + + @Override + public void populate(FormDesigner designer) { + TextEditor textEditor = (TextEditor) xCreator.toData(); + textSettingPane.populateBean(textEditor.getMobileTextEditAttr()); + this.bindListeners2Widgets(); + } + + protected void bindListeners2Widgets() { + reInitAllListeners(); + AttributeChangeListener changeListener = new AttributeChangeListener() { + @Override + public void attributeChange() { + update(); + } + }; + this.addAttributeChangeListener(changeListener); + } + + private void reInitAllListeners() { + initListener(this); + } + + @Override + public void update() { + TextEditor textEditor = (TextEditor) xCreator.toData(); + textSettingPane.updateBean(textEditor.getMobileTextEditAttr()); + DesignerContext.getDesignerFrame().getSelectedJTemplate().fireTargetModified(); + } + + public XCreator getxCreator() { + return xCreator; + } +} \ No newline at end of file diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/NumberEditorMobileDefinePane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/NumberEditorMobileDefinePane.java new file mode 100644 index 0000000000..75c6dbefc0 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/NumberEditorMobileDefinePane.java @@ -0,0 +1,33 @@ +package com.fr.design.widget.ui.designer.mobile; + +import com.fr.design.designer.creator.XCreator; +import com.fr.design.mainframe.DesignerContext; +import com.fr.design.mainframe.FormDesigner; +import com.fr.form.ui.NumberEditor; + +/** + * 数字控件 + * + * @author Coral.Chen + * @since 11.0 + * Created on 2023/3/30 + */ +public class NumberEditorMobileDefinePane extends BaseTextEditorMobileDefinePane { + public NumberEditorMobileDefinePane(XCreator xCreator) { + super(xCreator); + } + + @Override + public void populate(FormDesigner designer) { + NumberEditor numberEditor = (NumberEditor) getxCreator().toData(); + textSettingPane.populateBean(numberEditor.getMobileTextEditAttr()); + this.bindListeners2Widgets(); + } + + @Override + public void update() { + NumberEditor numberEditor = (NumberEditor) getxCreator().toData(); + textSettingPane.updateBean(numberEditor.getMobileTextEditAttr()); + DesignerContext.getDesignerFrame().getSelectedJTemplate().fireTargetModified(); + } +} \ No newline at end of file diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/PasswordMobileDefinePane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/PasswordMobileDefinePane.java new file mode 100644 index 0000000000..68c878b459 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/PasswordMobileDefinePane.java @@ -0,0 +1,25 @@ +package com.fr.design.widget.ui.designer.mobile; + +import com.fr.design.designer.creator.XCreator; +import com.fr.design.widget.ui.designer.mobile.component.MobilePasswordEditSettingPane; + +import javax.swing.JPanel; + +/** + * 密码控件移动端高级属性 + * + * @author Coral.Chen + * @since 11.0 + * Created on 2023/3/30 + */ +public class PasswordMobileDefinePane extends BaseTextEditorMobileDefinePane { + public PasswordMobileDefinePane(XCreator xCreator) { + super(xCreator); + } + + @Override + protected void initSettingPane(JPanel container) { + textSettingPane = new MobilePasswordEditSettingPane(); + container.add(textSettingPane); + } +} \ No newline at end of file diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ScanCodeMobileDefinePane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ScanCodeMobileDefinePane.java deleted file mode 100644 index 71c35574a3..0000000000 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ScanCodeMobileDefinePane.java +++ /dev/null @@ -1,63 +0,0 @@ -package com.fr.design.widget.ui.designer.mobile; - -import com.fr.base.mobile.MobileScanCodeAttr; -import com.fr.design.designer.creator.XCreator; -import com.fr.design.foldablepane.UIExpandablePane; -import com.fr.design.gui.frpane.AttributeChangeListener; -import com.fr.design.i18n.Toolkit; -import com.fr.design.layout.FRGUIPaneFactory; -import com.fr.design.mainframe.DesignerContext; -import com.fr.design.mainframe.FormDesigner; -import com.fr.design.widget.ui.designer.mobile.component.MobileTextFieldInputSettingPane; -import com.fr.form.ui.TextEditor; - -import java.awt.BorderLayout; - - -public class ScanCodeMobileDefinePane extends MobileWidgetDefinePane { - - private XCreator xCreator; - private MobileTextFieldInputSettingPane settingPane; - - public ScanCodeMobileDefinePane(XCreator xCreator) { - this.xCreator = xCreator; - } - - @Override - public void initPropertyGroups(Object source) { - this.setLayout(FRGUIPaneFactory.createBorderLayout()); - settingPane = new MobileTextFieldInputSettingPane(); - this.add(new UIExpandablePane(Toolkit.i18nText("Fine-Design_Report_Advanced"), 280, 20, settingPane), BorderLayout.NORTH); - this.repaint(); - } - - private void bindListeners2Widgets() { - reInitAllListeners(); - AttributeChangeListener changeListener = new AttributeChangeListener() { - @Override - public void attributeChange() { - update(); - } - }; - this.addAttributeChangeListener(changeListener); - } - - private void reInitAllListeners() { - initListener(this); - } - - @Override - public void populate(FormDesigner designer) { - MobileScanCodeAttr mobileScanCodeAttr = ((TextEditor) xCreator.toData()).getMobileScanCodeAttr(); - settingPane.populateBean(mobileScanCodeAttr); - this.bindListeners2Widgets(); - } - - @Override - public void update() { - MobileScanCodeAttr mobileScanCodeAttr = ((TextEditor) xCreator.toData()).getMobileScanCodeAttr(); - settingPane.updateBean(mobileScanCodeAttr); - DesignerContext.getDesignerFrame().getSelectedJTemplate().fireTargetModified(); - } - -} diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/TextAreaAdvancedDefinePane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/TextAreaAdvancedDefinePane.java new file mode 100644 index 0000000000..ccc3194f9f --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/TextAreaAdvancedDefinePane.java @@ -0,0 +1,25 @@ +package com.fr.design.widget.ui.designer.mobile; + +import com.fr.design.designer.creator.XCreator; +import com.fr.design.widget.ui.designer.mobile.component.MobileTextAreaSettingPane; + +import javax.swing.JPanel; + +/** + * 文本域控件 + * + * @author Coral.Chen + * @since 11.0 + * Created on 2023/3/29 + */ +public class TextAreaAdvancedDefinePane extends BaseTextEditorMobileDefinePane { + public TextAreaAdvancedDefinePane(XCreator xCreator) { + super(xCreator); + } + + @Override + protected void initSettingPane(JPanel container) { + textSettingPane = new MobileTextAreaSettingPane(); + container.add(textSettingPane); + } +} \ No newline at end of file diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/TextEditorMobileDefinePane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/TextEditorMobileDefinePane.java new file mode 100644 index 0000000000..de006160dc --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/TextEditorMobileDefinePane.java @@ -0,0 +1,56 @@ +package com.fr.design.widget.ui.designer.mobile; + +import com.fr.design.designer.creator.XCreator; +import com.fr.design.mainframe.DesignerContext; +import com.fr.design.mainframe.FormDesigner; +import com.fr.design.widget.ui.designer.mobile.component.MobileTextEditSettingPane; +import com.fr.design.widget.ui.designer.mobile.component.MobileTextFieldInputSettingPane; +import com.fr.form.ui.TextEditor; + +import javax.swing.JPanel; + +/** + * 文本控件移动端属性 + * 输入方式: + * 输入框属性: + * + * @author hades + * @since 11.0 + * Created on 2018/11/27 + */ +public class TextEditorMobileDefinePane extends BaseTextEditorMobileDefinePane { + /** + * 输入方式 + */ + private MobileTextFieldInputSettingPane inputSettingPane; + + public TextEditorMobileDefinePane(XCreator xCreator) { + super(xCreator); + } + + @Override + protected void initSettingPane(JPanel container) { + inputSettingPane = new MobileTextFieldInputSettingPane(); + textSettingPane = new MobileTextEditSettingPane(); + container.add(inputSettingPane); + container.add(textSettingPane); + } + + + @Override + public void populate(FormDesigner designer) { + super.populate(designer); + TextEditor textEditor = (TextEditor) getxCreator().toData(); + inputSettingPane.populateBean(textEditor.getMobileScanCodeAttr()); + this.bindListeners2Widgets(); + } + + @Override + public void update() { + super.update(); + TextEditor textEditor = (TextEditor) getxCreator().toData(); + inputSettingPane.updateBean(textEditor.getMobileScanCodeAttr()); + DesignerContext.getDesignerFrame().getSelectedJTemplate().fireTargetModified(); + } + +} diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobilePasswordEditSettingPane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobilePasswordEditSettingPane.java new file mode 100644 index 0000000000..3cf5adccb1 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobilePasswordEditSettingPane.java @@ -0,0 +1,43 @@ +package com.fr.design.widget.ui.designer.mobile.component; + +import com.fr.base.mobile.MobileTextEditAttr; +import com.fr.design.gui.icheckbox.UICheckBox; +import com.fr.design.i18n.Toolkit; + +import java.awt.BorderLayout; + +/** + * 密码控件编辑属性设置面板 + * + * @author Coral.Chen + * @since 11.0 + * Created on 2023/3/30 + */ +public class MobilePasswordEditSettingPane extends MobileTextEditSettingPane { + // 显示密码 + private UICheckBox showPassword; + + public MobilePasswordEditSettingPane() { + super(); + showPassword = new UICheckBox(Toolkit.i18nText("Fine-Design_Mobile_Show_Password"), false); + this.add(showPassword, BorderLayout.NORTH); + } + + @Override + protected boolean getClearDefaultState() { + return true; + } + + @Override + public void populateBean(MobileTextEditAttr ob) { + super.populateBean(ob); + // 要兼容处理一下,为null 的话赋默认值,默认开启 + this.showPassword.setSelected(ob.isShowPassword() == null || ob.isShowPassword()); + } + + @Override + public void updateBean(MobileTextEditAttr ob) { + super.updateBean(ob); + ob.setShowPassword(showPassword.isSelected()); + } +} \ No newline at end of file diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileTextAreaSettingPane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileTextAreaSettingPane.java new file mode 100644 index 0000000000..d660508e6e --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileTextAreaSettingPane.java @@ -0,0 +1,38 @@ +package com.fr.design.widget.ui.designer.mobile.component; + +import com.fr.base.mobile.MobileTextEditAttr; +import com.fr.design.gui.icheckbox.UICheckBox; +import com.fr.design.i18n.Toolkit; + +import java.awt.BorderLayout; + +/** + * 文本域控件 + * + * @author Coral.Chen + * @since 11.0 + * Created on 2023/3/29 + */ +public class MobileTextAreaSettingPane extends MobileTextEditSettingPane { + // 显示字数统计 + private UICheckBox showWordCount; + + public MobileTextAreaSettingPane() { + super(); + showWordCount = new UICheckBox(Toolkit.i18nText("Fine-Design_Mobile_Show_Word_Count"), false); + this.add(showWordCount, BorderLayout.NORTH); + } + + @Override + public void populateBean(MobileTextEditAttr ob) { + super.populateBean(ob); + // 要兼容处理一下,为null 的话赋默认值,默认不开启 + this.showWordCount.setSelected(ob.isShowWordCount() != null && ob.isShowWordCount()); + } + + @Override + public void updateBean(MobileTextEditAttr ob) { + super.updateBean(ob); + ob.setShowWordCount(showWordCount.isSelected()); + } +} \ No newline at end of file diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileTextEditSettingPane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileTextEditSettingPane.java new file mode 100644 index 0000000000..56d340e4d0 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileTextEditSettingPane.java @@ -0,0 +1,59 @@ +package com.fr.design.widget.ui.designer.mobile.component; + +import com.fr.base.mobile.MobileTextEditAttr; +import com.fr.design.beans.BasicBeanPane; +import com.fr.design.gui.icheckbox.UICheckBox; +import com.fr.design.i18n.Toolkit; +import com.fr.design.layout.VerticalFlowLayout; + +import java.awt.BorderLayout; +import java.awt.FlowLayout; + +/** + * 文本类基础设置 + * + * @author Coral.Chen + * @since 11.0 + * Created on 2023/3/29 + */ +public class MobileTextEditSettingPane extends BasicBeanPane { + // 允许一键清空 + protected UICheckBox allowOneClickClear; + + public MobileTextEditSettingPane() { + initLayout(); + allowOneClickClear = new UICheckBox(Toolkit.i18nText("Fine-Design_Mobile_Allow_One_Click_Clear"), getClearDefaultState()); + this.add(allowOneClickClear, BorderLayout.NORTH); + } + + protected boolean getClearDefaultState() { + return false; + } + + protected void initLayout() { + VerticalFlowLayout verticalFlowLayout = new VerticalFlowLayout(FlowLayout.LEADING, 0, 5); + verticalFlowLayout.setAlignLeft(true); + this.setLayout(verticalFlowLayout); + } + + @Override + public void populateBean(MobileTextEditAttr ob) { + allowOneClickClear.setSelected(ob.isAllowOneClickClear() != null && ob.isAllowOneClickClear()); + } + + @Override + public MobileTextEditAttr updateBean() { + // do nothing + return null; + } + + @Override + public void updateBean(MobileTextEditAttr ob) { + ob.setAllowOneClickClear(allowOneClickClear.isSelected()); + } + + @Override + protected String title4PopupWindow() { + return null; + } +} \ No newline at end of file diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileTextFieldInputSettingPane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileTextFieldInputSettingPane.java index fb9daa30f3..b7661f9f04 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileTextFieldInputSettingPane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileTextFieldInputSettingPane.java @@ -2,16 +2,21 @@ package com.fr.design.widget.ui.designer.mobile.component; import com.fr.base.mobile.MobileScanCodeAttr; import com.fr.design.beans.BasicBeanPane; +import com.fr.design.constants.LayoutConstants; import com.fr.design.gui.ibutton.UIRadioButton; import com.fr.design.gui.icheckbox.UICheckBox; +import com.fr.design.gui.ilable.UILabel; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.layout.TableLayout; +import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.VerticalFlowLayout; import javax.swing.ButtonGroup; import javax.swing.JPanel; import java.awt.BorderLayout; -import java.awt.FlowLayout; +import java.awt.Component; +import java.awt.Dimension; /** * @author hades @@ -31,7 +36,6 @@ public class MobileTextFieldInputSettingPane extends BasicBeanPane"; diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellOtherSetPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellOtherSetPane.java index 9879ac53a4..5ac64d401a 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellOtherSetPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellOtherSetPane.java @@ -20,6 +20,7 @@ import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.VerticalFlowLayout; +import com.fr.design.locale.impl.DataMaskMark; import com.fr.design.mainframe.EastRegionContainerPane; import com.fr.design.mainframe.JTemplate; import com.fr.design.mainframe.cell.settingpane.desensitization.CellDesensitizationGroupsPane; @@ -28,6 +29,8 @@ import com.fr.design.utils.gui.UIComponentUtils; import com.fr.design.widget.FRWidgetFactory; import com.fr.general.ComparatorUtils; import com.fr.general.FRFont; +import com.fr.general.locale.LocaleCenter; +import com.fr.general.locale.LocaleMark; import com.fr.report.cell.TemplateCellElement; import com.fr.report.cell.cellattr.CellDesensitizationAttr; import com.fr.report.cell.cellattr.CellGUIAttr; @@ -156,10 +159,11 @@ public class CellOtherSetPane extends AbstractCellAttrPane { // 带超链的提示信息 UILabel label = new UILabel(); + LocaleMark dataMaskMark = LocaleCenter.getMark(DataMaskMark.class); MessageWithLink hyperlink = new MessageWithLink( Toolkit.i18nText("Fine-Design_Report_Desensitization_Tip"), Toolkit.i18nText("Fine-Design_Report_Desensitization_Hyperlink"), - Toolkit.i18nText("Fine-Design_Report_Desensitization_Help_Document_Url"), + dataMaskMark.getValue(), StringUtils.EMPTY, label.getBackground(), label.getFont(), diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java b/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java index d8f7265f7d..3ceef3ae28 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java @@ -7,6 +7,7 @@ import com.fr.design.dialog.FineJOptionPane; import com.fr.design.env.DesignerWorkspaceInfo; import com.fr.design.env.DesignerWorkspaceInfoContext; import com.fr.design.gui.ilable.UILabel; +import com.fr.design.i18n.LocaleLinkProvider; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.DesignerContext; @@ -17,7 +18,6 @@ import com.fr.design.mainframe.toast.ToastMsgDialog; import com.fr.design.ui.util.UIUtil; import com.fr.design.utils.BrowseUtils; import com.fr.event.EventDispatcher; -import com.fr.general.CloudCenter; import com.fr.log.FineLoggerFactory; import com.fr.serialization.SerializerHelper; import com.fr.stable.ArrayUtils; @@ -32,6 +32,7 @@ import com.fr.workspace.WorkContext; import com.fr.workspace.Workspace; import com.fr.workspace.base.WorkspaceConstants; import com.fr.workspace.connect.WorkspaceConnectionInfo; +import com.fr.workspace.engine.exception.WorkspaceConnectionException; import com.fr.workspace.server.socket.CustomLogEvent; import com.fr.workspace.server.socket.LogEventConverter; import io.socket.client.IO; @@ -58,7 +59,17 @@ public class DesignerSocketIO { Disconnecting } - private static final String WEBSOCKET_HELP_DOC = CloudCenter.getInstance().acquireUrlByKind("websocketConnect", "https://help.fanruan.com/finereport/doc-view-2512.html"); + /** + * 云中心特殊字符导出在配置文件中对应的配置文件key + */ + private static final String PROPS_LINK_KEY = "Fine-Design-CloudCenter_WebSocket"; + + /** + * 云中心特殊字符导出默认链接在配置文件中对应的配置文件key + */ + private static final String PROPS_LINK_KEY_DEFAULT = "Fine-Design-CloudCenter_WebSocket_Default"; + + private static final String WEBSOCKET_HELP_DOC = LocaleLinkProvider.getInstance().getLink(PROPS_LINK_KEY, PROPS_LINK_KEY_DEFAULT); private static final String HTTPS = "https"; private static final String HTTP = "http"; private static Socket socket = null; @@ -261,6 +272,11 @@ public class DesignerSocketIO { httpGet.setConfig(requestConfig); try { CloseableHttpResponse response = httpclient.execute(httpGet); + if (isErrorStatus(response.getStatusLine().getStatusCode())) { + //这边nginx做负载,服务器被kill掉,返回的是502,不会抛错,导致checkRPCConnect通过 + //针对500-600的错误码加个判断,其他类型的状态码暂不考虑,如果有遇到再处理,不然怕影响范围大 + throw new WorkspaceConnectionException("Response " + response.getStatusLine().toString()); + } } catch (Exception e) { FineLoggerFactory.getLogger().error(e, e.getMessage()); return false; @@ -268,6 +284,23 @@ public class DesignerSocketIO { return true; } + /** + * 错误状态码 + * 5xx(服务器错误)这些状态代码表示服务器在尝试处理请求时发生内部错误。 这些错误可能是服务器本身的错误,而不是请求出错。代码 说明 + * 500 (服务器内部错误) 服务器遇到错误,无法完成请求。 + * 501 (尚未实施) 服务器不具备完成请求的功能。 例如,服务器无法识别请求方法时可能会返回此代码。 + * 502 (错误网关) 服务器作为网关或代理,从上游服务器收到无效响应。 + * 503 (服务不可用) 服务器目前无法使用(由于超载或停机维护)。 通常,这只是暂时状态。 + * 504 (网关超时) 服务器作为网关或代理,但是没有及时从上游服务器收到请求。 + * 505 (HTTP 版本不受支持) 服务器不支持请求中所用的 HTTP 协议版本。 + * + * @param status 错误状态码 + * @return 是否是错误状态码 + */ + private static boolean isErrorStatus(int status) { + return status >= 500 && status <= 600; + } + //配置变更监听器 private static final Emitter.Listener modifyConfig = new Emitter.Listener() { @Override diff --git a/designer-realize/src/main/java/com/fr/design/report/ExportUniversalPane.java b/designer-realize/src/main/java/com/fr/design/report/ExportUniversalPane.java index 5fe52560dc..4da3b89e81 100644 --- a/designer-realize/src/main/java/com/fr/design/report/ExportUniversalPane.java +++ b/designer-realize/src/main/java/com/fr/design/report/ExportUniversalPane.java @@ -6,10 +6,10 @@ import com.fr.design.dialog.BasicPane; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.ilable.ActionLabel; import com.fr.design.gui.ilable.UILabel; +import com.fr.design.i18n.LocaleLinkProvider; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.utils.BrowseUtils; -import com.fr.general.CloudCenter; import com.fr.io.attr.ReportExportAttr; import com.fr.transaction.Configurations; import com.fr.transaction.WorkerFacade; @@ -30,7 +30,17 @@ import java.awt.event.ActionListener; */ public class ExportUniversalPane extends BasicPane { - private static final String HELP_URL = CloudCenter.getInstance().acquireUrlByKind("help.alt_font.zh_CN", "https://help.fanruan.com/finereport/doc-view-4707.html"); + /** + * 云中心特殊字符导出在配置文件中对应的配置文件key + */ + private static final String PROPS_LINK_KEY = "Fine-Design-CloudCenter_Alt_Font_Export"; + + /** + * 云中心特殊字符导出默认链接在配置文件中对应的配置文件key + */ + private static final String PROPS_LINK_KEY_DEFAULT = "Fine-Design-CloudCenter_Alt_Font_Export_Default"; + + private static final String HELP_URL = LocaleLinkProvider.getInstance().getLink(PROPS_LINK_KEY, PROPS_LINK_KEY_DEFAULT); private UICheckBox specialCharacterExport; // 密码支持公式 diff --git a/designer-realize/src/main/java/com/fr/design/report/ReportEnginePane.java b/designer-realize/src/main/java/com/fr/design/report/ReportEnginePane.java index 15dd2a3ea3..380809faf0 100644 --- a/designer-realize/src/main/java/com/fr/design/report/ReportEnginePane.java +++ b/designer-realize/src/main/java/com/fr/design/report/ReportEnginePane.java @@ -11,14 +11,15 @@ import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; +import com.fr.design.locale.impl.LineEngineMark; import com.fr.design.mainframe.DesignerContext; import com.fr.design.widget.FRWidgetFactory; -import com.fr.general.SiteCenter; +import com.fr.general.locale.LocaleCenter; +import com.fr.general.locale.LocaleMark; import com.fr.log.FineLoggerFactory; import com.fr.report.core.ReportUtils; import com.fr.report.stable.LayerReportAttr; import com.fr.report.worksheet.WorkSheet; -import com.fr.stable.ProductConstants; import javax.swing.AbstractButton; import javax.swing.BorderFactory; @@ -203,7 +204,8 @@ public class ReportEnginePane extends BasicBeanPane { @Override public void mouseClicked(MouseEvent e) { try { - Desktop.getDesktop().browse(new URI(SiteCenter.getInstance().acquireUrlByKind("standard.doc", ProductConstants.WEBSITE_URL))); + LocaleMark lineEngineMark = LocaleCenter.getMark(LineEngineMark.class); + Desktop.getDesktop().browse(new URI(lineEngineMark.getValue())); } catch (IOException | URISyntaxException ex) { FineLoggerFactory.getLogger().error("io exception or not find website", ex); } diff --git a/designer-realize/src/main/java/com/fr/design/widget/WidgetMobilePaneFactory.java b/designer-realize/src/main/java/com/fr/design/widget/WidgetMobilePaneFactory.java index 86eba335d9..eef3477c97 100644 --- a/designer-realize/src/main/java/com/fr/design/widget/WidgetMobilePaneFactory.java +++ b/designer-realize/src/main/java/com/fr/design/widget/WidgetMobilePaneFactory.java @@ -4,8 +4,14 @@ import com.fr.design.ExtraDesignClassManager; import com.fr.design.fun.CellWidgetOptionProvider; import com.fr.design.widget.mobile.WidgetMobilePane; import com.fr.design.widget.ui.mobile.MultiFileEditorMobilePane; -import com.fr.design.widget.ui.mobile.ScanCodeMobilePane; +import com.fr.design.widget.ui.mobile.NumberEditorMobilePane; +import com.fr.design.widget.ui.mobile.PasswordMobilePane; +import com.fr.design.widget.ui.mobile.TextAreaMobilePane; +import com.fr.design.widget.ui.mobile.TextEditorMobilePane; import com.fr.form.ui.MultiFileEditor; +import com.fr.form.ui.NumberEditor; +import com.fr.form.ui.Password; +import com.fr.form.ui.TextArea; import com.fr.form.ui.TextEditor; import com.fr.form.ui.Widget; import com.fr.general.GeneralContext; @@ -28,7 +34,10 @@ public class WidgetMobilePaneFactory { static { mobilePaneMap.put(MultiFileEditor.class, MultiFileEditorMobilePane.class); - mobilePaneMap.put(TextEditor.class, ScanCodeMobilePane.class); + mobilePaneMap.put(TextEditor.class, TextEditorMobilePane.class); + mobilePaneMap.put(TextArea.class, TextAreaMobilePane.class); + mobilePaneMap.put(NumberEditor.class, NumberEditorMobilePane.class); + mobilePaneMap.put(Password.class, PasswordMobilePane.class); mobilePluginPaneMap.putAll(ExtraDesignClassManager.getInstance().getCellWidgetMobileOptionsMap()); GeneralContext.listenPluginRunningChanged(new PluginEventListener() { diff --git a/designer-realize/src/main/java/com/fr/design/widget/ui/btn/AppendRowButtonDefinePane.java b/designer-realize/src/main/java/com/fr/design/widget/ui/btn/AppendRowButtonDefinePane.java index dbf650b7e4..981295a1ee 100644 --- a/designer-realize/src/main/java/com/fr/design/widget/ui/btn/AppendRowButtonDefinePane.java +++ b/designer-realize/src/main/java/com/fr/design/widget/ui/btn/AppendRowButtonDefinePane.java @@ -2,19 +2,23 @@ package com.fr.design.widget.ui.btn; import com.fr.base.IconManager; + + + import com.fr.report.web.button.write.AppendRowButton; -import com.fr.design.widget.btn.ButtonWithHotkeysDetailPane; + import java.awt.*; + /** - * Created by IntelliJ IDEA. - * Author : Richer - * Version: 6.5.6 - * Date : 11-11-15 - * Time : 下午8:02 + * 插入行按钮 + * + * @author John.Ying + * @since 11.0 + * Created on 2023/4/19 */ -public class AppendRowButtonDefinePane extends ButtonWithHotkeysDetailPane { +public class AppendRowButtonDefinePane extends AbstractExtraButtonPane { private DefineAppendColumnRowPane defineColumnRowPane; // @Override @@ -26,7 +30,8 @@ public class AppendRowButtonDefinePane extends Button @Override protected Component createCenterPane() { - return defineColumnRowPane = new DefineAppendColumnRowPane(); + defineColumnRowPane = new DefineAppendColumnRowPane(); + return createExtraPane(defineColumnRowPane); } @Override @@ -55,4 +60,5 @@ public class AppendRowButtonDefinePane extends Button public Class classType() { return AppendRowButton.class; } + } diff --git a/designer-realize/src/main/java/com/fr/design/widget/ui/btn/DefaultButtonDetailPane.java b/designer-realize/src/main/java/com/fr/design/widget/ui/btn/DefaultButtonDetailPane.java index e7f621ccb4..84239e9048 100644 --- a/designer-realize/src/main/java/com/fr/design/widget/ui/btn/DefaultButtonDetailPane.java +++ b/designer-realize/src/main/java/com/fr/design/widget/ui/btn/DefaultButtonDetailPane.java @@ -1,20 +1,25 @@ package com.fr.design.widget.ui.btn; + import com.fr.form.ui.Button; import com.fr.form.ui.FreeButton; -import com.fr.design.widget.btn.ButtonWithHotkeysDetailPane; + import java.awt.*; + /** - * Created by IntelliJ IDEA. Author : Richer Version: 6.5.6 Date : 11-11-15 Time - * : 下午6:24 + * 普通按钮 + * + * @author John.Ying + * @since 11.0 + * Created on 2023/4/19 */ -public class DefaultButtonDetailPane extends ButtonWithHotkeysDetailPane