From c1cff83604c104472061e8e49cd1e77b652ed00d Mon Sep 17 00:00:00 2001 From: Starryi Date: Thu, 24 Mar 2022 14:49:45 +0800 Subject: [PATCH 1/2] =?UTF-8?q?REPORT-68062=20=E5=8D=95=E5=85=83=E6=A0=BC?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=88=97=E9=AB=98=E7=BA=A7=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?-=E6=A0=BC=E5=BC=8F=E8=AE=BE=E7=BD=AE=E4=B8=8D=E7=94=9F?= =?UTF-8?q?=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【问题原因】 DSColumnAdvancedPane.FormatAttrPane, 未继承AbstractAttrNoScrollPane,缺少了一些监听导致。 原有代码在合并时丢失,需要重新补充下 【改动思路】 无 【review建议】 --- .../design/dscolumn/DSColumnAdvancedPane.java | 63 ++++++++++++++++--- 1 file changed, 54 insertions(+), 9 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/dscolumn/DSColumnAdvancedPane.java b/designer-realize/src/main/java/com/fr/design/dscolumn/DSColumnAdvancedPane.java index 32818de9f7..91c8fa292c 100644 --- a/designer-realize/src/main/java/com/fr/design/dscolumn/DSColumnAdvancedPane.java +++ b/designer-realize/src/main/java/com/fr/design/dscolumn/DSColumnAdvancedPane.java @@ -1,16 +1,14 @@ package com.fr.design.dscolumn; import com.fr.base.BaseFormula; -import com.fr.data.util.SortOrder; import com.fr.design.border.UITitledBorder; -import com.fr.design.constants.LayoutConstants; import com.fr.design.data.DesignTableDataManager; import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.formula.CustomVariableResolver; import com.fr.design.formula.FormulaFactory; -import com.fr.design.formula.SortFormulaPane; import com.fr.design.formula.UIFormula; +import com.fr.design.gui.frpane.AbstractAttrNoScrollPane; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icombobox.UIComboBox; @@ -30,11 +28,19 @@ import com.fr.report.cell.cellattr.CellExpandAttr; import com.fr.report.cell.cellattr.core.group.DSColumn; import com.fr.report.cell.cellattr.core.group.SelectCount; -import javax.swing.*; -import java.awt.*; +import javax.swing.BorderFactory; +import javax.swing.Box; +import javax.swing.JComponent; +import javax.swing.JPanel; +import javax.swing.SwingUtilities; +import java.awt.BorderLayout; +import java.awt.CardLayout; +import java.awt.Component; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.Font; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; -import java.util.Arrays; import static com.fr.report.cell.cellattr.core.group.FilterTypeEnum.BOTTOM; import static com.fr.report.cell.cellattr.core.group.FilterTypeEnum.SPECIFY; @@ -512,11 +518,12 @@ public class DSColumnAdvancedPane extends BasicPane { } } - public static class FormatAttrPane extends TextFormatPane { + + public static class ReLayoutTextFormatPane extends TextFormatPane { protected void initLayout() { - JComponent[][] components = new JComponent[][]{{typeComboBox, textField, roundingBox}}; - double[] rowSize = new double[]{TableLayout.FILL}; + JComponent[][] components = new JComponent[][] { {typeComboBox, textField, roundingBox} }; + double[] rowSize = new double[] { TableLayout.FILL }; double[] columnSize = {TableLayout.PREFERRED, 200, TableLayout.PREFERRED}; JPanel settingPane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, 4, 0); @@ -542,6 +549,44 @@ public class DSColumnAdvancedPane extends BasicPane { } } + public static class FormatAttrPane extends AbstractAttrNoScrollPane { + private TextFormatPane formatPane; + + @Override + protected JPanel createContentPane() { + this.formatPane = new ReLayoutTextFormatPane(); + return this.formatPane; + } + + @Override + public Dimension getPreferredSize() { + if (formatPane == null) { + return super.getPreferredSize(); + } + return formatPane.getPreferredSize(); + } + + protected void initContentPane() { + leftContentPane = createContentPane(); + if (leftContentPane != null) { + leftContentPane.setBorder(BorderFactory.createEmptyBorder()); + this.add(leftContentPane, BorderLayout.CENTER); + } + } + + public void populate(CellElement cellElement) { + if (cellElement != null && formatPane != null) { + formatPane.populateBean(cellElement.getStyle()); + } + } + + public void update(CellElement cellElement) { + if (cellElement != null && formatPane != null) { + cellElement.setStyle(formatPane.update(cellElement.getStyle())); + } + } + } + private void checkButtonEnabled() { if (useMultiplyNumCheckBox.isSelected()) { multiNumSpinner.setEnabled(true); From 71cd9c679ea40fc7c43373a830ec8a83710ecb74 Mon Sep 17 00:00:00 2001 From: Starryi Date: Thu, 24 Mar 2022 15:11:02 +0800 Subject: [PATCH 2/2] =?UTF-8?q?REPORT-68127=20=E3=80=90=E4=B8=93=E9=A2=98?= =?UTF-8?q?=E3=80=91jdk11=E7=9A=84=E8=AE=BE=E8=AE=A1=E5=99=A8=E7=94=A8bat?= =?UTF-8?q?=E8=84=9A=E6=9C=AC=E5=90=AF=E5=8A=A8=E5=A4=B1=E8=B4=A5=EF=BC=8C?= =?UTF-8?q?exe=E5=90=AF=E5=8A=A8=E6=AD=A3=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【问题原因】 Reflect.on方法会抛出异常,需要主动catch 【改动思路】 无 【review建议】 --- .../Install4jStartupNotificationProvider.java | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 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 5402032f94..b239698897 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 @@ -22,14 +22,22 @@ public class Install4jStartupNotificationProvider implements FineStartupNotifica @Override public void registerStartupListener(Listener listener) { - Class StartupNotificationListenerClass = Reflect.on("com.install4j.api.launcher.StartupNotification$Listener").type(); + Class StartupNotificationListenerClass = null; + try { + StartupNotificationListenerClass = Reflect.on("com.install4j.api.launcher.StartupNotification$Listener").type(); + } catch (Exception ignored) { + } + 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); + try { + Reflect.on("com.install4j.api.launcher.StartupNotification").call("registerStartupListener", listenerCallbackInstance); + } catch (Exception ignored) { + } } private static class ListenerHandler implements InvocationHandler { @@ -48,4 +56,13 @@ public class Install4jStartupNotificationProvider implements FineStartupNotifica return null; } } + + public static void main(String[] args) { + Install4jStartupNotificationProvider.getInstance().registerStartupListener(new Listener() { + @Override + public void startupPerformed(String parameters) { + + } + }); + } }