From aa34194900409a2a803958dfa18ce14464ca137d Mon Sep 17 00:00:00 2001 From: "Yuan.Wang" <1536296691@qq.com> Date: Fri, 4 Mar 2022 10:07:00 +0800 Subject: [PATCH 1/8] =?UTF-8?q?REPORT-67224=20=E5=A1=AB=E6=8A=A5-web?= =?UTF-8?q?=E7=AB=AF=E5=86=8D=E8=AE=A1=E7=AE=97-=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E5=99=A8=E9=85=8D=E7=BD=AE=E5=A1=AB=E6=8A=A5=E8=A1=8C=E8=83=8C?= =?UTF-8?q?=E6=99=AF=E8=89=B2=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/webattr/WriteWebSettingPane.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/design/webattr/WriteWebSettingPane.java b/designer-realize/src/main/java/com/fr/design/webattr/WriteWebSettingPane.java index 6636c22146..3db3da6d7f 100644 --- a/designer-realize/src/main/java/com/fr/design/webattr/WriteWebSettingPane.java +++ b/designer-realize/src/main/java/com/fr/design/webattr/WriteWebSettingPane.java @@ -4,6 +4,7 @@ import com.fr.base.BaseUtils; import com.fr.design.ExtraDesignClassManager; import com.fr.design.gui.core.WidgetOption; import com.fr.design.gui.ibutton.UIColorButton; +import com.fr.design.gui.ibutton.UINoThemeColorButton; import com.fr.design.gui.ibutton.UIRadioButton; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.ilable.UILabel; @@ -44,7 +45,7 @@ public class WriteWebSettingPane extends WebSettingPane { protected JPanel createOtherSetPane() { colorBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Set_Background_Of_Current_Row") + ":"); colorBox.setSelected(true); - colorButton = new UIColorButton(BaseUtils.readIcon("/com/fr/design/images/gui/color/background.png")); + colorButton = new UINoThemeColorButton(BaseUtils.readIcon("/com/fr/design/images/gui/color/background.png")); colorBox.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { colorButton.setEnabled(colorBox.isSelected()); From fd1e35aaa194d8f471ec66e2295c5e66f59b6afd Mon Sep 17 00:00:00 2001 From: Starryi Date: Wed, 9 Mar 2022 12:07:30 +0800 Subject: [PATCH 2/8] =?UTF-8?q?=E6=97=A0JIRA=E9=A1=B9=E7=9B=AE=20=E5=AF=B9?= =?UTF-8?q?Install4j=E6=96=B9=E6=B3=95=E7=9A=84=E8=B0=83=E7=94=A8=E5=85=A8?= =?UTF-8?q?=E9=83=A8=E6=94=B9=E7=94=A8=E5=8F=8D=E5=B0=84=E5=AE=9E=E7=8E=B0?= =?UTF-8?q?=EF=BC=8C=E9=81=BF=E5=85=8D=E5=87=BA=E7=8E=B0=E5=BC=95=E7=94=A8?= =?UTF-8?q?=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【问题原因】 考核同学使用starter项目,无法进行正常编译,出现类和方法调用异常。 一方面是starter项目没有配置对intall4j的编译依赖导致,另一方面是主jar中 对install4j API的使用没有反射导致 【改动思路】 改用反射方式调用Install4J相关API 【review建议】 --- .../Install4jStartupNotificationProvider.java | 42 +++++++++++++------ 1 file changed, 29 insertions(+), 13 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/startup/Install4jStartupNotificationProvider.java b/designer-base/src/main/java/com/fr/design/startup/Install4jStartupNotificationProvider.java index dbc7be2b72..5402032f94 100644 --- a/designer-base/src/main/java/com/fr/design/startup/Install4jStartupNotificationProvider.java +++ b/designer-base/src/main/java/com/fr/design/startup/Install4jStartupNotificationProvider.java @@ -1,6 +1,10 @@ package com.fr.design.startup; -import com.install4j.api.launcher.StartupNotification; +import com.fr.invoke.Reflect; + +import java.lang.reflect.InvocationHandler; +import java.lang.reflect.Method; +import java.lang.reflect.Proxy; /** * @author Starryi @@ -18,18 +22,30 @@ public class Install4jStartupNotificationProvider implements FineStartupNotifica @Override public void registerStartupListener(Listener listener) { - boolean supported = false; - try { - supported = Class.forName("com.install4j.api.launcher.StartupNotification") != null; - } catch (Throwable ignored) {} - - if (supported) { - StartupNotification.registerStartupListener(new StartupNotification.Listener() { - @Override - public void startupPerformed(String parameters) { - listener.startupPerformed(parameters); - } - }); + Class StartupNotificationListenerClass = Reflect.on("com.install4j.api.launcher.StartupNotification$Listener").type(); + if (StartupNotificationListenerClass == null) { + return; + } + + ListenerHandler mHandler = new ListenerHandler(listener); + Object listenerCallbackInstance = Proxy.newProxyInstance(this.getClass().getClassLoader(), new Class[] { StartupNotificationListenerClass }, mHandler); + Reflect.on("com.install4j.api.launcher.StartupNotification").call("registerStartupListener", listenerCallbackInstance); + } + + private static class ListenerHandler implements InvocationHandler { + private final Listener listener; + + public ListenerHandler(Listener listener) { + this.listener = listener; + } + + @Override + public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { + if (args[0] instanceof String) { + String parameters = (String) args[0]; + listener.startupPerformed(parameters); + } + return null; } } } From 6394044df6f4f02d3cd61bbecb523de468acbe0a Mon Sep 17 00:00:00 2001 From: kerry Date: Thu, 10 Mar 2022 16:41:58 +0800 Subject: [PATCH 3/8] =?UTF-8?q?REPORT-67329=20=E5=A1=AB=E6=8A=A5-web?= =?UTF-8?q?=E7=AB=AF=E9=A2=84=E8=A7=88-10=E5=8D=87=E7=BA=A711=EF=BC=8C?= =?UTF-8?q?=E9=80=8F=E6=98=8E=E7=9A=84=E7=BA=B8=E5=BC=A0=E8=83=8C=E6=99=AF?= =?UTF-8?q?=E5=8F=98=E6=88=90=E4=BA=86=E7=99=BD=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gui/style/ReportBackgroundSpecialPane.java | 2 +- .../backgroundpane/ColorBackgroundQuickPane.java | 9 ++++++--- .../fr/design/style/color/NewColorSelectBox.java | 13 ++++++++++--- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/style/ReportBackgroundSpecialPane.java b/designer-base/src/main/java/com/fr/design/gui/style/ReportBackgroundSpecialPane.java index aeb2938a27..257e090c20 100644 --- a/designer-base/src/main/java/com/fr/design/gui/style/ReportBackgroundSpecialPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/style/ReportBackgroundSpecialPane.java @@ -29,7 +29,7 @@ public class ReportBackgroundSpecialPane extends BackgroundPane { protected BackgroundQuickPane[] supportKindsOfBackgroundUI() { NullBackgroundQuickPane nullBackgroundPane = new NullBackgroundQuickPane(); - ColorBackgroundQuickPane colorBackgroundPane = new ColorBackgroundQuickPane(); + ColorBackgroundQuickPane colorBackgroundPane = new ColorBackgroundQuickPane(true); colorBackgroundPane.registerChangeListener(new UIObserverListener() { @Override public void doChange() { diff --git a/designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/ColorBackgroundQuickPane.java b/designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/ColorBackgroundQuickPane.java index 9d9eb0058c..086a07da48 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/ColorBackgroundQuickPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/ColorBackgroundQuickPane.java @@ -16,10 +16,9 @@ public class ColorBackgroundQuickPane extends BackgroundQuickPane { private NewColorSelectBox colorSelectBox; - - public ColorBackgroundQuickPane() { + public ColorBackgroundQuickPane(boolean supportTransparent) { this.setLayout(FRGUIPaneFactory.createBorderLayout()); - colorSelectBox = new NewColorSelectBox(100) { + colorSelectBox = new NewColorSelectBox(100, supportTransparent) { @Override public boolean shouldResponseChangeListener() { // ColorBackgroundQuickPane注册监听器ChangeListenerImpl的逻辑不能丢,因为里面有修改字段backgroundChange的逻辑. @@ -33,6 +32,10 @@ public class ColorBackgroundQuickPane extends BackgroundQuickPane { this.add(colorSelectBox, BorderLayout.NORTH); } + public ColorBackgroundQuickPane() { + this(false); + } + public void populateBean(Background background) { ColorBackground colorBackgroud = (ColorBackground) background; populateColor(colorBackgroud.getColor()); diff --git a/designer-base/src/main/java/com/fr/design/style/color/NewColorSelectBox.java b/designer-base/src/main/java/com/fr/design/style/color/NewColorSelectBox.java index 04d368e6bc..59ef1e6e43 100644 --- a/designer-base/src/main/java/com/fr/design/style/color/NewColorSelectBox.java +++ b/designer-base/src/main/java/com/fr/design/style/color/NewColorSelectBox.java @@ -20,13 +20,20 @@ public class NewColorSelectBox extends AbstractSelectBox implements UIObs private static final long serialVersionUID = 2782150678943960557L; private Color color; - private NewColorSelectPane colorPane = new NewColorSelectPane(false); + private NewColorSelectPane colorPane; private UIObserverListener uiObserverListener; private String newColorSelectBoxName = ""; private GlobalNameListener globalNameListener = null; + private boolean supportTransparent; public NewColorSelectBox(int preferredWidth) { - initBox(preferredWidth); + this(preferredWidth, false); + } + + public NewColorSelectBox(int preferredWidth, boolean supportTransparent) { + this.colorPane = new NewColorSelectPane(supportTransparent); + this.supportTransparent = supportTransparent; + initBox(preferredWidth); iniListener(); } @@ -58,7 +65,7 @@ public class NewColorSelectBox extends AbstractSelectBox implements UIObs */ public JPanel initWindowPane(double preferredWidth) { // 下拉的时候重新生成面板,以刷新最近使用颜色 - colorPane = new NewColorSelectPane(false); + colorPane = new NewColorSelectPane(this.supportTransparent); colorPane.setColor(this.getSelectObject()); colorPane.addChangeListener(new ChangeListener() { public void stateChanged(ChangeEvent e) { From b26a85d3f668ffe41d402d7089420744ec45acd9 Mon Sep 17 00:00:00 2001 From: rinoux Date: Fri, 18 Mar 2022 11:27:12 +0800 Subject: [PATCH 4/8] =?UTF-8?q?REPORT-67954=20=E8=BF=9C=E7=A8=8B=E8=AE=BE?= =?UTF-8?q?=E8=AE=A1=E6=97=B6=E6=95=B0=E6=8D=AE=E9=9B=86=E9=9D=A2=E6=9D=BF?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E8=BF=9E=E6=8E=A5=E7=A9=BA=E7=99=BD=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98=20=E6=8F=90=E4=BA=A411?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../datapane/connect/ConnectionComboBoxPanel.java | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionComboBoxPanel.java b/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionComboBoxPanel.java index 3b5aebed9e..fe69024a82 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionComboBoxPanel.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionComboBoxPanel.java @@ -10,11 +10,10 @@ import com.fr.design.editlock.EditLockUtils; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UILockButton; import com.fr.file.ConnectionConfig; -import com.fr.general.ComparatorUtils; +import com.fr.report.LockItem; import com.fr.stable.StringUtils; import com.fr.workspace.WorkContext; import com.fr.workspace.server.connection.DBConnectAuth; -import com.fr.report.LockItem; import javax.swing.SwingUtilities; import java.awt.Dimension; @@ -96,6 +95,7 @@ public class ConnectionComboBoxPanel extends ItemEditableComboBoxPanel { continue; } Connection connection = mgr.getConnection(conName); + // nameList依赖items方法初始化,父类ItemEditableComboBoxPanel里异步执行item方法 filterConnection(connection, conName, nameList); } @@ -140,12 +140,10 @@ public class ConnectionComboBoxPanel extends ItemEditableComboBoxPanel { } else { String s = DesignerEnvManager.getEnvManager().getRecentSelectedConnection(); if (StringUtils.isNotBlank(s)) { - for (int i = 0; i < this.getConnectionSize(); i++) { - String t = this.getConnection(i); - if (ComparatorUtils.equals(s, t)) { - this.setSelectedItem(s); - break; - } + // 之前的写法有多线程问题,nameList异步尚未初始化完成的时候,这里可能无法匹配设置数据连接名称,导致DBTableDataPane打开后连接面板空白 + // 这里的需求无非是设置上一次使用的数据连接,做个简单检查这个连接是否存在即可,存在就设置 + if (ConnectionConfig.getInstance().getConnection(s) != null) { + this.setSelectedItem(s); } } // alex:如果这个ComboBox还是没有选中,那么选中第一个 From cad840da238e03d6dc86df14077dcd62d65b4cf7 Mon Sep 17 00:00:00 2001 From: hades Date: Fri, 18 Mar 2022 15:25:18 +0800 Subject: [PATCH 5/8] =?UTF-8?q?REPORT-67833=20=E5=AF=8C=E6=96=87=E6=9C=AC-?= =?UTF-8?q?=E9=A2=9C=E8=89=B2=E8=AE=BE=E7=BD=AE=EF=BC=9A=E9=80=89=E6=8B=A9?= =?UTF-8?q?=E4=B8=BB=E9=A2=98=E8=89=B2=E5=90=8E=E6=9C=80=E8=BF=91=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E7=9A=84=E9=A2=9C=E8=89=B2=E5=A4=84=E4=B8=8D=E4=BC=9A?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=EF=BC=8C=E9=9C=80=E8=A6=81=E5=A4=9A=E6=AC=A1?= =?UTF-8?q?=E7=82=B9=E5=87=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/style/color/ColorCell.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/style/color/ColorCell.java b/designer-base/src/main/java/com/fr/design/style/color/ColorCell.java index 4cc3e41cea..acc26ca5aa 100644 --- a/designer-base/src/main/java/com/fr/design/style/color/ColorCell.java +++ b/designer-base/src/main/java/com/fr/design/style/color/ColorCell.java @@ -100,11 +100,13 @@ public class ColorCell extends JComponent implements ColorSelectable { if (e == null || e.getID() == MouseEvent.MOUSE_RELEASED) { colorSelectable.setColor(this.getColor()); - colorSelectable.colorSetted(this); + // 先添加最近使用 if (this.getColor() != null) { int rgb = this.getColor().getRGB(); DesignerEnvManager.getEnvManager().getColorConfigManager().addToColorQueue(new Color(rgb)); } + // 这边会获取到最近使用颜色并更新 添加逻辑需要放到前面 否则不会及时更新 + colorSelectable.colorSetted(this); } if (e != null) { From 39b29d40664f9bd7041073c5c3c6cdb54ff10ba2 Mon Sep 17 00:00:00 2001 From: pengda Date: Fri, 18 Mar 2022 17:02:10 +0800 Subject: [PATCH 6/8] =?UTF-8?q?REPORT-68059=20js=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E5=99=A8=EF=BC=8C=E8=87=AA=E5=AE=9A=E4=B9=89=E6=8C=89=E9=92=AE?= =?UTF-8?q?=E8=A7=A6=E5=8F=91=E7=9A=84=E5=BC=B9=E7=AA=97=E5=B1=82=E7=BA=A7?= =?UTF-8?q?=E4=B8=8D=E5=AF=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/javascript/JavaScriptActionPane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/javascript/JavaScriptActionPane.java b/designer-base/src/main/java/com/fr/design/javascript/JavaScriptActionPane.java index 999a1a0295..e2f8dd9067 100644 --- a/designer-base/src/main/java/com/fr/design/javascript/JavaScriptActionPane.java +++ b/designer-base/src/main/java/com/fr/design/javascript/JavaScriptActionPane.java @@ -42,7 +42,7 @@ public abstract class JavaScriptActionPane extends UIComboBoxPane { protected List> initPaneList() { List> paneList = new ArrayList>(); // JS脚本,表单提交,提交入库,流程管理,发送邮件. 703中去掉表单提交和流程管理 - paneList.add(new JavaScriptImplPane(getDefaultArgs())); + paneList.add(new JavaScriptImplPane(getDefaultArgs(),true)); // paneList.add(new FormSubmitJavaScriptPane(this)); contentDBManiPane = new ArrayList(); contentDBManiPane.add(createDBManipulationPane()); From 47caddcba06f1c88965c87eaec66d5a4a45fa6e6 Mon Sep 17 00:00:00 2001 From: pengda Date: Mon, 21 Mar 2022 16:00:33 +0800 Subject: [PATCH 7/8] =?UTF-8?q?CHART-22994=20=E5=9B=BE=E8=A1=A8=E8=83=8C?= =?UTF-8?q?=E6=99=AF=E8=89=B2=E6=8E=A7=E4=BB=B6=E9=9C=80=E8=A6=81=E6=9B=B4?= =?UTF-8?q?=E6=8D=A2=E4=B8=BA=E6=94=AF=E6=8C=81=E9=80=8F=E6=98=8E=E8=89=B2?= =?UTF-8?q?=E7=9A=84=E6=8E=A7=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../background/VanChartBackgroundPaneWithThemeStyle.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/background/VanChartBackgroundPaneWithThemeStyle.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/background/VanChartBackgroundPaneWithThemeStyle.java index dcbb3e6e8d..4cc7751735 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/background/VanChartBackgroundPaneWithThemeStyle.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/background/VanChartBackgroundPaneWithThemeStyle.java @@ -25,7 +25,7 @@ public class VanChartBackgroundPaneWithThemeStyle extends VanChartBackgroundPane } }); paneList.add(new NullBackgroundQuickPane()); - paneList.add(new ColorBackgroundQuickPane()); + paneList.add(new ColorBackgroundQuickPane(true)); paneList.add(new ImageBackgroundQuickPane(false)); paneList.add(new VanChartGradientPane()); } From 9ad9cf5de1a4758cdc61621532455df8ed408609 Mon Sep 17 00:00:00 2001 From: shine Date: Tue, 22 Mar 2022 16:41:52 +0800 Subject: [PATCH 8/8] =?UTF-8?q?CHART-23245=20fix:=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E9=94=81=E5=AE=9A=E5=A4=87=E4=BB=BDfvs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/mainframe/JTemplate.java | 11 +++++++++++ .../main/java/com/fr/design/utils/TemplateUtils.java | 12 +++--------- 2 files changed, 14 insertions(+), 9 deletions(-) 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 f37b817e99..6c9406a8b9 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 @@ -1016,6 +1016,17 @@ public abstract class JTemplate> } } + public byte[] exportData() throws Exception { + try (ByteArrayOutputStream outputStream = new ByteArrayOutputStream()) { + BaseBook target = getTarget(); + if (target != null) { + target.export(outputStream); + return outputStream.toByteArray(); + } + } + return new byte[0]; + } + protected boolean export() throws Exception { return this.getTarget().export(TemplateResourceManager.getResource().saveTemplate(getEditingFILE())); diff --git a/designer-base/src/main/java/com/fr/design/utils/TemplateUtils.java b/designer-base/src/main/java/com/fr/design/utils/TemplateUtils.java index 2fac1e903e..a84c260c36 100644 --- a/designer-base/src/main/java/com/fr/design/utils/TemplateUtils.java +++ b/designer-base/src/main/java/com/fr/design/utils/TemplateUtils.java @@ -1,7 +1,6 @@ package com.fr.design.utils; import com.fr.base.extension.FileExtension; -import com.fr.base.io.BaseBook; import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.file.TemplateTreePane; import com.fr.design.i18n.Toolkit; @@ -17,9 +16,9 @@ import com.fr.stable.CoreConstants; import com.fr.stable.ProductConstants; import com.fr.workspace.WorkContext; import com.fr.workspace.server.lock.TplOperator; -import java.io.ByteArrayOutputStream; -import java.io.OutputStream; + import javax.swing.SwingWorker; +import java.io.OutputStream; /** * @author hades @@ -65,12 +64,7 @@ public class TemplateUtils { if (!needOpen) { // 从当前编辑模板中生成备份文件 JTemplate template = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); - ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); - BaseBook target = template.getTarget(); - if (target != null) { - target.export(outputStream); - content = outputStream.toByteArray(); - } + content = template.exportData(); } else { content = WorkContext.getWorkResource().readFully(oldPath); }