From c8474323c481fa73cbe5e2b2473a7912b4f6123c Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Mon, 11 Jan 2021 10:38:25 +0800 Subject: [PATCH 1/4] =?UTF-8?q?REPORT-46234=20=E6=99=AE=E9=80=9A=E6=8A=A5?= =?UTF-8?q?=E8=A1=A8\=E8=81=9A=E5=90=88=E6=8A=A5=E8=A1=A8=EF=BC=8C?= =?UTF-8?q?=E7=82=B9=E5=87=BBpara=EF=BC=8C=E4=B8=8A=E6=96=B9=E6=98=AF?= =?UTF-8?q?=E6=8E=A7=E4=BB=B6=E8=AE=BE=E7=BD=AE=EF=BC=8C=E4=BD=86=E6=98=AF?= =?UTF-8?q?=E4=B8=8B=E6=96=B9=E6=98=AF=E7=BB=84=E4=BB=B6=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/EastRegionContainerPane.java | 17 ++++++------- .../ui/WidgetBasicPropertyPaneFactory.java | 24 +++++++++++++++---- 2 files changed, 29 insertions(+), 12 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java b/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java index 66a77e1c2d..8827d6a857 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java @@ -99,7 +99,8 @@ public class EastRegionContainerPane extends UIEastResizableContainer { public enum PropertyMode { REPORT, // 报表 - REPORT_PARA, // 报表参数面板 + REPORT_PARA_WIDGET, //报表参数面板中的控件 + REPORT_PARA(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Component_Settings")), // 报表参数面板 REPORT_FLOAT, // 报表悬浮元素 FORM(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Component_Settings")), // 表单 FORM_REPORT, // 表单报表块 @@ -272,27 +273,27 @@ public class EastRegionContainerPane extends UIEastResizableContainer { propertyItemMap = new LinkedHashMap<>(); // 有序map // 单元格元素 PropertyItem cellElement = new PropertyItem(KEY_CELL_ELEMENT, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Cell_Element"), - "cellelement", new PropertyMode[]{PropertyMode.REPORT, PropertyMode.REPORT_PARA, PropertyMode.REPORT_FLOAT, PropertyMode.POLY, PropertyMode.POLY_CHART}, + "cellelement", new PropertyMode[]{PropertyMode.REPORT, PropertyMode.REPORT_PARA, PropertyMode.REPORT_PARA_WIDGET, PropertyMode.REPORT_FLOAT, PropertyMode.POLY, PropertyMode.POLY_CHART}, new PropertyMode[]{PropertyMode.REPORT, PropertyMode.FORM_REPORT, PropertyMode.POLY_REPORT}); // 单元格属性 PropertyItem cellAttr = new PropertyItem(KEY_CELL_ATTR, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Cell_Attributes"), - "cellattr", new PropertyMode[]{PropertyMode.REPORT, PropertyMode.REPORT_PARA, PropertyMode.REPORT_FLOAT, PropertyMode.POLY, PropertyMode.POLY_CHART}, + "cellattr", new PropertyMode[]{PropertyMode.REPORT, PropertyMode.REPORT_PARA, PropertyMode.REPORT_PARA_WIDGET, PropertyMode.REPORT_FLOAT, PropertyMode.POLY, PropertyMode.POLY_CHART}, new PropertyMode[]{PropertyMode.REPORT, PropertyMode.FORM_REPORT, PropertyMode.POLY_REPORT}); // 悬浮元素 PropertyItem floatElement = new PropertyItem(KEY_FLOAT_ELEMENT, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Float_Element"), - "floatelement", new PropertyMode[]{PropertyMode.REPORT, PropertyMode.REPORT_PARA, PropertyMode.REPORT_FLOAT, PropertyMode.POLY, PropertyMode.POLY_CHART}, + "floatelement", new PropertyMode[]{PropertyMode.REPORT, PropertyMode.REPORT_PARA, PropertyMode.REPORT_PARA_WIDGET, PropertyMode.REPORT_FLOAT, PropertyMode.POLY, PropertyMode.POLY_CHART}, new PropertyMode[]{PropertyMode.REPORT, PropertyMode.REPORT_FLOAT, PropertyMode.POLY_REPORT}); // 控件设置 PropertyItem widgetSettings = new PropertyItem(KEY_WIDGET_SETTINGS, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Component_Settings"), - "widgetsettings", new PropertyMode[]{PropertyMode.REPORT, PropertyMode.REPORT_PARA, PropertyMode.REPORT_FLOAT, PropertyMode.FORM, PropertyMode.POLY}, - new PropertyMode[]{PropertyMode.REPORT, PropertyMode.REPORT_PARA, PropertyMode.FORM, PropertyMode.POLY_REPORT, PropertyMode.POLY_CHART}); + "widgetsettings", new PropertyMode[]{PropertyMode.REPORT, PropertyMode.REPORT_PARA, PropertyMode.REPORT_PARA_WIDGET, PropertyMode.REPORT_FLOAT, PropertyMode.FORM, PropertyMode.POLY}, + new PropertyMode[]{PropertyMode.REPORT, PropertyMode.REPORT_PARA, PropertyMode.REPORT_PARA_WIDGET, PropertyMode.FORM, PropertyMode.POLY_REPORT, PropertyMode.POLY_CHART}); // 条件属性 PropertyItem conditionAttr = new PropertyItem(KEY_CONDITION_ATTR, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Condition_Attributes"), - "conditionattr", new PropertyMode[]{PropertyMode.REPORT, PropertyMode.REPORT_PARA, PropertyMode.REPORT_FLOAT, PropertyMode.POLY, PropertyMode.POLY_CHART}, + "conditionattr", new PropertyMode[]{PropertyMode.REPORT, PropertyMode.REPORT_PARA, PropertyMode.REPORT_PARA_WIDGET, PropertyMode.REPORT_FLOAT, PropertyMode.POLY, PropertyMode.POLY_CHART}, new PropertyMode[]{PropertyMode.REPORT, PropertyMode.FORM_REPORT, PropertyMode.POLY_REPORT}); // 超级链接 PropertyItem hyperlink = new PropertyItem(KEY_HYPERLINK, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Hyperlink"), - "hyperlink", new PropertyMode[]{PropertyMode.REPORT, PropertyMode.REPORT_PARA, PropertyMode.REPORT_FLOAT, PropertyMode.POLY, PropertyMode.POLY_CHART}, + "hyperlink", new PropertyMode[]{PropertyMode.REPORT, PropertyMode.REPORT_PARA, PropertyMode.REPORT_PARA_WIDGET, PropertyMode.REPORT_FLOAT, PropertyMode.POLY, PropertyMode.POLY_CHART}, new PropertyMode[]{PropertyMode.REPORT, PropertyMode.REPORT_FLOAT, PropertyMode.FORM_REPORT, PropertyMode.POLY_REPORT}); // 组件库 PropertyItem widgetLib = new PropertyItem(KEY_WIDGET_LIB, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Library"), diff --git a/designer-form/src/main/java/com/fr/design/mainframe/widget/ui/WidgetBasicPropertyPaneFactory.java b/designer-form/src/main/java/com/fr/design/mainframe/widget/ui/WidgetBasicPropertyPaneFactory.java index db98069094..a3a34a0619 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/widget/ui/WidgetBasicPropertyPaneFactory.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/widget/ui/WidgetBasicPropertyPaneFactory.java @@ -1,21 +1,37 @@ package com.fr.design.mainframe.widget.ui; import com.fr.design.designer.creator.XCreator; +import com.fr.design.designer.creator.XWParameterLayout; +import com.fr.design.file.HistoryTemplateListCache; +import com.fr.design.mainframe.EastRegionContainerPane; +import com.fr.design.mainframe.JForm; /** * Created by kerry on 2017/9/30. */ public class WidgetBasicPropertyPaneFactory { - public static FormBasicPropertyPane createBasicPropertyPane(XCreator xCreator){ - if(xCreator.supportSetVisible() && xCreator.supportSetEnable()){ + public static FormBasicPropertyPane createBasicPropertyPane(XCreator xCreator) { + freshPropertyMode(xCreator); + if (xCreator.supportSetVisible() && xCreator.supportSetEnable()) { return new FormBasicWidgetPropertyPane(); } - if(xCreator.supportSetVisible()){ + if (xCreator.supportSetVisible()) { return new BasicSetVisiblePropertyPane(); - }else{ + } else { return new FormBasicPropertyPane(); } } + + private static void freshPropertyMode(XCreator xCreator) { + if (!(HistoryTemplateListCache.getInstance().getCurrentEditingTemplate() instanceof JForm)) { + if (xCreator instanceof XWParameterLayout) { + EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.REPORT_PARA); + } else { + EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.REPORT_PARA_WIDGET); + } + } + } + } From 3d1027a73070f9fedff785f80c369e8ee47ff525 Mon Sep 17 00:00:00 2001 From: Yvan Date: Mon, 11 Jan 2021 11:38:11 +0800 Subject: [PATCH 2/4] =?UTF-8?q?REPORT-46679=20jdk11-=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E5=86=85=E5=9B=BE=E6=A0=87=E4=BC=98=E5=8C=96-?= =?UTF-8?q?=E7=9B=AE=E5=BD=95=E6=A0=91=E5=9B=BE=E6=A0=87=E9=83=BD=E6=A8=A1?= =?UTF-8?q?=E7=B3=8A=EF=BC=8C=E5=B0=A4=E5=85=B6=E6=98=AF=E5=88=B7=E6=96=B0?= =?UTF-8?q?=E5=9B=BE=E6=A0=87=20=E3=80=90=E9=97=AE=E9=A2=98=E5=8E=9F?= =?UTF-8?q?=E5=9B=A0=E3=80=91svg=E5=9B=BE=E6=A0=87=E6=BC=8F=E4=BC=A0?= =?UTF-8?q?=E5=88=B0release=E5=88=86=E6=94=AF=E4=BA=86=EF=BC=8C=E6=89=80?= =?UTF-8?q?=E4=BB=A5=E6=98=BE=E7=A4=BA=E7=9A=84=E6=98=AF=E4=B9=8B=E5=89=8D?= =?UTF-8?q?=E7=9A=84png=E5=9B=BE=EF=BC=8C=E6=AF=94=E8=BE=83=E6=A8=A1?= =?UTF-8?q?=E7=B3=8A=20=E3=80=90=E6=94=B9=E5=8A=A8=E6=80=9D=E8=B7=AF?= =?UTF-8?q?=E3=80=91=E8=A1=A5=E5=85=85=E5=9B=BE=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../images/FileDealerPaneIcon/new_folder_disabled.svg | 8 ++++++++ .../images/FileDealerPaneIcon/new_folder_normal.svg | 8 ++++++++ .../design/images/FileDealerPaneIcon/refresh_normal.svg | 7 +++++++ .../design/images/FileDealerPaneIcon/remove_disabled.svg | 7 +++++++ .../fr/design/images/FileDealerPaneIcon/remove_normal.svg | 7 +++++++ .../design/images/FileDealerPaneIcon/rename_disabled.svg | 7 +++++++ .../fr/design/images/FileDealerPaneIcon/rename_normal.svg | 7 +++++++ .../images/FileDealerPaneIcon/vcs_list_disabled.svg | 7 +++++++ .../design/images/FileDealerPaneIcon/vcs_list_normal.svg | 7 +++++++ .../images/FileDealerPaneIcon/view_folder_disabled.svg | 7 +++++++ .../images/FileDealerPaneIcon/view_folder_normal.svg | 7 +++++++ 11 files changed, 79 insertions(+) create mode 100644 designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/new_folder_disabled.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/new_folder_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/refresh_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/remove_disabled.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/remove_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/rename_disabled.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/rename_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/vcs_list_disabled.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/vcs_list_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/view_folder_disabled.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/view_folder_normal.svg diff --git a/designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/new_folder_disabled.svg b/designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/new_folder_disabled.svg new file mode 100644 index 0000000000..f3936e1539 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/new_folder_disabled.svg @@ -0,0 +1,8 @@ + + + icon_NewFolderIcon_disable + + + + + \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/new_folder_normal.svg b/designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/new_folder_normal.svg new file mode 100644 index 0000000000..85f41e26a7 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/new_folder_normal.svg @@ -0,0 +1,8 @@ + + + icon_NewFolderIcon_normal + + + + + \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/refresh_normal.svg b/designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/refresh_normal.svg new file mode 100644 index 0000000000..4e3fd9c147 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/refresh_normal.svg @@ -0,0 +1,7 @@ + + + icon_刷新_normal + + + + \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/remove_disabled.svg b/designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/remove_disabled.svg new file mode 100644 index 0000000000..1245fbd4e3 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/remove_disabled.svg @@ -0,0 +1,7 @@ + + + icon_删除_disabled + + + + \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/remove_normal.svg b/designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/remove_normal.svg new file mode 100644 index 0000000000..69a3011faf --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/remove_normal.svg @@ -0,0 +1,7 @@ + + + icon_删除_normal copy + + + + \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/rename_disabled.svg b/designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/rename_disabled.svg new file mode 100644 index 0000000000..953e12eaa9 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/rename_disabled.svg @@ -0,0 +1,7 @@ + + + icon_重命名_disable + + + + \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/rename_normal.svg b/designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/rename_normal.svg new file mode 100644 index 0000000000..a2c287789d --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/rename_normal.svg @@ -0,0 +1,7 @@ + + + icon_重命名_normal + + + + \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/vcs_list_disabled.svg b/designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/vcs_list_disabled.svg new file mode 100644 index 0000000000..b88ee0998e --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/vcs_list_disabled.svg @@ -0,0 +1,7 @@ + + + icon_版本管理_disabled + + + + \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/vcs_list_normal.svg b/designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/vcs_list_normal.svg new file mode 100644 index 0000000000..ebfca43899 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/vcs_list_normal.svg @@ -0,0 +1,7 @@ + + + icon_版本管理_normal + + + + \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/view_folder_disabled.svg b/designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/view_folder_disabled.svg new file mode 100644 index 0000000000..376d372d41 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/view_folder_disabled.svg @@ -0,0 +1,7 @@ + + + icon_打开文件_disable + + + + \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/view_folder_normal.svg b/designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/view_folder_normal.svg new file mode 100644 index 0000000000..42ae6cbd3d --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/view_folder_normal.svg @@ -0,0 +1,7 @@ + + + icon_所在文件夹_normal + + + + \ No newline at end of file From 4550d21f02c908e05311ef399e443a8cd15b072d Mon Sep 17 00:00:00 2001 From: hades Date: Mon, 11 Jan 2021 14:20:29 +0800 Subject: [PATCH 3/4] =?UTF-8?q?REPORT-45689=20=E5=85=BC=E5=AE=B9=E7=A9=BA?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=20=E6=97=A0=E9=A1=BB=E5=A1=AB=E5=85=85?= =?UTF-8?q?=E9=9D=A2=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/mainframe/mobile/ui/MobileParamSettingPane.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileParamSettingPane.java b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileParamSettingPane.java index d2a358c192..7f1d270af5 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileParamSettingPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileParamSettingPane.java @@ -12,6 +12,7 @@ import com.fr.form.ui.mobile.MobileParamStyle; import com.fr.general.ComparatorUtils; import com.fr.report.ExtraReportClassManager; import com.fr.report.fun.MobileParamStyleProvider; +import com.fr.report.mobile.EmptyMobileParamStyle; import java.awt.BorderLayout; import java.awt.CardLayout; import java.awt.Component; @@ -103,7 +104,10 @@ public class MobileParamSettingPane extends BasicPane { if (ComparatorUtils.equals(mobileParamStyle.disPlayName(), provider.displayName())) { String displayName = provider.displayName(); paramStyleList.setSelectedIndex(i); - map.get(displayName).populateBean(mobileParamStyle); + // 如果是兼容空类型 无须填充面板 + if (!(mobileParamStyle instanceof EmptyMobileParamStyle)) { + map.get(displayName).populateBean(mobileParamStyle); + } card.show(right, displayName); return; } From 22a581c1089ce1ac5ae785033f417ebaaf19a5fd Mon Sep 17 00:00:00 2001 From: lucian Date: Mon, 11 Jan 2021 17:28:17 +0800 Subject: [PATCH 4/4] REPORT-46574 & REPORT-46813 & REPORT-46550 --- .../java/com/fr/design/EnvChangeEntrance.java | 7 ++- .../com/fr/env/PluginErrorRemindDialog.java | 44 +++++++++------ .../warnings/icon_WarningIcon_normal.png | Bin 0 -> 1365 bytes .../warnings/icon_WarningIcon_normal@2x.png | Bin 0 -> 2762 bytes .../com/fr/design/EnvChangeEntranceTest.java | 26 +++++---- .../module/DesignerWorkspaceProvider.java | 11 +++- .../module/DesignerWorkspaceProviderTest.java | 50 ++++++++++++++++++ 7 files changed, 107 insertions(+), 31 deletions(-) create mode 100644 designer-base/src/main/resources/com/fr/design/images/warnings/icon_WarningIcon_normal.png create mode 100644 designer-base/src/main/resources/com/fr/design/images/warnings/icon_WarningIcon_normal@2x.png create mode 100644 designer-realize/src/test/java/com/fr/start/module/DesignerWorkspaceProviderTest.java diff --git a/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java b/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java index ed67299f6d..3e2b30fee2 100644 --- a/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java +++ b/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java @@ -146,7 +146,7 @@ public class EnvChangeEntrance { template.refreshToolArea(); } showServiceDialog(selectedEnv); - pluginErrorRemind(selectedEnv); + pluginErrorRemind(); } catch (WorkspaceAuthException | RegistEditionException e) { // String title = Toolkit.i18nText("Fine-Design_Basic_Remote_Connect_Auth_Failed"); // String title = Toolkit.i18nText("Fine-Design_Basic_Lic_Does_Not_Support_Remote"); @@ -302,10 +302,9 @@ public class EnvChangeEntrance { /** * 插件启动错误信息提示 - * @param selectedEnv 选择的工作环境 */ - public void pluginErrorRemind(DesignerWorkspaceInfo selectedEnv) { - if (selectedEnv.getType() == DesignerWorkspaceType.Remote) { + public void pluginErrorRemind() { + if (!WorkContext.getCurrent().isLocal()) { return; } diff --git a/designer-base/src/main/java/com/fr/env/PluginErrorRemindDialog.java b/designer-base/src/main/java/com/fr/env/PluginErrorRemindDialog.java index 3654cca2d9..42dae0fa19 100644 --- a/designer-base/src/main/java/com/fr/env/PluginErrorRemindDialog.java +++ b/designer-base/src/main/java/com/fr/env/PluginErrorRemindDialog.java @@ -6,7 +6,6 @@ import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.FRFont; -import com.fr.general.GeneralContext; import com.fr.general.IOUtils; import javax.swing.BorderFactory; @@ -14,52 +13,65 @@ import javax.swing.Icon; import javax.swing.JDialog; import javax.swing.JLabel; import javax.swing.JPanel; -import javax.swing.JTextArea; +import javax.swing.JTextPane; +import javax.swing.text.SimpleAttributeSet; +import javax.swing.text.StyleConstants; import java.awt.BorderLayout; import java.awt.Dimension; import java.awt.FlowLayout; import java.awt.Frame; +import java.awt.Insets; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; -import java.util.Locale; /** * 插件启动失败提示窗 */ public class PluginErrorRemindDialog extends JDialog implements ActionListener { - public PluginErrorRemindDialog(Frame parent, String areaText) { + private static final String SIM_HEI = "SimHei"; + + public PluginErrorRemindDialog(Frame parent, String text) { super(parent, true); //上面的标签面板 JPanel topPanel = FRGUIPaneFactory.createBorderLayout_L_Pane(); JPanel imagePanel = new JPanel(); - Icon icon = IOUtils.readIcon("com/fr/design/images/warnings/warning5.png"); + Icon icon = IOUtils.readIcon("com/fr/design/images/warnings/icon_WarningIcon_normal.png"); JLabel imageLabel = new JLabel(); imageLabel.setIcon(icon); imagePanel.add(imageLabel); - imagePanel.setPreferredSize(new Dimension(130, 100)); + imagePanel.setPreferredSize(new Dimension(48, 48)); JPanel verticalPanel = FRGUIPaneFactory.createVerticalFlowLayout_S_Pane(true); JLabel label = new JLabel(Toolkit.i18nText("Fine-Design_Plugin_Error_Remind_Title")); - label.setFont(FRFont.getInstance().applySize(18).applyStyle(1)); - label.setPreferredSize(new Dimension(650, 100)); + label.setFont(FRFont.getInstance().applySize(16).applyName(SIM_HEI)); + label.setBorder(BorderFactory.createEmptyBorder(0, 20, 0, 20)); verticalPanel.add(label); topPanel.add(imagePanel, BorderLayout.WEST); topPanel.add(verticalPanel, BorderLayout.CENTER); - topPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 0, 10)); + topPanel.setPreferredSize(new Dimension(600, 73)); + topPanel.setBorder(BorderFactory.createEmptyBorder(10, 20, 0, 20)); //中间的文本域面板 JPanel centerPanel = FRGUIPaneFactory.createBorderLayout_L_Pane(); - centerPanel.setBorder(BorderFactory.createEmptyBorder(0, 10, 10, 10)); - centerPanel.setPreferredSize(new Dimension(480, 320)); + centerPanel.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 10)); + centerPanel.setPreferredSize(new Dimension(580, 269)); + + JTextPane textPane = new JTextPane(); + + SimpleAttributeSet attributeSet = new SimpleAttributeSet(); + StyleConstants.setFontFamily(attributeSet, SIM_HEI); + StyleConstants.setLineSpacing(attributeSet, 0.5f); + textPane.setParagraphAttributes(attributeSet, true); - JTextArea checkArea = new JTextArea(areaText); - checkArea.setEnabled(false); - centerPanel.add(checkArea, BorderLayout.CENTER); + textPane.setEditable(false); + textPane.setMargin(new Insets(10, 10, 10, 10)); + textPane.setText(text); + centerPanel.add(textPane, BorderLayout.CENTER); UIButton cancelButton = new UIButton(Toolkit.i18nText("Fine-Design_Plugin_Error_Remind_Not_Deal_With")); UIButton okButton = new UIButton(Toolkit.i18nText("Fine-Design_Plugin_Error_Remind_Deal_With")); @@ -69,7 +81,7 @@ public class PluginErrorRemindDialog extends JDialog implements ActionListener { // 按钮 JPanel buttonPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT)); - buttonPanel.setBorder(BorderFactory.createEmptyBorder(0, 10, 10, 10)); + buttonPanel.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 10)); buttonPanel.add(cancelButton); buttonPanel.add(okButton); @@ -80,7 +92,7 @@ public class PluginErrorRemindDialog extends JDialog implements ActionListener { this.add(topPanel, BorderLayout.NORTH); this.add(centerPanel, BorderLayout.CENTER); this.add(buttonPanel, BorderLayout.SOUTH); - this.setSize(new Dimension(GeneralContext.getLocale().equals(Locale.US) ? 750 : 600, 500)); + this.setSize(new Dimension(600, 400)); GUICoreUtils.centerWindow(this); } diff --git a/designer-base/src/main/resources/com/fr/design/images/warnings/icon_WarningIcon_normal.png b/designer-base/src/main/resources/com/fr/design/images/warnings/icon_WarningIcon_normal.png new file mode 100644 index 0000000000000000000000000000000000000000..37dbe939b60d2020ad64d33cd9a51f7fbc02f24e GIT binary patch literal 1365 zcmV-b1*-aqP)I+S@$l@eSymtOPF{d8RwYxL3J5vhItA*e5e4p=U zp5M;znIT-^7hU20aTVbI?qDn(Um_0rSI{A;Jcs84JVY z6pF1FfV1jU%Rwi?Ka!axBoj@>?n)pk0yux-rgj57rA!lDLNgjFIiV{8urjGf82o;j z=KIo!c%jfbH;TfK4K8JQO>CnN?G8&{68KDc`*g zR5Q*C&~pIxH;YU8V>pGrf2;AjTUzBa#9_YLb;nJ}6(m=xkJe+MKfLq5*%m?^=?buA#6UtjH)1_(#Qpn#xC&!{J0j*kzfZd5qf2k$5Ki%+7sXDygI?W=K|6{SJ(Yfh)UztfBRg8&-P( zb}a*+>Ix&{#_koGQAbq#v04(q&ZZuB99|c;Dh(M2d73xP?pO>yeITq9B#9QwO}Tf9 zB^CwX&2`t?iK@d43=LiNy4xV8dp}NCJLdy`g&uX>eS1pI_l~0G?mr9pC<i?g@P_E+n)mY2(?z0KK0~8z~EGKR^R!;(+y~1jPOAUVyEQ zfRhg>Fffeswk5__J#VUq4@%snbZt`zpAKOY{_)5 zlFse8RNm78-u$3!C4SipV0@(>gyx-!Ej^M?qWeYumPyq7vE6^>Tx!(Lq@HlVZ&hmE z&5sEH66i@eoqPLV0K6?V#J1RdY~FA=0}$|sENB$X%AIz7_HQ9mPreSOr=u_*X9xQH z5x=2mozL_Gu&$1_9Q*)+5*0wKIt)`txQjI7P+teEjJlqIM`JA-u{Z(miL~)pAAq?< zJq5yz5!Z-Uj`6!P+ZcMj1G?J7j3Mz>j8>fpr-f$JT--uy7^^Kza8qx~zWy Xj(fI1j%-%800000NkvXXu0mjfh&Or{ literal 0 HcmV?d00001 diff --git a/designer-base/src/main/resources/com/fr/design/images/warnings/icon_WarningIcon_normal@2x.png b/designer-base/src/main/resources/com/fr/design/images/warnings/icon_WarningIcon_normal@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..756a456566ea000a34429a55d8931c952dfa3298 GIT binary patch literal 2762 zcmV;*3N`hKP)VL1iRhg{8i0uZ6c<%g;9d}pX^0*A+x1yk+vmW%!{S6JJiQV8&Xp3JB@;s#8( zBn+Tb^$dyBPDFaZdRTNsbcE2Z!n(E>S%eTlC1HS*iti+VlMe#a_zL>-Pd^%)8TW7M!M9FYWQQPTyz5*E53#Ze&aQFePtuS z=m|X9xf9^*Nbs;dP^f81J&`Wzk+`S^(4mG=vh%eL0(igI?uaFi1CG6nMWfTNfNZ&z zh3yGKgqOt?ldG_5>v_*)pM;_sAXD+Lx&YttldGuN3^;xUi%KUuK(_gNf7ejEO_=GT z9gT}-09i}kCE;u*5nRmbVjqy0zX@>SM_5!kz8~c8{f&ST;SEtSrV>}|I?f6f5L7e+ z9Lso=h}QbeSIqqe;FKjSIvs5RdEhP=}p98J(I+ldn zxdq&g2U*xbL5TZeroAYbNMUy91~`rJPml}0DxAvD2(9vZ&}Q7kl5sm80=M%q7Ir8Q zg4UoX)4vWZG=xB?2GHI`74lT}MFN-_vmKA9?ko#_6fc0ZQJ~lFVKJPh#Q?7Q`)P>UHM*JpB`XOgNT~tz zyN0*P`MCNHOXE0n~19D3=9IN_i0GbyxnL>QdOd#kipimCo&m->F z6Y2Rumx2T~z)2Z55YW%qi3b33W&%NH0bbHW4R6pB_Ak6}`eFkaKs%R@k!Q~wCW6U9 zlHhVVGXW*D0A@mna8y)`nT{)Voncb?!2%hOZ8Yu%m+tf%+$)bW6Hqk^VCRN-cg(cE z&c^ov`Zj>JFTPwl=l{fAA>%i}o;=P>K-DaOn{R$Kjy~!GxO$JTn@_$Ca4h2qB5L3! zsshKE38AK{%Y5fXZ2bmt1uXsxgtVy>N0^ z&jt`}(45BIe*mI6UV{b2b7lgnX94`2@fqD*IuCJ!%jftoz_E6Vbap(9}U0Gl5WM0n7>z@$UjAOhdErKTL|Zm!NFQ z*a$$kbH$b87&C#eW&!M4G~5_V*mrR8?Dqg_Hr^*CbP&;KuJ}mAA>uh9U6(V?M8e)Yl)#V% z&{Ipt$v1O9s-R1KXQ7xloDAS>Y#h>ntYzE_ME-tiqPX#0a>L1he9nlQVx~Rlw~7Zf zAipqM$`=S=R7kz_B|F>qsE4~Z}N@}~{uzd;YN*rN%%*;I1_bTXTKz?C%03l8at zNwfMc67Oe#iiO!>dN6Da002$Hn?=I@QP2MLGJu+m@zSB(3Ykm7Y~o1OMu69aj+H$( zHuf?gYZ;q>=$4V%prX{>XOVcf0T=dmzCuJ}ijv3(4T6Yg#ON`X;mV!)A24(q5M+!pAmx&iX7j*9?>b?RT%QzAC+Te2g|JMOTJgJ*@ ze)-Y=4M@dbCjjO~q;e~RbRf6CT2E&3C(UjHvX=2&`JR7}wtC() { + @Override + public void on(Event event, Null aNull) { + EnvChangeEntrance.getInstance().pluginErrorRemind(); + } + }); } @Override diff --git a/designer-realize/src/test/java/com/fr/start/module/DesignerWorkspaceProviderTest.java b/designer-realize/src/test/java/com/fr/start/module/DesignerWorkspaceProviderTest.java new file mode 100644 index 0000000000..d058ee8de9 --- /dev/null +++ b/designer-realize/src/test/java/com/fr/start/module/DesignerWorkspaceProviderTest.java @@ -0,0 +1,50 @@ +package com.fr.start.module; + +import com.fr.design.constants.DesignerLaunchStatus; +import com.fr.event.EventDispatcher; +import com.fr.invoke.Reflect; +import com.fr.workspace.WorkContext; +import com.fr.workspace.Workspace; +import org.easymock.EasyMock; +import org.junit.Assert; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.powermock.api.easymock.PowerMock; +import org.powermock.core.classloader.annotations.PrepareForTest; +import org.powermock.modules.junit4.PowerMockRunner; + +/** + * @author Lucian.Chen + * @version 10.0 + * Created by Lucian.Chen on 2021/1/7 + */ +@RunWith(PowerMockRunner.class) +@PrepareForTest({WorkContext.class}) +public class DesignerWorkspaceProviderTest { + + @Test + public void testPluginErrorRemind() { + + try { + Workspace workspace = EasyMock.mock(Workspace.class); + EasyMock.expect(workspace.isLocal()).andReturn(false).once(); + PowerMock.mockStatic(WorkContext.class); + EasyMock.expect(WorkContext.getCurrent()).andReturn(workspace).anyTimes(); + + EasyMock.replay(workspace); + PowerMock.replayAll(); + + DesignerWorkspaceProvider provider = new DesignerWorkspaceProvider(); + Reflect.on(provider).call("pluginErrorRemind"); + EventDispatcher.fire(DesignerLaunchStatus.STARTUP_COMPLETE); + + EasyMock.verify(workspace); + PowerMock.verifyAll(); + + } catch (Exception e) { + Assert.fail(e.getMessage()); + } + + + } +}