From 8d9fe39e252f7d96a712a2871be08155aec2c22c Mon Sep 17 00:00:00 2001 From: lidongy <1879087903@qq.com> Date: Mon, 14 Feb 2022 14:16:02 +0800 Subject: [PATCH 1/8] =?UTF-8?q?KERNEL-9267=20=E6=8B=86=E5=88=86third.jar?= =?UTF-8?q?=E4=B8=BAthird.jar=20+=20cbb.jar?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.gradle | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build.gradle b/build.gradle index ee08bdeeac..8e2e8b627b 100644 --- a/build.gradle +++ b/build.gradle @@ -9,6 +9,7 @@ plugins { // 模块参数 ext { frVersion = "" + cbbVersion = "" outputPath = "build" ignoreTestFailureSetting = true languageLevelSetting = 1.8 @@ -60,6 +61,8 @@ allprojects { } dependencies { + implementation 'com.fr.essential:fine-essential:' + cbbVersion + implementation 'com.fr.cbb:fine-universal-skeleton:' + cbbVersion implementation 'com.install4j:install4j-runtime:8.0.4' implementation 'com.fr.third:jxbrowser:6.23' implementation 'com.fr.third:jxbrowser-mac:6.23' From 2a4f61fbc61b8633ec6db1a4b5035c7326e90fd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E7=A3=8A?= <294531121@qq.com> Date: Mon, 14 Feb 2022 14:29:45 +0800 Subject: [PATCH 2/8] =?UTF-8?q?CHART-22876&CHART-22873&CHART-22861&CHART-2?= =?UTF-8?q?2863&CHART-22797&CHART-22768=20=E8=8B=A5=E5=B9=B2bug=E4=B8=80?= =?UTF-8?q?=E8=B5=B7=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/chart/gui/ChangeConfigPane.java | 6 ++---- ...ategoryPlotMoreCateReportDataContentPane.java | 4 +--- ...CategoryPlotMoreCateTableDataContentPane.java | 1 + .../style/axis/VanChartBaseAxisPane.java | 16 +++++++++++++++- 4 files changed, 19 insertions(+), 8 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChangeConfigPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChangeConfigPane.java index ebc3ab5b32..f053b09d61 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChangeConfigPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChangeConfigPane.java @@ -23,6 +23,7 @@ import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane; import com.fr.stable.StableUtils; +import com.fr.stable.StringUtils; import com.fr.van.chart.designer.TableLayout4VanChartHelper; import javax.swing.BorderFactory; @@ -238,17 +239,14 @@ public class ChangeConfigPane extends BasicBeanPane { private void populateSwitchTitlePane(int chartIndex, ChartCollection collection) { Chart chart = collection.getChart(chartIndex, Chart.class); Object switchTitle = chart.getSwitchTitle(); - String result; + String result = StringUtils.EMPTY; if (switchTitle != null) { if (switchTitle instanceof BaseFormula) { result = ((BaseFormula) switchTitle).getContent(); } else { result = Utils.objectToString(switchTitle); } - } else { - result = Toolkit.i18nText("Fine-Design_Chart_Chart") + (chartIndex + 1); } - TinyFormulaPane title = new TinyFormulaPane(); title.populateBean(result); switchTitles.add(title); diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/report/CategoryPlotMoreCateReportDataContentPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/report/CategoryPlotMoreCateReportDataContentPane.java index 93d189c697..54c3bd33d4 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/report/CategoryPlotMoreCateReportDataContentPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/report/CategoryPlotMoreCateReportDataContentPane.java @@ -7,7 +7,6 @@ import com.fr.chart.chartattr.Bar2DPlot; import com.fr.chart.chartattr.ChartCollection; import com.fr.chart.chartattr.Plot; import com.fr.chart.chartdata.NormalReportDataDefinition; -import com.fr.decision.base.util.UUIDUtil; import com.fr.design.event.UIObserver; import com.fr.design.event.UIObserverListener; import com.fr.design.formula.TinyFormulaPane; @@ -28,7 +27,6 @@ import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.ArrayList; import java.util.List; -import java.util.Map; /** @@ -195,7 +193,7 @@ public class CategoryPlotMoreCateReportDataContentPane extends CategoryPlotRepor reportDefinition.clearMoreCate(); updateMoreCate(reportDefinition, plot); - + collection.updateAxisCategoryStyles(); } } diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/CategoryPlotMoreCateTableDataContentPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/CategoryPlotMoreCateTableDataContentPane.java index 572c28edde..4c809e64f3 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/CategoryPlotMoreCateTableDataContentPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/CategoryPlotMoreCateTableDataContentPane.java @@ -246,6 +246,7 @@ public class CategoryPlotMoreCateTableDataContentPane extends CategoryPlotTableD normal.clearMoreCate(); updateMoreCate(normal, plot); } + collection.updateAxisCategoryStyles(); } protected void updateMoreCate(NormalTableDataDefinition normal, Plot plot) { diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartBaseAxisPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartBaseAxisPane.java index 1023ecde8c..a6f6671007 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartBaseAxisPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartBaseAxisPane.java @@ -46,6 +46,7 @@ import javax.swing.event.ChangeListener; import java.awt.BorderLayout; import java.awt.CardLayout; import java.awt.Component; +import java.awt.Dimension; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.ArrayList; @@ -264,7 +265,20 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { private JPanel createLabelContentPane() { labelContentPane = new JPanel(new BorderLayout()); showLogicPane = new JPanel(new BorderLayout()); - labelStylePane = new JPanel(new CardLayout()); + labelStylePane = new JPanel(new CardLayout()) { + @Override + public Dimension getPreferredSize() { + switch (showLogic.getSelectedIndex()) { + case 0: + return wholeDisplayLabelPanel.getPreferredSize(); + case 1: + return categoryStylePane.getPreferredSize(); + case -1: + default: + return super.getPreferredSize(); + } + } + }; labelStylePane.add(wholeDisplayLabelPanel, WHOLE_DISPLAY); labelStylePane.add(createCategoryStylePane(), LAYER_DISPLAY); showLogicPane.add(TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Axis_Label_Show_Logic"), showLogic), BorderLayout.NORTH); From c1ca4cfdb514e474dff2ec5c34da922d8e58d59e Mon Sep 17 00:00:00 2001 From: Starryi Date: Mon, 14 Feb 2022 14:39:27 +0800 Subject: [PATCH 3/8] =?UTF-8?q?REPORT-66306=20=E7=BB=84=E4=BB=B6=E5=8C=85?= =?UTF-8?q?=E4=B8=8B=E8=BD=BD=E9=9D=A2=E6=9D=BF=E6=97=A0=E9=81=AE=E7=BD=A9?= =?UTF-8?q?=E9=98=B4=E5=BD=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【问题原因】 swing中两个组件上下层叠时,重绘底层组件,会将其内容会知道上方,遮挡上层组件, 因此也需要手动重新绘制上层组件。 【改动思路】 主动调用下阴影层的重绘方法 --- .../ui/online/OnlineDownloadPackagePane.java | 40 +++++++++++-------- 1 file changed, 23 insertions(+), 17 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/OnlineDownloadPackagePane.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/OnlineDownloadPackagePane.java index 59a09c466c..987cffaceb 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/OnlineDownloadPackagePane.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/OnlineDownloadPackagePane.java @@ -72,22 +72,6 @@ public class OnlineDownloadPackagePane extends OnlineWidgetSelectPane { return false; } - protected JPanel createWidgetPane() { - return new JPanel() { - @Override - public void paint(Graphics g) { - super.paint(g); - Graphics2D g2d = (Graphics2D) g; - Composite oldComposite = g2d.getComposite(); - AlphaComposite composite = AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.65f); - g2d.setComposite(composite); - g2d.setColor(Color.DARK_GRAY); - g2d.fillRect(0, 0, getWidth(), getHeight()); - g2d.setComposite(oldComposite); - } - }; - } - protected JPanel createContentPane(JPanel widgetPane) { JPanel panel = new JPanel() { @Override @@ -114,7 +98,20 @@ public class OnlineDownloadPackagePane extends OnlineWidgetSelectPane { parentPane.resetWidgetDetailPane(packageId, getSharableWidgetProviders()); } } - }); + }) { + @Override + public void paint(Graphics g) { + Graphics2D g2d = (Graphics2D) g; + Composite oldComposite = g2d.getComposite(); + AlphaComposite composite = AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.65f); + g2d.setComposite(composite); + g2d.setColor(Color.DARK_GRAY); + g2d.fillRect(0, 0, getWidth(), getHeight()); + g2d.setComposite(oldComposite); + + super.paint(g); + } + }; panel.add(downloadProgressPane); panel.add(widgetPane, BorderLayout.CENTER); return panel; @@ -125,10 +122,16 @@ public class OnlineDownloadPackagePane extends OnlineWidgetSelectPane { final com.fr.design.extra.Process downloadProcess = aDouble -> { OnlineDownloadPackagePane.this.process = 0.8 * aDouble; downloadProgressPane.updateProgress(process); + if (downloadProgressPane != null) { + downloadProgressPane.repaint(); + } }; final com.fr.design.extra.Process installProcess = aDouble -> { OnlineDownloadPackagePane.this.process = 0.8 + 0.2 * aDouble; downloadProgressPane.updateProgress(process); + if (downloadProgressPane != null) { + downloadProgressPane.repaint(); + } }; downloadProcess.process(0.0D); @@ -220,6 +223,9 @@ public class OnlineDownloadPackagePane extends OnlineWidgetSelectPane { File file = new File(filePath); installProcess.process(0.0D); downloadProgressPane.changeState(); + if (downloadProgressPane != null) { + downloadProgressPane.repaint(); + } InstallUtils.InstallResult result = null; try { if (file.exists()) { From 3dfe341cbbd81cef5abed61625f5f5fa72efbe26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E7=A3=8A?= <294531121@qq.com> Date: Mon, 14 Feb 2022 18:16:22 +0800 Subject: [PATCH 4/8] =?UTF-8?q?REPORT-65772=20=E6=A8=A1=E6=9D=BF=E6=9D=83?= =?UTF-8?q?=E9=99=90=E7=BC=96=E8=BE=91=E7=8A=B6=E6=80=81=E5=88=87=E6=8D=A2?= =?UTF-8?q?=E9=97=AE=E9=A2=98-=E6=89=93=E5=BC=80=E4=B8=80=E5=BC=A0cpt?= =?UTF-8?q?=EF=BC=8C=E8=BF=9B=E5=85=A5=E6=A8=A1=E6=9D=BF=E6=9D=83=E9=99=90?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E5=90=8E=EF=BC=8C=E5=86=8D=E6=89=93=E5=BC=80?= =?UTF-8?q?=E4=B8=80=E5=BC=A0frm=E6=97=B6=EF=BC=8Cfrm=E4=B9=9F=E6=9C=89?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E6=9D=83=E9=99=90=E7=BC=96=E8=BE=91=E6=A1=86?= =?UTF-8?q?=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/mainframe/FormDesigner.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java b/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java index ef1177ece9..a703512aba 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java @@ -1520,7 +1520,10 @@ public class FormDesigner extends TargetComponent
implements TreeSelection private DesignerBaseOperate getLayoutBaseOperate(){ FormSelection selection = this.getSelectionModel().getSelection(); XCreator creator = selection.getSelectedCreator(); - XLayoutContainer container = (XLayoutContainer) creator.getParent(); + XLayoutContainer container = null; + if (creator != null) { + container = (XLayoutContainer) creator.getParent(); + } if (container == null) { return new DefaultDesignerBaseOperate(); } From 7040a69a398b4f14d2b2abaa9871c74649c78d61 Mon Sep 17 00:00:00 2001 From: Starryi Date: Tue, 15 Feb 2022 10:26:22 +0800 Subject: [PATCH 5/8] =?UTF-8?q?REPORT-66465=20=E3=80=90=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E5=95=86=E5=9F=8E=E9=A3=8E=E6=A0=BC=E4=BC=98=E5=8C=96=E3=80=91?= =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E5=99=A8=E5=95=86=E5=9F=8E=EF=BC=8C=E6=A6=82?= =?UTF-8?q?=E7=8E=87=E6=89=93=E5=BC=80=E7=A9=BA=E7=99=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【问题原因】 windows平台上使用7.15版本的JxBrowser 【改动思路】 同上 --- .../ui/online/mini/MiniComponentShopPane.java | 23 ++++- .../mini/bridge/ComposedNativeBridges.java | 19 ++-- .../online/mini/bridge/NativeAuthBridge.java | 3 + .../mini/bridge/NativeBrowserBridge.java | 13 +-- .../mini/bridge/NativeProductBridge.java | 86 ++++++++++++------- .../online/mini/bridge/NativeTaskBridge.java | 21 ++--- .../mini/bridge/SafeJSFunctionInvoker.java | 29 +++++-- 7 files changed, 126 insertions(+), 68 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/mini/MiniComponentShopPane.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/mini/MiniComponentShopPane.java index 843638d192..9b980f14b2 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/mini/MiniComponentShopPane.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/mini/MiniComponentShopPane.java @@ -3,15 +3,18 @@ package com.fr.design.mainframe.share.ui.online.mini; import com.fr.design.mainframe.share.ui.online.mini.bridge.ComposedNativeBridges; import com.fr.design.mainframe.share.util.OnlineShopUtils; import com.fr.design.ui.ModernUIPane; +import com.fr.design.ui.compatible.ModernUIPaneFactory; import com.fr.design.upm.event.CertificateEvent; import com.fr.event.Event; import com.fr.event.EventDispatcher; import com.fr.event.Listener; +import com.teamdev.jxbrowser.browser.callback.InjectJsCallback; import com.teamdev.jxbrowser.chromium.JSObject; import com.teamdev.jxbrowser.chromium.events.ScriptContextAdapter; import com.teamdev.jxbrowser.chromium.events.ScriptContextEvent; +import com.teamdev.jxbrowser.js.JsObject; +import org.jetbrains.annotations.Nullable; -import javax.swing.JOptionPane; import javax.swing.JPanel; import java.awt.BorderLayout; @@ -27,14 +30,26 @@ public class MiniComponentShopPane extends JPanel { public MiniComponentShopPane() { setLayout(new BorderLayout()); - modernUIPane = new ModernUIPane.Builder<>() + modernUIPane = ModernUIPaneFactory.modernUIPaneBuilder() .withURL(OnlineShopUtils.getWebMiniShopPath()) - .prepare(new ScriptContextAdapter() { + .prepareForV6(new ScriptContextAdapter() { @Override public void onScriptContextCreated(ScriptContextEvent event) { super.onScriptContextCreated(event); JSObject window = event.getBrowser().executeJavaScriptAndReturnValue("window").asObject(); - window.asObject().setProperty("ShopHelper", new ComposedNativeBridges(window, JOptionPane.getFrameForComponent(MiniComponentShopPane.this))); + window.setProperty("ShopHelper", new ComposedNativeBridges(window)); + } + }) + .prepareForV7(new InjectJsCallback() { + @Nullable + @Override + public Response on(Params params) { + // 7.x + JsObject window = params.frame().executeJavaScript("window"); + if (window != null) { + window.putProperty("ShopHelper", new ComposedNativeBridges(window)); + } + return InjectJsCallback.Response.proceed(); } }) .build(); diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/mini/bridge/ComposedNativeBridges.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/mini/bridge/ComposedNativeBridges.java index ea729a1452..3a09774c53 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/mini/bridge/ComposedNativeBridges.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/mini/bridge/ComposedNativeBridges.java @@ -1,9 +1,7 @@ package com.fr.design.mainframe.share.ui.online.mini.bridge; import com.teamdev.jxbrowser.chromium.JSAccessible; -import com.teamdev.jxbrowser.chromium.JSObject; - -import java.awt.Window; +import com.teamdev.jxbrowser.js.JsAccessible; /** * @author Starryi @@ -12,14 +10,19 @@ import java.awt.Window; */ public class ComposedNativeBridges { @JSAccessible - public final NativeBrowserBridge Browser; + @JsAccessible + public final Object Browser; + @JSAccessible - public final NativeAuthBridge Auth; + @JsAccessible + public final Object Auth; + @JSAccessible - public final NativeProductBridge Product; + @JsAccessible + public final Object Product; - public ComposedNativeBridges(JSObject window, Window nativeWindow) { - this.Browser = new NativeBrowserBridge(nativeWindow); + public ComposedNativeBridges(Object window) { + this.Browser = new NativeBrowserBridge(); this.Auth = new NativeAuthBridge(); this.Product = new NativeProductBridge(window); } diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/mini/bridge/NativeAuthBridge.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/mini/bridge/NativeAuthBridge.java index a78a3b231c..42f3a6c655 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/mini/bridge/NativeAuthBridge.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/mini/bridge/NativeAuthBridge.java @@ -6,6 +6,7 @@ import com.fr.design.login.DesignerLoginHelper; import com.fr.design.login.DesignerLoginSource; import com.fr.design.mainframe.share.ui.online.mini.MiniComponentShopDialog; import com.teamdev.jxbrowser.chromium.JSAccessible; +import com.teamdev.jxbrowser.js.JsAccessible; import java.awt.Window; import java.util.HashMap; @@ -17,12 +18,14 @@ import java.util.HashMap; */ public class NativeAuthBridge { @JSAccessible + @JsAccessible @JSBridge public String getLoginUsername() { return DesignerEnvManager.getEnvManager().getDesignerLoginUsername(); } @JSAccessible + @JsAccessible @JSBridge public void goLogin() { Window parentWindow = MiniComponentShopDialog.getInstance().getWindow(); diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/mini/bridge/NativeBrowserBridge.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/mini/bridge/NativeBrowserBridge.java index e062658749..ee77a8b95a 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/mini/bridge/NativeBrowserBridge.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/mini/bridge/NativeBrowserBridge.java @@ -1,7 +1,9 @@ package com.fr.design.mainframe.share.ui.online.mini.bridge; import com.fr.design.bridge.exec.JSBridge; +import com.fr.design.mainframe.share.ui.online.mini.MiniComponentShopDialog; import com.teamdev.jxbrowser.chromium.JSAccessible; +import com.teamdev.jxbrowser.js.JsAccessible; import java.awt.Window; @@ -11,15 +13,14 @@ import java.awt.Window; * Created by Starryi on 2021/12/20 */ public class NativeBrowserBridge { - private final Window nativeWindow; - - public NativeBrowserBridge(Window nativeWindow) { - this.nativeWindow = nativeWindow; - } @JSAccessible + @JsAccessible @JSBridge public void dispose() { - this.nativeWindow.dispose(); + Window nativeWindow = MiniComponentShopDialog.getInstance().getWindow(); + if (nativeWindow != null) { + nativeWindow.dispose(); + } } } diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/mini/bridge/NativeProductBridge.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/mini/bridge/NativeProductBridge.java index e9daf3e0e5..0da415a5d8 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/mini/bridge/NativeProductBridge.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/mini/bridge/NativeProductBridge.java @@ -21,8 +21,7 @@ import com.fr.form.share.group.DefaultShareGroupManager; import com.fr.json.JSONObject; import com.fr.stable.StringUtils; import com.teamdev.jxbrowser.chromium.JSAccessible; -import com.teamdev.jxbrowser.chromium.JSFunction; -import com.teamdev.jxbrowser.chromium.JSObject; +import com.teamdev.jxbrowser.js.JsAccessible; import javax.swing.JOptionPane; import javax.swing.SwingUtilities; @@ -38,20 +37,21 @@ import java.util.Set; * Created by Starryi on 2021/12/20 */ public class NativeProductBridge { - private final JSObject window; + private final Object window; private static final Map executingComponentInstallationTasks = new HashMap<>(); private static final Map executingComponentsPackageInstallationTasks = new HashMap<>(); private static final Map executingTemplateThemeInstallationTasks = new HashMap<>(); - private final Map> componentDownloadTaskStartListeners = new HashMap<>(); - private final Map> componentsPackageDownloadTaskStartListeners = new HashMap<>(); - private final Map> themeDownloadTaskStartListeners = new HashMap<>(); + private final Map> componentDownloadTaskStartListeners = new HashMap<>(); + private final Map> componentsPackageDownloadTaskStartListeners = new HashMap<>(); + private final Map> themeDownloadTaskStartListeners = new HashMap<>(); - public NativeProductBridge(JSObject window) { + public NativeProductBridge(Object window) { this.window = window; } @JSAccessible + @JsAccessible @JSBridge public boolean isProductDownloaded(String uuid) { for (Group group : DefaultShareGroupManager.getInstance().getAllGroup()) { @@ -66,16 +66,17 @@ public class NativeProductBridge { } @JSAccessible + @JsAccessible @JSBridge - public void addProductDownloadTaskStartListener(String json, JSFunction function) { + public void addProductDownloadTaskStartListener(String json, Object function) { JSONObject object = new JSONObject(json); OnlineShareWidget widget = OnlineShareWidget.parseFromJSONObject(object); String uuid = widget.getUuid(); boolean isPackage = widget.isWidgetPackage(); - Map> downloadTaskGetters = + Map> downloadTaskGetters = isPackage ? componentsPackageDownloadTaskStartListeners : componentDownloadTaskStartListeners; - Set startListeners = downloadTaskGetters.get(widget.getUuid()); + Set startListeners = downloadTaskGetters.get(widget.getUuid()); if (startListeners == null) { startListeners = new HashSet<>(); } @@ -86,16 +87,17 @@ public class NativeProductBridge { } @JSAccessible + @JsAccessible @JSBridge - public void removeProductDownloadTaskStartListener(String json, JSFunction function) { + public void removeProductDownloadTaskStartListener(String json, Object function) { JSONObject object = new JSONObject(json); OnlineShareWidget widget = OnlineShareWidget.parseFromJSONObject(object); String uuid = widget.getUuid(); boolean isPackage = widget.isWidgetPackage(); - Map> downloadTaskGetters = isPackage ? componentsPackageDownloadTaskStartListeners : componentDownloadTaskStartListeners; + Map> downloadTaskGetters = isPackage ? componentsPackageDownloadTaskStartListeners : componentDownloadTaskStartListeners; - Set startListeners = downloadTaskGetters.get(uuid); + Set startListeners = downloadTaskGetters.get(uuid); if (startListeners == null) { startListeners = new HashSet<>(); } @@ -104,6 +106,7 @@ public class NativeProductBridge { } @JSAccessible + @JsAccessible @JSBridge public Object getExecutingProductDownloadTask(String json) { JSONObject object = new JSONObject(json); @@ -121,22 +124,24 @@ public class NativeProductBridge { } @JSAccessible + @JsAccessible @JSBridge public Object createProductDownloadTask(String json) { JSONObject object = new JSONObject(json); OnlineShareWidget widget = OnlineShareWidget.parseFromJSONObject(object); int childrenCount = object.optInt("pkgsize", 0); if (childrenCount > 0) { - return new ComponentsPackageInstallationTask(window, widget, childrenCount); + return new ComponentsPackageInstallationTask(this, window, widget, childrenCount); } else { - return new ComponentInstallationTask(window, widget); + return new ComponentInstallationTask(this, window, widget); } } @JSAccessible + @JsAccessible @JSBridge - public void addThemeDownloadTaskStartListener(String themePath, JSFunction function) { - Set startListeners = themeDownloadTaskStartListeners.get(themePath); + public void addThemeDownloadTaskStartListener(String themePath, Object function) { + Set startListeners = themeDownloadTaskStartListeners.get(themePath); if (startListeners == null) { startListeners = new HashSet<>(); } @@ -145,9 +150,10 @@ public class NativeProductBridge { } @JSAccessible + @JsAccessible @JSBridge - public void removeThemeDownloadTaskStartListener(String themePath, JSFunction function) { - Set startListeners = themeDownloadTaskStartListeners.get(themePath); + public void removeThemeDownloadTaskStartListener(String themePath, Object function) { + Set startListeners = themeDownloadTaskStartListeners.get(themePath); if (startListeners == null) { startListeners = new HashSet<>(); } @@ -156,9 +162,10 @@ public class NativeProductBridge { } @JSAccessible + @JsAccessible @JSBridge public Object getExecutingThemeDownloadTask(String themePath) { - NativeTaskBridge task = executingTemplateThemeInstallationTasks.get(themePath); + NativeTaskBridge task = (NativeTaskBridge) executingTemplateThemeInstallationTasks.get(themePath); if (task != null) { task.checkJSEnvChange(this.window); } @@ -166,17 +173,20 @@ public class NativeProductBridge { } @JSAccessible + @JsAccessible @JSBridge public Object createTemplateThemeDownloadTask(String themePath) { - return new TemplateThemeInstallationTask(window, themePath); + return new TemplateThemeInstallationTask(this, window, themePath); } - public class ComponentInstallationTask extends NativeTaskBridge { + public static class ComponentInstallationTask extends NativeTaskBridge { + private final NativeProductBridge env; private final OnlineShareWidget widget; private final ComponentInstallation action; - public ComponentInstallationTask(JSObject window, OnlineShareWidget widget) { + public ComponentInstallationTask(NativeProductBridge env, Object window, OnlineShareWidget widget) { super(window); + this.env = env; this.widget = widget; action = new ComponentInstallation(widget); action.setActionListener(new AsyncInstallation.AsyncActionListener() { @@ -203,6 +213,7 @@ public class NativeProductBridge { } @JSAccessible + @JsAccessible @JSBridge @Override public void execute() { @@ -231,6 +242,7 @@ public class NativeProductBridge { } @JSAccessible + @JsAccessible @JSBridge @Override public void cancel() { @@ -246,8 +258,8 @@ public class NativeProductBridge { @Override protected void fireStartEvent(String event) { executingComponentInstallationTasks.put(widget.getUuid(), this); - Set startListeners = componentDownloadTaskStartListeners.get(widget.getUuid()); - SafeJSFunctionInvoker.invoke(startListeners, window); + Set startListeners = env.componentDownloadTaskStartListeners.get(widget.getUuid()); + SafeJSFunctionInvoker.invoke(startListeners, env.window); super.fireStartEvent(event); } @@ -264,14 +276,16 @@ public class NativeProductBridge { } } - public class ComponentsPackageInstallationTask extends NativeTaskBridge { + public static class ComponentsPackageInstallationTask extends NativeTaskBridge { + private final NativeProductBridge env; private final ComponentsPackageInstallation action; private final OnlineShareWidget widget; private final int childrenCount; - public ComponentsPackageInstallationTask(JSObject window, OnlineShareWidget widget, int childrenCount) { + public ComponentsPackageInstallationTask(NativeProductBridge env, Object window, OnlineShareWidget widget, int childrenCount) { super(window); + this.env = env; this.widget = widget; this.childrenCount = childrenCount; action = new ComponentsPackageInstallation(widget, childrenCount); @@ -299,6 +313,7 @@ public class NativeProductBridge { } @JSAccessible + @JsAccessible @JSBridge @Override public void execute() { @@ -343,6 +358,7 @@ public class NativeProductBridge { } @JSAccessible + @JsAccessible @JSBridge @Override public void cancel() { @@ -360,8 +376,8 @@ public class NativeProductBridge { executingComponentsPackageInstallationTasks.put(widget.getUuid(), this); super.fireStartEvent(event); - Set startListeners = componentsPackageDownloadTaskStartListeners.get(widget.getUuid()); - SafeJSFunctionInvoker.invoke(startListeners, window); + Set startListeners = env.componentsPackageDownloadTaskStartListeners.get(widget.getUuid()); + SafeJSFunctionInvoker.invoke(startListeners, env.window); } @Override @@ -377,11 +393,13 @@ public class NativeProductBridge { } } - public class TemplateThemeInstallationTask extends NativeTaskBridge { + public static class TemplateThemeInstallationTask extends NativeTaskBridge { + private final NativeProductBridge env; private final String themePath; private final TemplateThemeInstallation action; - public TemplateThemeInstallationTask(JSObject window, String themePath) { + public TemplateThemeInstallationTask(NativeProductBridge env, Object window, String themePath) { super(window); + this.env = env; this.themePath = themePath; Window miniShopWindow = MiniComponentShopDialog.getInstance().getWindow(); action = new TemplateThemeInstallation(miniShopWindow, themePath); @@ -404,6 +422,7 @@ public class NativeProductBridge { } @JSAccessible + @JsAccessible @JSBridge @Override public void execute() { @@ -418,6 +437,7 @@ public class NativeProductBridge { } @JSAccessible + @JsAccessible @JSBridge @Override public void cancel() { @@ -433,8 +453,8 @@ public class NativeProductBridge { @Override protected void fireStartEvent(String event) { executingTemplateThemeInstallationTasks.put(themePath, this); - Set startListeners = themeDownloadTaskStartListeners.get(themePath); - SafeJSFunctionInvoker.invoke(startListeners, window); + Set startListeners = env.themeDownloadTaskStartListeners.get(themePath); + SafeJSFunctionInvoker.invoke(startListeners, env.window); super.fireStartEvent(event); } diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/mini/bridge/NativeTaskBridge.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/mini/bridge/NativeTaskBridge.java index eb343c623c..06c26c0186 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/mini/bridge/NativeTaskBridge.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/mini/bridge/NativeTaskBridge.java @@ -4,12 +4,9 @@ import com.fr.design.bridge.exec.JSBridge; import com.fr.design.mainframe.share.mini.MiniShopNativeTask; import com.fr.design.mainframe.share.mini.MiniShopNativeTaskManager; import com.teamdev.jxbrowser.chromium.JSAccessible; -import com.teamdev.jxbrowser.chromium.JSFunction; -import com.teamdev.jxbrowser.chromium.JSObject; +import com.teamdev.jxbrowser.js.JsAccessible; -import java.util.HashMap; import java.util.HashSet; -import java.util.Map; import java.util.Set; /** @@ -19,14 +16,14 @@ import java.util.Set; */ public class NativeTaskBridge implements MiniShopNativeTask { - private JSObject window; - protected final Set statusCbs = new HashSet<>(); + private Object window; + protected final Set statusCbs = new HashSet<>(); - public NativeTaskBridge(JSObject window) { + public NativeTaskBridge(Object window) { this.window = window; } - public void checkJSEnvChange(JSObject window) { + public void checkJSEnvChange(Object window) { if (this.window != window) { this.window = window; this.statusCbs.clear(); @@ -35,24 +32,28 @@ public class NativeTaskBridge implements MiniShopNativeTask { @JSBridge @JSAccessible - public void addStatusCallback(JSFunction cb) { + @JsAccessible + public void addStatusCallback(Object cb) { this.statusCbs.add(cb); } @JSBridge @JSAccessible - public void removeStatusCallback(JSFunction cb) { + @JsAccessible + public void removeStatusCallback(Object cb) { this.statusCbs.remove(cb); } @JSBridge @JSAccessible + @JsAccessible @Override public void execute() { } @JSBridge @JSAccessible + @JsAccessible @Override public void cancel() { MiniShopNativeTaskManager.getInstance().removeCompletedTask(this); diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/mini/bridge/SafeJSFunctionInvoker.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/mini/bridge/SafeJSFunctionInvoker.java index 238376f9ed..e5bf71da87 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/mini/bridge/SafeJSFunctionInvoker.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/mini/bridge/SafeJSFunctionInvoker.java @@ -2,6 +2,8 @@ package com.fr.design.mainframe.share.ui.online.mini.bridge; import com.teamdev.jxbrowser.chromium.JSFunction; import com.teamdev.jxbrowser.chromium.JSObject; +import com.teamdev.jxbrowser.js.JsFunction; +import com.teamdev.jxbrowser.js.JsObject; import java.util.Collection; @@ -12,18 +14,31 @@ import java.util.Collection; */ public class SafeJSFunctionInvoker { - public static void invoke(Collection functions, JSObject instance, Object... args) { + public static void invoke(Collection functions, Object instance, Object... args) { if (functions != null) { - for (JSFunction function: functions) { - if (function != null && !function.getContext().isDisposed()) { - function.invoke(instance, args); - } + for (Object function: functions) { + invoke(function, instance, args); } } } - public static void invoke(JSFunction function, JSObject instance, Object... args) { - if (function != null && !function.getContext().isDisposed()) { + + public static void invoke(Object function, Object instance, Object... args) { + if (function != null) { + if (function instanceof JSFunction && instance instanceof JSObject) { + invokeV6((JSFunction) function, (JSObject) instance, args); + } else if (function instanceof JsFunction && instance instanceof JsObject) { + invokeV7((JsFunction) function, (JsObject) instance, args); + } + } + } + + private static void invokeV6(JSFunction function, JSObject instance, Object... args) { + if (!function.getContext().isDisposed()) { function.invoke(instance, args); } } + + private static void invokeV7(JsFunction function, JsObject instance, Object... args) { + function.invoke(instance, args); + } } From 45ae58a91ae87178f81a682161fdc42a4321d42f Mon Sep 17 00:00:00 2001 From: "Bruce.Deng" Date: Tue, 15 Feb 2022 11:28:07 +0800 Subject: [PATCH 6/8] =?UTF-8?q?REPORT-64011=20=E4=BC=98=E5=8C=96=E5=A4=A7?= =?UTF-8?q?=E6=96=87=E6=9C=AC=20-=20=E5=85=88=E5=9B=9E=E9=80=80=EF=BC=8C?= =?UTF-8?q?=E7=AD=89=E6=96=B0=E5=89=8D=E7=AB=AF=E9=80=82=E9=85=8D=E5=AE=8C?= =?UTF-8?q?=E4=BA=86=E5=86=8D=E5=8F=91=E5=B8=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cell/settingpane/CellOtherSetPane.java | 171 +----------------- 1 file changed, 10 insertions(+), 161 deletions(-) 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 99a0d9bf48..efab3fc66e 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 @@ -12,10 +12,8 @@ import com.fr.design.gui.ibutton.UIRadioButton; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.ilable.UILabel; -import com.fr.design.gui.ispinner.UISpinner; import com.fr.design.gui.itextfield.UITextField; 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; @@ -60,8 +58,6 @@ public class CellOtherSetPane extends AbstractCellAttrPane { private static final int HEAD_HEIGTH = 24; private static final int COMBO_WIDTH = 154; private static final int BUTTON_GROUP_WIDTH = 140; - private static final double f = TableLayout.FILL; - private static final double p = TableLayout.PREFERRED; // normal private UIButtonGroup autoshrik; @@ -71,20 +67,8 @@ public class CellOtherSetPane extends AbstractCellAttrPane { private UIComboBox showContent; - //内容提示 - private UIButtonGroup tooltipButtonGroup; - private CardLayout tooltipLayout; - private JPanel tooltipPane; private UITextField tooltipTextField; - //文本超出时隐藏 - private UICheckBox textOverflowCheckBox; - private UIComboBox showPartComboBox; - private CardLayout showPartLayout; - private JPanel showPartPane; - private UISpinner showCharNums; - private UIComboBox textOverflowTypeComboBox; - private UITextField fileNameTextField; // 分页 @@ -230,16 +214,17 @@ public class CellOtherSetPane extends AbstractCellAttrPane { private JPanel seniorUpPane() { JPanel pane = new JPanel(new BorderLayout()); // TODO: 方法之间的耦合还比较严重。现在必须先执行 createShowContentPane,再执行 createSeniorCheckPane。否则出现 npe。 - pane.add(createTextOverflowPane(), BorderLayout.SOUTH); pane.add(createShowContentPane(), BorderLayout.CENTER); pane.add(createSeniorCheckPane(), BorderLayout.NORTH); return pane; } private JPanel createShowContentPane() { - double[] rowSize = {p, p, p, p}; + double f = TableLayout.FILL; + double p = TableLayout.PREFERRED; + double[] rowSize = {p, p, p}; double[] colSize = {f, COMBO_WIDTH}; - int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}}; + int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}}; JPanel fileNamePane = createNormal(); fileNamePane.setBorder(BorderFactory.createEmptyBorder(0,12,0,0)); @@ -248,96 +233,21 @@ public class CellOtherSetPane extends AbstractCellAttrPane { UIComponentUtils.setLineWrap(showContentLabel); UILabel toolTipLabel = FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_CellWrite_ToolTip")); - tooltipLayout = new CardLayout(); - tooltipPane = new JPanel(tooltipLayout); - tooltipPane.add(new JPanel(), "none"); - tooltipPane.add(tooltipTextField, "content"); - tooltipPane.setPreferredSize(new Dimension(0, 0)); - tooltipButtonGroup = new UIButtonGroup(new String[]{Toolkit.i18nText("Fine-Design_Report_CellWrite_ToolTip_Custom"), Toolkit.i18nText("Fine-Design_Report_CellWrite_ToolTip_CellValue")}); - tooltipButtonGroup.addChangeListener(new ChangeListener() { - @Override - public void stateChanged(ChangeEvent e) { - if (tooltipButtonGroup.getSelectedIndex() == 0) { - tooltipPane.setPreferredSize(new Dimension(154, 20)); - tooltipLayout.show(tooltipPane, "content"); - } else { - tooltipLayout.show(tooltipPane, "none"); - tooltipPane.setPreferredSize(new Dimension(0, 0)); - } - } - }); + JPanel toolTipTextFieldWrapper = new JPanel(new BorderLayout()); + toolTipTextFieldWrapper.add(tooltipTextField, BorderLayout.NORTH); Component[][] components = new Component[][]{ new Component[]{showContentLabel, UIComponentUtils.wrapWithBorderLayoutPane(showContent)}, new Component[]{fileNamePane, null}, // 选择"用下载连接显示二进制内容"时,会显示这一行的面板 - new Component[]{toolTipLabel, tooltipButtonGroup}, // “自定义”or"单元格值" - new Component[]{null, tooltipPane} // 选择“自定义”时显示这一行 + new Component[]{toolTipLabel, toolTipTextFieldWrapper} }; JPanel showContentPane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, colSize, rowCount, LayoutConstants.VGAP_LARGE, LayoutConstants.VGAP_MEDIUM); - showContentPane.setBorder(BorderFactory.createEmptyBorder(6, 0, 6, 0)); + showContentPane.setBorder(BorderFactory.createEmptyBorder(6, 0, 12, 0)); return showContentPane; } - private JPanel createTextOverflowPane() { - showPartLayout = new CardLayout(); - showPartPane = new JPanel(showPartLayout); - showCharNums = new UISpinner(0, Integer.MAX_VALUE, 1, 10); - JPanel showPartNumPane = new JPanel(new BorderLayout(4, 0)); - showPartNumPane.add(new UILabel(Toolkit.i18nText("Fine-Design_Report_CellWrite_TextOverflow_Nums")), BorderLayout.WEST); - showPartNumPane.add(showCharNums, BorderLayout.CENTER); - showPartPane.add(new JPanel(), "none"); - showPartPane.add(showPartNumPane, "content"); - showPartComboBox = new UIComboBox(new String[]{Toolkit.i18nText("Fine-Design_Report_CellWrite_TextOverflow_CharNum"), Toolkit.i18nText("Fine-Design_Report_CellWrite_TextOverflow_CellWidth")}); - showPartComboBox.addItemListener(new ItemListener() { - @Override - public void itemStateChanged(ItemEvent e) { - if (showPartComboBox.getSelectedIndex() == 0) { - showPartPane.setPreferredSize(new Dimension(70, 20)); - showPartLayout.show(showPartPane, "content"); - } else { - showPartLayout.show(showPartPane, "none"); - showPartPane.setPreferredSize(new Dimension(0, 0)); - } - } - }); - - textOverflowTypeComboBox = new UIComboBox(new String[]{Toolkit.i18nText("Fine-Design_Report_CellWrite_TextOverflow_Ellipsis"), Toolkit.i18nText("Fine-Design_Report_CellWrite_TextOverflow_NoneSymbol")}); - UILabel showPartLabel = new UILabel(Toolkit.i18nText("Fine-Design_Report_CellWrite_TextOverflow_ShowPart") + ":"); - UILabel hideTypeLabel = new UILabel(Toolkit.i18nText("Fine-Design_Report_CellWrite_TextOverflow_HideType") + ":"); - Component[][] textOverflowComponents = new Component[][]{ - new Component[]{showPartLabel, showPartComboBox, showPartPane}, - new Component[]{hideTypeLabel, textOverflowTypeComboBox, null} - }; - JPanel textOverflowComPane = TableLayoutHelper.createTableLayoutPane(textOverflowComponents, new double[]{p, p}, new double[]{p, f, p}); - textOverflowComPane.setVisible(false); - textOverflowCheckBox = new UICheckBox(Toolkit.i18nText("Fine-Design_Report_CellWrite_TextOverflow_HideWhenOverflow")); - textOverflowCheckBox.addItemListener(new ItemListener() { - @Override - public void itemStateChanged(ItemEvent e) { - textOverflowComPane.setVisible(e.getStateChange() == ItemEvent.SELECTED); - if (e.getStateChange() == ItemEvent.SELECTED) { - if (showPartComboBox.getSelectedIndex() == 0) { - showPartPane.setPreferredSize(new Dimension(70, 20)); - showPartLayout.show(showPartPane, "content"); - } else { - showPartLayout.show(showPartPane, "none"); - showPartPane.setPreferredSize(new Dimension(0, 0)); - } - noAutoRadioButton.setSelected(true); - } - } - }); - JPanel dynamicPaneWrapper = FRGUIPaneFactory.createBorderLayout_S_Pane(); - dynamicPaneWrapper.add(textOverflowComPane); - JPanel textOverflowPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); - textOverflowPane.add(textOverflowCheckBox, BorderLayout.NORTH); - textOverflowPane.add(dynamicPaneWrapper, BorderLayout.CENTER); - textOverflowPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0)); - return textOverflowPane; - } - private JPanel createSeniorCheckPane() { previewCellContent.setBorder(UIConstants.CELL_ATTR_ZEROBORDER); printAndExportContent.setBorder(UIConstants.CELL_ATTR_ZEROBORDER); @@ -461,11 +371,6 @@ public class CellOtherSetPane extends AbstractCellAttrPane { insertRowPolicyButtonGroup.setGlobalName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_CellWrite_InsertRow_Policy")); valueEditor.setGlobalName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_CellWrite_InsertRow_Policy")); pageFixedRowDataCheckBox.setGlobalName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_CellWrite_Page_Fixed_Row_Cell")); - tooltipButtonGroup.setGlobalName(Toolkit.i18nText("Fine-Design_Report_CellWrite_ToolTip_Button_Group")); - textOverflowCheckBox.setGlobalName(Toolkit.i18nText("Fine-Design_Report_CellWrite_TextOverflow_HideWhenOverflow")); - showPartComboBox.setGlobalName(Toolkit.i18nText("Fine-Design_Report_CellWrite_TextOverflow_ShowPart")); - showCharNums.setGlobalName(Toolkit.i18nText("Fine-Design_Report_CellWrite_TextOverflow_Nums")); - textOverflowTypeComboBox.setGlobalName(Toolkit.i18nText("Fine-Design_Report_CellWrite_TextOverflow_HideType")); } @@ -524,40 +429,7 @@ public class CellOtherSetPane extends AbstractCellAttrPane { } else { showContent.setSelectedItem(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Default")); } - if (cellGUIAttr.isCustomTooltip()) { - tooltipButtonGroup.setSelectedIndex(0); - tooltipTextField.setText(cellGUIAttr.getTooltipText()); - } else { - tooltipButtonGroup.setSelectedIndex(1); - } - if (tooltipButtonGroup.getSelectedIndex() == 0) { - tooltipPane.setPreferredSize(new Dimension(100, 20)); - tooltipLayout.show(tooltipPane, "content"); - } else { - tooltipLayout.show(tooltipPane, "none"); - tooltipPane.setPreferredSize(new Dimension(0, 0)); - } - tooltipPane.setVisible(true); - if (cellGUIAttr.isHideTextWhenOverflow()) { - textOverflowCheckBox.setSelected(true); - if (cellGUIAttr.isShowCharNum()) { - showPartComboBox.setSelectedIndex(0); - showCharNums.setValue(cellGUIAttr.getShowCharNums()); - } else { - showPartComboBox.setSelectedIndex(1); - } - showPartPane.setVisible(true); - if (cellGUIAttr.isTextOverflowEllipsis()) { - textOverflowTypeComboBox.setSelectedItem(Toolkit.i18nText("Fine-Design_Report_CellWrite_TextOverflow_Ellipsis")); - } else { - textOverflowTypeComboBox.setSelectedItem(Toolkit.i18nText("Fine-Design_Report_CellWrite_TextOverflow_NoneSymbol")); - } - } else { - showPartComboBox.setSelectedIndex(0); - showCharNums.setValue(cellGUIAttr.getShowCharNums()); - textOverflowTypeComboBox.setSelectedIndex(0); - textOverflowCheckBox.setSelected(false); - } + tooltipTextField.setText(cellGUIAttr.getTooltipText()); CellPageAttr cellPageAttr = cellElement.getCellPageAttr(); // 分页 if (cellPageAttr == null) { cellPageAttr = new CellPageAttr(); @@ -649,18 +521,7 @@ public class CellOtherSetPane extends AbstractCellAttrPane { cellGUIAttr.setFileName(fileNameTextField.getText()); } } - if (ComparatorUtils.equals(getGlobalName(), Toolkit.i18nText("Fine-Design_Report_CellWrite_ToolTip_Button_Group"))) { - cellGUIAttr.setCustomTooltip(tooltipButtonGroup.getSelectedIndex() == 0); - if (tooltipButtonGroup.getSelectedIndex() == 0) { - if (tooltipTextField.getText() == null || tooltipTextField.getText().trim().length() <= 0) { - cellGUIAttr.setTooltipText(fieldName); - } else { - cellGUIAttr.setTooltipText(tooltipTextField.getText()); - } - } else if (tooltipButtonGroup.getSelectedIndex() == 1) { - cellGUIAttr.setTooltipText("=$$$"); - } - } + if (ComparatorUtils.equals(getGlobalName(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_CellWrite_ToolTip"))) { if (tooltipTextField.getText() == null || tooltipTextField.getText().trim().length() <= 0) { cellGUIAttr.setTooltipText(fieldName); @@ -668,18 +529,6 @@ public class CellOtherSetPane extends AbstractCellAttrPane { cellGUIAttr.setTooltipText(tooltipTextField.getText()); } } - if (ComparatorUtils.equals(getGlobalName(), Toolkit.i18nText("Fine-Design_Report_CellWrite_TextOverflow_HideWhenOverflow"))) { - cellGUIAttr.setHideTextWhenOverflow(textOverflowCheckBox.isSelected()); - } - if (ComparatorUtils.equals(getGlobalName(), Toolkit.i18nText("Fine-Design_Report_CellWrite_TextOverflow_ShowPart"))) { - cellGUIAttr.setShowCharNum(showPartComboBox.getSelectedIndex() == 0); - } - if (ComparatorUtils.equals(getGlobalName(), Toolkit.i18nText("Fine-Design_Report_CellWrite_TextOverflow_Nums"))) { - cellGUIAttr.setShowCharNums((int) showCharNums.getValue()); - } - if (ComparatorUtils.equals(getGlobalName(), Toolkit.i18nText("Fine-Design_Report_CellWrite_TextOverflow_HideType"))) { - cellGUIAttr.setTextOverflowEllipsis(textOverflowTypeComboBox.getSelectedIndex() == 0); - } // 如果与默认的CellGUIAttr相同,就不用保存这个属性了 if (ComparatorUtils.equals(cellGUIAttr, CellGUIAttr.DEFAULT_CELLGUIATTR)) { cellElement.setCellGUIAttr(cellNullGUIAttr); From a01d78599f7744f4c801de968566bd73f57cb9a4 Mon Sep 17 00:00:00 2001 From: Starryi Date: Tue, 15 Feb 2022 15:41:45 +0800 Subject: [PATCH 7/8] =?UTF-8?q?REPORT-66465=20=E3=80=90=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E5=95=86=E5=9F=8E=E9=A3=8E=E6=A0=BC=E4=BC=98=E5=8C=96=E3=80=91?= =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E5=99=A8=E5=95=86=E5=9F=8E=EF=BC=8C=E6=A6=82?= =?UTF-8?q?=E7=8E=87=E6=89=93=E5=BC=80=E7=A9=BA=E7=99=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【问题原因】 调试模式下禁止HTTPS证书验证,使得商城测试服务器 可以正常访问 【改动思路】 同上 --- .../fr/design/ui/compatible/NewModernUIPane.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/designer-base/src/main/java/com/fr/design/ui/compatible/NewModernUIPane.java b/designer-base/src/main/java/com/fr/design/ui/compatible/NewModernUIPane.java index d755d4e05f..0b56fc0ad6 100644 --- a/designer-base/src/main/java/com/fr/design/ui/compatible/NewModernUIPane.java +++ b/designer-base/src/main/java/com/fr/design/ui/compatible/NewModernUIPane.java @@ -17,8 +17,11 @@ import com.teamdev.jxbrowser.engine.EngineOptions; import com.teamdev.jxbrowser.engine.RenderingMode; import com.teamdev.jxbrowser.event.Observer; import com.teamdev.jxbrowser.js.JsObject; +import com.teamdev.jxbrowser.net.Network; import com.teamdev.jxbrowser.net.Scheme; +import com.teamdev.jxbrowser.net.callback.VerifyCertificateCallback; import com.teamdev.jxbrowser.view.swing.BrowserView; +import org.jetbrains.annotations.Nullable; import java.awt.BorderLayout; @@ -108,6 +111,17 @@ public class NewModernUIPane extends ModernUIPane { } Engine engine = Engine.newInstance(builder.build()); + if (DesignerEnvManager.getEnvManager().isOpenDebug()) { + // 调试模式下,禁止HTTPS证书验证,使得可以正常访问商城测试服务器等 + Network network = engine.network(); + network.set(VerifyCertificateCallback.class, new VerifyCertificateCallback() { + @Nullable + @Override + public Response on(Params params) { + return VerifyCertificateCallback.Response.valid(); + } + }); + } browser = engine.newBrowser(); // 初始化的时候,就把命名空间对象初始化好,确保window.a.b.c("a.b.c"为命名空间)对象都是初始化过的 From 50754f75d2611da9e5265d3eaa819b3b073083ae Mon Sep 17 00:00:00 2001 From: Starryi Date: Tue, 15 Feb 2022 17:08:04 +0800 Subject: [PATCH 8/8] =?UTF-8?q?REPORT-66807=20Mini=E5=95=86=E5=9F=8E?= =?UTF-8?q?=E7=AA=97=E5=8F=A3=E5=90=AF=E5=8A=A8=E6=9D=A5=E6=BA=90=E5=9F=8B?= =?UTF-8?q?=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【问题原因】 区分不同的启动来源,便于埋点分析 【改动思路】 同上 --- .../design/mainframe/share/ui/online/OnlineWidgetTabPane.java | 2 +- .../share/ui/online/mini/MiniComponentShopDialog.java | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/OnlineWidgetTabPane.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/OnlineWidgetTabPane.java index 1ab2cec121..cfa5d799f1 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/OnlineWidgetTabPane.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/OnlineWidgetTabPane.java @@ -104,7 +104,7 @@ public class OnlineWidgetTabPane extends JPanel { @Override public void actionPerformed(ActionEvent e) { if (OnlineShopUtils.testConnection() && ComponentShareUtil.isShowMiniShopWindow()) { - MiniComponentShopDialog.getInstance().show(); + MiniComponentShopDialog.getInstance().showFromOnlineRepoPane(); FormWidgetDetailPane.getInstance().switch2Local(); FormWidgetDetailPane.getInstance().enterWidgetLib(); } else { diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/mini/MiniComponentShopDialog.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/mini/MiniComponentShopDialog.java index 81bc642b47..817adfa347 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/mini/MiniComponentShopDialog.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/mini/MiniComponentShopDialog.java @@ -110,6 +110,10 @@ public class MiniComponentShopDialog { frame.setVisible(true); } + public void showFromOnlineRepoPane() { + show(); + } + public Container getContentPane() { if (frame != null) { return frame.getContentPane();