From 9f64eed1acd1dab96b8859aac07f3227299b5295 Mon Sep 17 00:00:00 2001 From: Zhanying <2446962908@qq.com> Date: Mon, 6 Jan 2025 10:22:21 +0800 Subject: [PATCH 01/25] =?UTF-8?q?feat:=20fvs=E8=A1=A8=E6=A0=BC-=E8=B6=85?= =?UTF-8?q?=E9=93=BE-=E7=A7=BB=E5=8A=A8=E7=AB=AF=E5=BC=B9=E7=AA=97?= =?UTF-8?q?=E6=94=AF=E6=8C=81get=20post=E8=AE=BE=E7=BD=AE=20#REPORT-145535?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hyperlink/popup/ContentSettingPane.java | 40 +++++++++++++++++-- 1 file changed, 37 insertions(+), 3 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/hyperlink/popup/ContentSettingPane.java b/designer-base/src/main/java/com/fr/design/hyperlink/popup/ContentSettingPane.java index 848ac9e57c..6ecd6c1865 100644 --- a/designer-base/src/main/java/com/fr/design/hyperlink/popup/ContentSettingPane.java +++ b/designer-base/src/main/java/com/fr/design/hyperlink/popup/ContentSettingPane.java @@ -3,6 +3,7 @@ package com.fr.design.hyperlink.popup; import com.fr.base.BaseFormula; import com.fr.base.BaseUtils; import com.fr.base.Parameter; +import com.fr.design.base.mode.DesignModeContext; import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.formula.TinyFormulaPane; @@ -10,6 +11,7 @@ import com.fr.design.gui.frpane.ReportletParameterViewPane; import com.fr.design.gui.ibutton.UIButton; 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.itableeditorpane.UITableEditAction; import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itree.filetree.ReportletPane; @@ -25,8 +27,14 @@ import com.fr.stable.FormulaProvider; import com.fr.stable.ParameterProvider; import com.fr.stable.StringUtils; -import javax.swing.*; -import java.awt.*; +import javax.swing.BorderFactory; +import javax.swing.ButtonGroup; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.SwingUtilities; +import java.awt.BorderLayout; +import java.awt.Dimension; +import java.awt.FlowLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.List; @@ -44,6 +52,7 @@ public class ContentSettingPane extends AbstractHyperLinkPane parameterList = this.parameterViewPane.update(); if (!parameterList.isEmpty()) { Parameter[] parameters = new Parameter[parameterList.size()]; From b5ce0cb7ffd5811541865ace8bc0e5c9fa32f9d7 Mon Sep 17 00:00:00 2001 From: Zhanying <2446962908@qq.com> Date: Tue, 7 Jan 2025 17:39:35 +0800 Subject: [PATCH 02/25] =?UTF-8?q?feat:=20=E9=83=A8=E5=88=86=E9=80=BB?= =?UTF-8?q?=E8=BE=91=E6=8A=BD=E5=88=B0=E6=8F=92=E4=BB=B6=E4=B8=AD=E5=AE=9E?= =?UTF-8?q?=E7=8E=B0=20#REPORT-145535?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fun/DefaultValueAdjustProvider.java | 18 ++++++++++++++++ .../hyperlink/popup/ContentSettingPane.java | 21 +++++++++++++++---- 2 files changed, 35 insertions(+), 4 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/fun/DefaultValueAdjustProvider.java b/designer-base/src/main/java/com/fr/design/fun/DefaultValueAdjustProvider.java index 28a2d6c939..fdeb1edaf3 100644 --- a/designer-base/src/main/java/com/fr/design/fun/DefaultValueAdjustProvider.java +++ b/designer-base/src/main/java/com/fr/design/fun/DefaultValueAdjustProvider.java @@ -5,6 +5,7 @@ import com.fr.base.chart.BaseChartCollection; import com.fr.chartx.attr.ChartProvider; import com.fr.design.style.color.FRColorSelectorStyle; import com.fr.general.FRFont; +import com.fr.js.MobilePopupHyperlink; import com.fr.report.cell.CellElement; import com.fr.stable.collections.combination.Pair; import com.fr.stable.fun.mark.Selectable; @@ -83,4 +84,21 @@ public interface DefaultValueAdjustProvider extends Selectable { default List getColorSelector(){ return FRColorSelectorStyle.COLOR_CONFIG; } + + /** + * 移动端弹窗界面是否支持配置POST传参方式 + * + * @return 是否支持 + */ + default boolean isNeedPostCombo4MobilePopupPane() { + return false; + } + + /** + * 移动端弹窗配置调整 + * + * @param link MobilePopupHyperlink + */ + default void adjustMobilePopupHyperlinkWhenPopulate(MobilePopupHyperlink link) { + } } diff --git a/designer-base/src/main/java/com/fr/design/hyperlink/popup/ContentSettingPane.java b/designer-base/src/main/java/com/fr/design/hyperlink/popup/ContentSettingPane.java index 6ecd6c1865..d1ed4b43ef 100644 --- a/designer-base/src/main/java/com/fr/design/hyperlink/popup/ContentSettingPane.java +++ b/designer-base/src/main/java/com/fr/design/hyperlink/popup/ContentSettingPane.java @@ -3,10 +3,10 @@ package com.fr.design.hyperlink.popup; import com.fr.base.BaseFormula; import com.fr.base.BaseUtils; import com.fr.base.Parameter; -import com.fr.design.base.mode.DesignModeContext; import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.formula.TinyFormulaPane; +import com.fr.design.fun.DefaultValueAdjustProvider; import com.fr.design.gui.frpane.ReportletParameterViewPane; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIRadioButton; @@ -20,6 +20,7 @@ import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.module.DesignModuleFactory; import com.fr.design.parameter.ParameterReader; +import com.fr.design.utils.DesignUtils; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.js.MobilePopupHyperlink; import com.fr.stable.CommonUtils; @@ -121,7 +122,7 @@ public class ContentSettingPane extends AbstractHyperLinkPane Date: Wed, 8 Jan 2025 19:04:13 +0800 Subject: [PATCH 03/25] =?UTF-8?q?feat:=20=E7=A7=BB=E9=99=A4=E7=A7=BB?= =?UTF-8?q?=E5=8A=A8=E7=AB=AF=E5=BC=B9=E7=AA=97=E9=85=8D=E7=BD=AE=E8=B0=83?= =?UTF-8?q?=E6=95=B4=E7=9A=84=E6=8E=A5=E5=8F=A3=E6=96=B9=E6=B3=95=20#REPOR?= =?UTF-8?q?T-145535?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/fun/DefaultValueAdjustProvider.java | 9 --------- .../fr/design/hyperlink/popup/ContentSettingPane.java | 4 ---- 2 files changed, 13 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/fun/DefaultValueAdjustProvider.java b/designer-base/src/main/java/com/fr/design/fun/DefaultValueAdjustProvider.java index fdeb1edaf3..0654c69e11 100644 --- a/designer-base/src/main/java/com/fr/design/fun/DefaultValueAdjustProvider.java +++ b/designer-base/src/main/java/com/fr/design/fun/DefaultValueAdjustProvider.java @@ -5,7 +5,6 @@ import com.fr.base.chart.BaseChartCollection; import com.fr.chartx.attr.ChartProvider; import com.fr.design.style.color.FRColorSelectorStyle; import com.fr.general.FRFont; -import com.fr.js.MobilePopupHyperlink; import com.fr.report.cell.CellElement; import com.fr.stable.collections.combination.Pair; import com.fr.stable.fun.mark.Selectable; @@ -93,12 +92,4 @@ public interface DefaultValueAdjustProvider extends Selectable { default boolean isNeedPostCombo4MobilePopupPane() { return false; } - - /** - * 移动端弹窗配置调整 - * - * @param link MobilePopupHyperlink - */ - default void adjustMobilePopupHyperlinkWhenPopulate(MobilePopupHyperlink link) { - } } diff --git a/designer-base/src/main/java/com/fr/design/hyperlink/popup/ContentSettingPane.java b/designer-base/src/main/java/com/fr/design/hyperlink/popup/ContentSettingPane.java index d1ed4b43ef..41fda2cd3b 100644 --- a/designer-base/src/main/java/com/fr/design/hyperlink/popup/ContentSettingPane.java +++ b/designer-base/src/main/java/com/fr/design/hyperlink/popup/ContentSettingPane.java @@ -225,10 +225,6 @@ public class ContentSettingPane extends AbstractHyperLinkPane Date: Mon, 13 Jan 2025 16:36:58 +0800 Subject: [PATCH 04/25] =?UTF-8?q?fix:=20=E3=80=90=E8=A7=86=E8=A7=89?= =?UTF-8?q?=E9=AA=8C=E6=94=B6=E3=80=91=E6=8F=90=E7=A4=BA=E5=8F=B3=E4=BE=A7?= =?UTF-8?q?=E6=9C=89=E7=A9=BA=E7=BC=BA=EF=BC=8C=E9=9C=80=E8=A6=81=E8=B4=B4?= =?UTF-8?q?=E5=90=88=E6=BB=9A=E5=8A=A8=E6=9D=A1=20#REPORT-146580?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/mainframe/FormArea.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormArea.java b/designer-form/src/main/java/com/fr/design/mainframe/FormArea.java index 314851b0e9..ec0de92fc2 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormArea.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormArea.java @@ -876,7 +876,7 @@ public class FormArea extends JComponent implements ScrollRulerComponent { int designerTop = top + (horScrollBar.getY() - DESIGNERHEIGHT) / 2; if (fvsGuidePane != null) { Dimension fvsGuidePreferredSize = fvsGuidePane.getPreferredSize(); - fvsGuidePane.setBounds(left, top, right - BARSIZE - 2, fvsGuidePreferredSize.height); + fvsGuidePane.setBounds(left, top, DESIGNERWIDTH, fvsGuidePreferredSize.height); DESIGNERHEIGHT -= fvsGuidePreferredSize.height; designerTop += fvsGuidePreferredSize.height; } From 0ebacfddc204c94123d0c941b478a6c57399134d Mon Sep 17 00:00:00 2001 From: obo Date: Thu, 16 Jan 2025 14:37:35 +0800 Subject: [PATCH 05/25] =?UTF-8?q?REPORT-147005=20=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E5=B7=A5=E5=85=B7=E6=A0=8F=E6=94=AF=E6=8C=81=E9=A9=AC?= =?UTF-8?q?=E6=9D=A5=E8=AF=AD=E6=9B=B4=E6=96=B0=E5=8D=87=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/locale/impl/SupportLocaleImpl.java | 1 + 1 file changed, 1 insertion(+) diff --git a/designer-base/src/main/java/com/fr/design/locale/impl/SupportLocaleImpl.java b/designer-base/src/main/java/com/fr/design/locale/impl/SupportLocaleImpl.java index afb14633b5..fc04862b38 100644 --- a/designer-base/src/main/java/com/fr/design/locale/impl/SupportLocaleImpl.java +++ b/designer-base/src/main/java/com/fr/design/locale/impl/SupportLocaleImpl.java @@ -172,6 +172,7 @@ public enum SupportLocaleImpl implements SupportLocale { set.add(Locale.TAIWAN); set.add(LocaleConstants.IN_ID); set.add(LocaleConstants.VI); + set.add(LocaleConstants.MS_MY); return set; } } From d094681bcd0b6325006a338127bf5023d174d3fc Mon Sep 17 00:00:00 2001 From: lidongy <1879087903@qq.com> Date: Wed, 22 Jan 2025 11:20:51 +0800 Subject: [PATCH 06/25] =?UTF-8?q?REPORT-147166=20=E7=BB=9F=E4=BF=A1uos?= =?UTF-8?q?=E4=B8=8B=E5=88=87=E6=8D=A2=E6=9D=A1=E4=BB=B6=E5=B1=9E=E6=80=A7?= =?UTF-8?q?=E5=90=8E=EF=BC=8C=E5=8D=A1=E7=89=87=E4=B8=8D=E8=83=BD=E5=8F=8A?= =?UTF-8?q?=E6=97=B6=E6=9B=B4=E6=96=B0=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/gui/controlpane/JControlUpdatePane.java | 4 +++- .../fr/design/gui/controlpane/ListControlPaneHelper.java | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/controlpane/JControlUpdatePane.java b/designer-base/src/main/java/com/fr/design/gui/controlpane/JControlUpdatePane.java index 3ddb144a5f..fa3c36d6b7 100644 --- a/designer-base/src/main/java/com/fr/design/gui/controlpane/JControlUpdatePane.java +++ b/designer-base/src/main/java/com/fr/design/gui/controlpane/JControlUpdatePane.java @@ -14,7 +14,7 @@ import com.fr.form.event.Listener; import com.fr.general.ComparatorUtils; import com.fr.log.FineLoggerFactory; -import javax.swing.JPanel; +import javax.swing.*; import java.awt.CardLayout; /** @@ -77,6 +77,8 @@ class JControlUpdatePane extends JPanel { cardPane.add(updatePanes[i], String.valueOf(i)); } card.show(cardPane, String.valueOf(i)); + cardPane.revalidate(); + cardPane.repaint(); try { if (ob2Populate instanceof Listener) { listControlPane.wrapperListener((Listener) ob2Populate); diff --git a/designer-base/src/main/java/com/fr/design/gui/controlpane/ListControlPaneHelper.java b/designer-base/src/main/java/com/fr/design/gui/controlpane/ListControlPaneHelper.java index 7fe1a27efe..0220a18cfc 100644 --- a/designer-base/src/main/java/com/fr/design/gui/controlpane/ListControlPaneHelper.java +++ b/designer-base/src/main/java/com/fr/design/gui/controlpane/ListControlPaneHelper.java @@ -145,6 +145,9 @@ class ListControlPaneHelper { ((UIControlPane.PopupEditDialog) popupEditDialog).setTitle(getSelectedName()); } popupEditDialog.setVisible(true); + + popupEditDialog.revalidate(); + popupEditDialog.repaint(); PopupDialogSaveAction osBasedAction = OSSupportCenter.getAction(PopupDialogSaveAction.class); osBasedAction.register(controlPane, popupEditDialog); } @@ -184,7 +187,7 @@ class ListControlPaneHelper { /* * UINameEdList的鼠标事件 */ - protected MouseListener getListMouseListener(UINameEdList nameableList, UIControlPane controlPane) { + protected MouseListener getListMouseListener(UINameEdList nameableList, UIControlPane controlPane) { return new MouseAdapter() { @Override public void mouseReleased(MouseEvent evt) { @@ -251,5 +254,4 @@ class ListControlPaneHelper { } - } From cb4c39d354a63c6444ec62ad87c0126042902e8b Mon Sep 17 00:00:00 2001 From: lidongy <1879087903@qq.com> Date: Wed, 22 Jan 2025 11:22:00 +0800 Subject: [PATCH 07/25] =?UTF-8?q?REPORT-147166=20=E7=BB=9F=E4=BF=A1uos?= =?UTF-8?q?=E4=B8=8B=E5=88=87=E6=8D=A2=E6=9D=A1=E4=BB=B6=E5=B1=9E=E6=80=A7?= =?UTF-8?q?=E5=90=8E=EF=BC=8C=E5=8D=A1=E7=89=87=E4=B8=8D=E8=83=BD=E5=8F=8A?= =?UTF-8?q?=E6=97=B6=E6=9B=B4=E6=96=B0=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/gui/controlpane/JControlUpdatePane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/controlpane/JControlUpdatePane.java b/designer-base/src/main/java/com/fr/design/gui/controlpane/JControlUpdatePane.java index fa3c36d6b7..404ef27d79 100644 --- a/designer-base/src/main/java/com/fr/design/gui/controlpane/JControlUpdatePane.java +++ b/designer-base/src/main/java/com/fr/design/gui/controlpane/JControlUpdatePane.java @@ -14,7 +14,7 @@ import com.fr.form.event.Listener; import com.fr.general.ComparatorUtils; import com.fr.log.FineLoggerFactory; -import javax.swing.*; +import javax.swing.JPanel; import java.awt.CardLayout; /** From 06128fccc295fff3a3ca92d324ca566af244373b Mon Sep 17 00:00:00 2001 From: lidongy <1879087903@qq.com> Date: Thu, 23 Jan 2025 15:43:24 +0800 Subject: [PATCH 08/25] =?UTF-8?q?REPORT-147166=20=E7=BB=9F=E4=BF=A1uos?= =?UTF-8?q?=E4=B8=8B=E5=88=87=E6=8D=A2=E6=9D=A1=E4=BB=B6=E5=B1=9E=E6=80=A7?= =?UTF-8?q?=E5=90=8E=EF=BC=8C=E5=8D=A1=E7=89=87=E4=B8=8D=E8=83=BD=E5=8F=8A?= =?UTF-8?q?=E6=97=B6=E6=9B=B4=E6=96=B0=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gui/controlpane/JControlUpdatePane.java | 8 +++---- .../present/ConditionAttributesGroupPane.java | 6 +++++ .../ConditionAttributesUpdatePane.java | 22 +++++++++++++++++++ 3 files changed, 31 insertions(+), 5 deletions(-) create mode 100644 designer-realize/src/main/java/com/fr/design/present/ConditionAttributesUpdatePane.java diff --git a/designer-base/src/main/java/com/fr/design/gui/controlpane/JControlUpdatePane.java b/designer-base/src/main/java/com/fr/design/gui/controlpane/JControlUpdatePane.java index 404ef27d79..980e51b013 100644 --- a/designer-base/src/main/java/com/fr/design/gui/controlpane/JControlUpdatePane.java +++ b/designer-base/src/main/java/com/fr/design/gui/controlpane/JControlUpdatePane.java @@ -20,15 +20,15 @@ import java.awt.CardLayout; /** * Created by plough on 2018/8/13. */ -class JControlUpdatePane extends JPanel { +public class JControlUpdatePane extends JPanel { private ListControlPaneProvider listControlPane; private CardLayout card; - private JPanel cardPane; + protected JPanel cardPane; private BasicBeanPane[] updatePanes; private ListModelElement elEditing; - private JControlUpdatePane(ListControlPaneProvider listControlPane) { + protected JControlUpdatePane(ListControlPaneProvider listControlPane) { this.listControlPane = listControlPane; initUpdatePane(); } @@ -77,8 +77,6 @@ class JControlUpdatePane extends JPanel { cardPane.add(updatePanes[i], String.valueOf(i)); } card.show(cardPane, String.valueOf(i)); - cardPane.revalidate(); - cardPane.repaint(); try { if (ob2Populate instanceof Listener) { listControlPane.wrapperListener((Listener) ob2Populate); diff --git a/designer-realize/src/main/java/com/fr/design/present/ConditionAttributesGroupPane.java b/designer-realize/src/main/java/com/fr/design/present/ConditionAttributesGroupPane.java index a74cf2d7af..fa15dbea72 100644 --- a/designer-realize/src/main/java/com/fr/design/present/ConditionAttributesGroupPane.java +++ b/designer-realize/src/main/java/com/fr/design/present/ConditionAttributesGroupPane.java @@ -22,6 +22,7 @@ import com.fr.report.core.SheetUtils; import com.fr.report.elementcase.TemplateElementCase; import com.fr.stable.Nameable; +import javax.swing.*; import java.util.ArrayList; import java.util.List; @@ -76,6 +77,11 @@ public class ConditionAttributesGroupPane extends UIListControlPane { return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Add_Condition"); } + @Override + protected JPanel createControlUpdatePane() { + return ConditionAttributesUpdatePane.newInstance(this); + } + public void populate(ElementCasePane ePane) { this.ePane = ePane; this.editSelection = ePane.getSelection(); diff --git a/designer-realize/src/main/java/com/fr/design/present/ConditionAttributesUpdatePane.java b/designer-realize/src/main/java/com/fr/design/present/ConditionAttributesUpdatePane.java new file mode 100644 index 0000000000..4863452b8c --- /dev/null +++ b/designer-realize/src/main/java/com/fr/design/present/ConditionAttributesUpdatePane.java @@ -0,0 +1,22 @@ +package com.fr.design.present; + +import com.fr.design.gui.controlpane.JControlUpdatePane; +import com.fr.design.gui.controlpane.ListControlPaneProvider; + +public class ConditionAttributesUpdatePane extends JControlUpdatePane { + + protected ConditionAttributesUpdatePane(ListControlPaneProvider listControlPane) { + super(listControlPane); + } + + public static JControlUpdatePane newInstance(ListControlPaneProvider listControlPane) { + return new ConditionAttributesUpdatePane(listControlPane); + } + + public void populate() { + super.populate(); + + cardPane.revalidate(); + cardPane.repaint(); + } +} From c1e113c4a8da3d94def8df3f467fa7070f55f0da Mon Sep 17 00:00:00 2001 From: lidongy <1879087903@qq.com> Date: Thu, 23 Jan 2025 15:47:54 +0800 Subject: [PATCH 09/25] =?UTF-8?q?REPORT-147166=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=B4=A8=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/gui/controlpane/JControlUpdatePane.java | 4 +++- .../present/ConditionAttributesGroupPane.java | 2 +- .../present/ConditionAttributesUpdatePane.java | 14 ++++++++++++++ 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/controlpane/JControlUpdatePane.java b/designer-base/src/main/java/com/fr/design/gui/controlpane/JControlUpdatePane.java index 980e51b013..56f499e383 100644 --- a/designer-base/src/main/java/com/fr/design/gui/controlpane/JControlUpdatePane.java +++ b/designer-base/src/main/java/com/fr/design/gui/controlpane/JControlUpdatePane.java @@ -18,7 +18,9 @@ import javax.swing.JPanel; import java.awt.CardLayout; /** - * Created by plough on 2018/8/13. + * @author plough + * @version 11.0 + * @since Created on 2018/8/13 */ public class JControlUpdatePane extends JPanel { private ListControlPaneProvider listControlPane; diff --git a/designer-realize/src/main/java/com/fr/design/present/ConditionAttributesGroupPane.java b/designer-realize/src/main/java/com/fr/design/present/ConditionAttributesGroupPane.java index fa15dbea72..9fa6ba170f 100644 --- a/designer-realize/src/main/java/com/fr/design/present/ConditionAttributesGroupPane.java +++ b/designer-realize/src/main/java/com/fr/design/present/ConditionAttributesGroupPane.java @@ -22,7 +22,7 @@ import com.fr.report.core.SheetUtils; import com.fr.report.elementcase.TemplateElementCase; import com.fr.stable.Nameable; -import javax.swing.*; +import javax.swing.JPanel; import java.util.ArrayList; import java.util.List; diff --git a/designer-realize/src/main/java/com/fr/design/present/ConditionAttributesUpdatePane.java b/designer-realize/src/main/java/com/fr/design/present/ConditionAttributesUpdatePane.java index 4863452b8c..5560633b86 100644 --- a/designer-realize/src/main/java/com/fr/design/present/ConditionAttributesUpdatePane.java +++ b/designer-realize/src/main/java/com/fr/design/present/ConditionAttributesUpdatePane.java @@ -3,16 +3,30 @@ package com.fr.design.present; import com.fr.design.gui.controlpane.JControlUpdatePane; import com.fr.design.gui.controlpane.ListControlPaneProvider; + +/** + * 条件属性更新面板 + * + * @author lidongy + * @version 11.0 + * @since Created on 2025/1/23 + */ public class ConditionAttributesUpdatePane extends JControlUpdatePane { protected ConditionAttributesUpdatePane(ListControlPaneProvider listControlPane) { super(listControlPane); } + /** + * 新建一个实例 + * @param listControlPane 父面板 + * @return 新面板实例 + */ public static JControlUpdatePane newInstance(ListControlPaneProvider listControlPane) { return new ConditionAttributesUpdatePane(listControlPane); } + @Override public void populate() { super.populate(); From b50209e28c7f8fbba210fdbe4788bb15b64abb94 Mon Sep 17 00:00:00 2001 From: lidongy <1879087903@qq.com> Date: Thu, 23 Jan 2025 15:53:12 +0800 Subject: [PATCH 10/25] =?UTF-8?q?REPORT-147166=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=B4=A8=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/gui/controlpane/JControlUpdatePane.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/designer-base/src/main/java/com/fr/design/gui/controlpane/JControlUpdatePane.java b/designer-base/src/main/java/com/fr/design/gui/controlpane/JControlUpdatePane.java index 56f499e383..77a7fb0650 100644 --- a/designer-base/src/main/java/com/fr/design/gui/controlpane/JControlUpdatePane.java +++ b/designer-base/src/main/java/com/fr/design/gui/controlpane/JControlUpdatePane.java @@ -18,6 +18,8 @@ import javax.swing.JPanel; import java.awt.CardLayout; /** + * 设计器控制部分的更新面板 + * * @author plough * @version 11.0 * @since Created on 2018/8/13 From cfa635fd77f163e8d89db96d8823ef454b8d56f6 Mon Sep 17 00:00:00 2001 From: lidongy <1879087903@qq.com> Date: Fri, 7 Feb 2025 17:48:36 +0800 Subject: [PATCH 11/25] =?UTF-8?q?REPORT-147166=20linux=E4=B8=8B=EF=BC=8C?= =?UTF-8?q?=E6=9D=A1=E4=BB=B6=E5=B1=9E=E6=80=A7-=E8=B6=85=E9=93=BE?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=20=E6=89=93=E5=BC=80=E4=B9=8B=E5=90=8E?= =?UTF-8?q?=EF=BC=8C=E8=AE=BE=E7=BD=AE=E8=B6=85=E9=93=BE=E7=9A=84=E7=AA=97?= =?UTF-8?q?=E5=8F=A3=E6=97=A0=E6=B3=95=E8=81=9A=E7=84=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/gui/controlpane/UIControlPane.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/controlpane/UIControlPane.java b/designer-base/src/main/java/com/fr/design/gui/controlpane/UIControlPane.java index 12f904922d..e41af8404f 100644 --- a/designer-base/src/main/java/com/fr/design/gui/controlpane/UIControlPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/controlpane/UIControlPane.java @@ -100,7 +100,7 @@ public abstract class UIControlPane extends JControlPane { this.checkButtonEnabled(); } - protected Window getPopupEditDialog(){ + protected Window getPopupEditDialog() { return this.popupEditDialog; } @@ -241,6 +241,11 @@ public abstract class UIControlPane extends JControlPane { private void hideDialog() { if (needToHidePopupEditDialog()) { + //在Linux上拉回焦点,不然导致一些面板关不掉 + if (OperatingSystem.isLinux()) { + requestFocus(); + } + saveSettings(); setVisible(false); PopupDialogSaveAction saveAction = OSSupportCenter.getAction(PopupDialogSaveAction.class); @@ -252,10 +257,6 @@ public abstract class UIControlPane extends JControlPane { addWindowFocusListener(new WindowAdapter() { @Override public void windowLostFocus(WindowEvent e) { - //在Linux上拉回焦点,不然导致一些面板关不掉 - if(OperatingSystem.isLinux()) { - requestFocus(); - } hideDialog(); } }); @@ -263,8 +264,8 @@ public abstract class UIControlPane extends JControlPane { } /** - * 是否需要隐藏popupEditDialog - */ + * 是否需要隐藏popupEditDialog + */ protected boolean needToHidePopupEditDialog() { // 检查是否有子弹窗,如果有,则不隐藏 for (Window window : popupEditDialog.getOwnedWindows()) { From f1fdae12f117dca5fbac0c516a4ffaa1ca33ac0c Mon Sep 17 00:00:00 2001 From: Zhanying <2446962908@qq.com> Date: Mon, 10 Feb 2025 16:43:19 +0800 Subject: [PATCH 12/25] =?UTF-8?q?fix:=20=E9=A2=9C=E8=89=B2=E9=80=89?= =?UTF-8?q?=E6=8B=A9=E9=9D=A2=E6=9D=BF=E6=95=B0=E7=BB=84=E8=B6=8A=E7=95=8C?= =?UTF-8?q?=20#REPORT-147689?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/style/color/NewColorSelectPane.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/style/color/NewColorSelectPane.java b/designer-base/src/main/java/com/fr/design/style/color/NewColorSelectPane.java index b5f8976abf..6299f5ffff 100644 --- a/designer-base/src/main/java/com/fr/design/style/color/NewColorSelectPane.java +++ b/designer-base/src/main/java/com/fr/design/style/color/NewColorSelectPane.java @@ -225,7 +225,9 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable { if (standardColors == null || standardColors.size() < 8) { return; } - for (int i = 0; i < standardColors.size(); i++) { + // 如果颜色数量超过了主题色数量,只取主题色数量 + int range = Math.min(standardColors.size(), this.themeColorCellGrid.length - 2); + for (int i = 0; i < range; i++) { Color standardColor = standardColors.get(i); ColorConfig colorConfig = getColorConfig(colorSelector, i); Color[] deriveColorArr = colorConfig.getDeriveColorArr(standardColor, DEFAULT_DERIVE_COUNT); From 2a8478d4382b3e771e82d306082b2236ec2e180c Mon Sep 17 00:00:00 2001 From: Zhanying <2446962908@qq.com> Date: Tue, 11 Feb 2025 11:24:20 +0800 Subject: [PATCH 13/25] =?UTF-8?q?fix:=20pr=E9=97=AE=E9=A2=98=E5=A4=84?= =?UTF-8?q?=E7=90=86=20#REPORT-147689?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/style/color/NewColorSelectPane.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/style/color/NewColorSelectPane.java b/designer-base/src/main/java/com/fr/design/style/color/NewColorSelectPane.java index 6299f5ffff..d7246c7552 100644 --- a/designer-base/src/main/java/com/fr/design/style/color/NewColorSelectPane.java +++ b/designer-base/src/main/java/com/fr/design/style/color/NewColorSelectPane.java @@ -225,8 +225,8 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable { if (standardColors == null || standardColors.size() < 8) { return; } - // 如果颜色数量超过了主题色数量,只取主题色数量 - int range = Math.min(standardColors.size(), this.themeColorCellGrid.length - 2); + // range取最小值,避免数据越界 + int range = Math.min(standardColors.size(), this.themeColorCellGrid.length); for (int i = 0; i < range; i++) { Color standardColor = standardColors.get(i); ColorConfig colorConfig = getColorConfig(colorSelector, i); From 58f07b2980357f8eb1c5b3415aa02630fefa0395 Mon Sep 17 00:00:00 2001 From: Zhanying <2446962908@qq.com> Date: Thu, 27 Feb 2025 14:26:16 +0800 Subject: [PATCH 14/25] =?UTF-8?q?feat:=20JSContentPane=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=E6=8F=90=E7=A4=BA=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=20#REPORT-144004?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fun/DefaultValueAdjustProvider.java | 17 +++ .../fr/design/javascript/JSContentPane.java | 112 +++++++++++++++++- .../JSContentWithDescriptionPane.java | 32 ++++- .../design/javascript/JavaScriptImplPane.java | 23 +++- .../javascript/NewJavaScriptImplPane.java | 23 +++- 5 files changed, 199 insertions(+), 8 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/fun/DefaultValueAdjustProvider.java b/designer-base/src/main/java/com/fr/design/fun/DefaultValueAdjustProvider.java index 0654c69e11..60b7c314a8 100644 --- a/designer-base/src/main/java/com/fr/design/fun/DefaultValueAdjustProvider.java +++ b/designer-base/src/main/java/com/fr/design/fun/DefaultValueAdjustProvider.java @@ -6,6 +6,7 @@ import com.fr.chartx.attr.ChartProvider; import com.fr.design.style.color.FRColorSelectorStyle; import com.fr.general.FRFont; import com.fr.report.cell.CellElement; +import com.fr.stable.StringUtils; import com.fr.stable.collections.combination.Pair; import com.fr.stable.fun.mark.Selectable; @@ -92,4 +93,20 @@ public interface DefaultValueAdjustProvider extends Selectable { default boolean isNeedPostCombo4MobilePopupPane() { return false; } + + /** + * JsContentPane是否支持内容提示 + * @return 是否支持 + */ + default boolean isNeedContentWarning4JsContentPane() { + return false; + } + + /** + * 自定义匹配js内容,并返回对应的提示文本 + * @return <是否匹配,提示文本> + */ + default Pair checkJsContent(String content) { + return new Pair<>(false, StringUtils.EMPTY); + } } diff --git a/designer-base/src/main/java/com/fr/design/javascript/JSContentPane.java b/designer-base/src/main/java/com/fr/design/javascript/JSContentPane.java index 31c45da762..d752e12254 100644 --- a/designer-base/src/main/java/com/fr/design/javascript/JSContentPane.java +++ b/designer-base/src/main/java/com/fr/design/javascript/JSContentPane.java @@ -25,12 +25,19 @@ import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.DesignerContext; import com.fr.general.IOUtils; import com.fr.js.JavaScriptImpl; +import com.fr.stable.StringUtils; +import com.fr.stable.collections.combination.Pair; +import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.KeyStroke; import javax.swing.SwingConstants; import javax.swing.SwingWorker; +import javax.swing.border.EmptyBorder; +import javax.swing.event.DocumentEvent; +import javax.swing.event.DocumentListener; import java.awt.BorderLayout; +import java.awt.Color; import java.awt.Cursor; import java.awt.Dimension; import java.awt.FontMetrics; @@ -54,6 +61,13 @@ public class JSContentPane extends BasicPane { private JSImplPopulateAction jsImplPopulateAction; private boolean modal; BasicDialog advancedEditorDialog ; + private JLabel warningLabel; + //用来标记当前显示状态 + private boolean showWarning = false; + private static final Color WARING_LABEL_BACKGROUND = Color.decode("#FFFBE6"); + private static final Color WARING_LABEL_FOREGROUND = new Color(0, 0, 0, 216); + private JPanel endBracketsPanel; + public JSContentPane(){} public JSContentPane(String[] args) { @@ -73,14 +87,91 @@ public class JSContentPane extends BasicPane { UILabel funNameLabel2 = new UILabel(); funNameLabel2.setText("}"); - this.add(funNameLabel2, BorderLayout.SOUTH); + + if (isNeedContentWarning()) { + endBracketsPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); + endBracketsPanel.add(funNameLabel2, BorderLayout.NORTH); + warningLabel = initWarningLabel(); + this.add(endBracketsPanel, BorderLayout.SOUTH); + } else { + this.add(funNameLabel2, BorderLayout.SOUTH); + } + } + + protected JLabel initWarningLabel() { + JLabel warningLabel = new JLabel(StringUtils.EMPTY); + warningLabel.setOpaque(true); + warningLabel.setAlignmentX(LEFT_ALIGNMENT); + // 设置左右 5px 的间距 + warningLabel.setBorder(new EmptyBorder(0, 5, 0, 5)); + warningLabel.setPreferredSize(new Dimension(200, 20)); + warningLabel.setBackground(WARING_LABEL_BACKGROUND); + warningLabel.setForeground(WARING_LABEL_FOREGROUND); + + addContentListener4Warning(); + return warningLabel; } + + private void addContentListener4Warning() { + contentTextArea.getDocument().addDocumentListener(new DocumentListener() { + @Override + public void insertUpdate(DocumentEvent e) { + checkContent(contentTextArea); + } + + @Override + public void removeUpdate(DocumentEvent e) { + checkContent(contentTextArea); + } + + @Override + public void changedUpdate(DocumentEvent e) { + checkContent(contentTextArea); + } + }); + } + + private void checkContent(RSyntaxTextArea contentTextArea) { + String content = contentTextArea.getText().trim(); + Pair pair = checkContent(content); + boolean matches = Boolean.TRUE.equals(pair.getFirst()); + String tip = pair.getSecond() != null ? pair.getSecond() : StringUtils.EMPTY; + // 更新提示 + updateWarningTip(tip); + + if (matches == showWarning) { + return; + } + if (matches) { + addWarningLabel(); + showWarning = true; + } else { + removeWarningLabel(); + showWarning = false; + } + } + + protected void updateWarningTip(String tip) { + if (!StringUtils.equals(warningLabel.getText(), tip)) { + warningLabel.setText(tip); + } + } + + protected void removeWarningLabel() { + endBracketsPanel.remove(warningLabel); + endBracketsPanel.revalidate(); + } + + protected void addWarningLabel() { + endBracketsPanel.add(warningLabel, BorderLayout.SOUTH); + endBracketsPanel.revalidate(); + } + public JSContentPane(String[] args,boolean modal) { this(args); this.modal = modal; } - public void setJsImplUpdateAction(JSImplUpdateAction jsImplUpdateAction){ this.jsImplUpdateAction = jsImplUpdateAction; } @@ -93,7 +184,6 @@ public class JSContentPane extends BasicPane { this.javaScript = javaScript; } - private void addNewPaneLabel(){ UILabel advancedEditorLabel = new UILabel(Toolkit.i18nText("Fine-Design_Advanced_Editor"), IconUtils.readIcon("com/fr/design/images/edit/advancedEditor.svg"), SwingConstants.LEFT); advancedEditorLabel.setCursor(new Cursor(Cursor.HAND_CURSOR)); @@ -328,4 +418,20 @@ public class JSContentPane extends BasicPane { protected boolean needAdvancedEditor() { return true; } + + /** + * 是否支持内容提示 + * @return 是否支持 + */ + protected boolean isNeedContentWarning() { + return false; + } + + /** + * 自定义匹配js内容,并返回对应的提示文本 + * @return <是否匹配,提示文本> + */ + protected Pair checkContent(String content) { + return new Pair<>(false, StringUtils.EMPTY); + } } \ No newline at end of file diff --git a/designer-base/src/main/java/com/fr/design/javascript/JSContentWithDescriptionPane.java b/designer-base/src/main/java/com/fr/design/javascript/JSContentWithDescriptionPane.java index 4116f4f1d0..490ff1899b 100644 --- a/designer-base/src/main/java/com/fr/design/javascript/JSContentWithDescriptionPane.java +++ b/designer-base/src/main/java/com/fr/design/javascript/JSContentWithDescriptionPane.java @@ -32,6 +32,7 @@ import javax.swing.BorderFactory; import javax.swing.DefaultListCellRenderer; import javax.swing.DefaultListModel; import javax.swing.JComponent; +import javax.swing.JLabel; import javax.swing.JList; import javax.swing.JPanel; import javax.swing.JPopupMenu; @@ -71,7 +72,6 @@ import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.List; -import java.util.Locale; import java.util.concurrent.ExecutionException; public class JSContentWithDescriptionPane extends JSContentPane implements KeyListener { @@ -95,6 +95,9 @@ public class JSContentWithDescriptionPane extends JSContentPane implements KeyLi private JPopupMenu popupMenu; + private JPanel endBracketsPanel; + private JLabel warningLabel; + private InterfaceAndDescriptionPanel interfaceAndDescriptionPanel; private JList helpDOCList; @@ -159,8 +162,13 @@ public class JSContentWithDescriptionPane extends JSContentPane implements KeyLi endBracketsLabel.setText("}"); //结尾括号和复用函数按钮面板 - JPanel endBracketsPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); - endBracketsPanel.add(endBracketsLabel, BorderLayout.WEST); + endBracketsPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); + if (isNeedContentWarning()) { + warningLabel = initWarningLabel(); + endBracketsPanel.add(endBracketsLabel, BorderLayout.NORTH); + } else { + endBracketsPanel.add(endBracketsLabel, BorderLayout.WEST); + } JPanel northPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); northPanel.add(jsParaAndSearchPane, BorderLayout.NORTH); @@ -178,6 +186,24 @@ public class JSContentWithDescriptionPane extends JSContentPane implements KeyLi this.add(functionNameAndDescriptionPanel, BorderLayout.SOUTH); } + protected void updateWarningTip(String tip) { + if (!StringUtils.equals(warningLabel.getText(), tip)) { + warningLabel.setText(tip); + } + } + + @Override + protected void removeWarningLabel() { + endBracketsPanel.remove(warningLabel); + endBracketsPanel.revalidate(); + } + + @Override + protected void addWarningLabel() { + endBracketsPanel.add(warningLabel, BorderLayout.SOUTH); + endBracketsPanel.revalidate(); + } + public void populate(String js) { contentTextArea.setText(js); ifHasBeenWriten = 1; diff --git a/designer-base/src/main/java/com/fr/design/javascript/JavaScriptImplPane.java b/designer-base/src/main/java/com/fr/design/javascript/JavaScriptImplPane.java index 37bca2f6eb..3b57db544e 100644 --- a/designer-base/src/main/java/com/fr/design/javascript/JavaScriptImplPane.java +++ b/designer-base/src/main/java/com/fr/design/javascript/JavaScriptImplPane.java @@ -3,6 +3,7 @@ package com.fr.design.javascript; import com.fr.base.Parameter; import com.fr.design.data.tabledata.tabledatapane.OneListTableModel; import com.fr.design.dialog.FineJOptionPane; +import com.fr.design.fun.DefaultValueAdjustProvider; import com.fr.design.gui.frpane.ReportletParameterViewPane; import com.fr.design.gui.itableeditorpane.ParameterTableModel; import com.fr.design.gui.itableeditorpane.UITableEditAction; @@ -13,10 +14,12 @@ import com.fr.design.javascript.jsapi.JSImplPopulateAction; import com.fr.design.javascript.jsapi.JSImplUpdateAction; import com.fr.design.mainframe.DesignerContext; import com.fr.design.scrollruler.ModLineBorder; +import com.fr.design.utils.DesignUtils; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.js.JavaScriptImpl; import com.fr.stable.ParameterProvider; import com.fr.stable.StringUtils; +import com.fr.stable.collections.combination.Pair; import javax.swing.BorderFactory; import javax.swing.JPanel; @@ -84,7 +87,25 @@ public class JavaScriptImplPane extends AbstractHyperLinkPane { } protected JSContentPane createJSContentPane(String[] defaultArgs){ - JSContentPane jsContentPane= new JSContentPane(defaultArgs,modal); + JSContentPane jsContentPane= new JSContentPane(defaultArgs,modal) { + @Override + protected boolean isNeedContentWarning() { + DefaultValueAdjustProvider valueAdjust = DesignUtils.getValueAdjust(); + if (valueAdjust != null) { + return valueAdjust.isNeedContentWarning4JsContentPane(); + } + return super.isNeedContentWarning(); + } + + @Override + protected Pair checkContent(String content) { + DefaultValueAdjustProvider valueAdjust = DesignUtils.getValueAdjust(); + if (valueAdjust != null) { + return valueAdjust.checkJsContent(content); + } + return super.checkContent(content); + } + }; jsContentPane.setJsImplUpdateAction(new JSImplUpdateAction() { @Override public void update(JavaScriptImpl javaScript) { diff --git a/designer-base/src/main/java/com/fr/design/javascript/NewJavaScriptImplPane.java b/designer-base/src/main/java/com/fr/design/javascript/NewJavaScriptImplPane.java index 23226c6dde..5a59bf8c78 100644 --- a/designer-base/src/main/java/com/fr/design/javascript/NewJavaScriptImplPane.java +++ b/designer-base/src/main/java/com/fr/design/javascript/NewJavaScriptImplPane.java @@ -1,7 +1,10 @@ package com.fr.design.javascript; +import com.fr.design.fun.DefaultValueAdjustProvider; +import com.fr.design.utils.DesignUtils; import com.fr.js.JavaScriptImpl; +import com.fr.stable.collections.combination.Pair; public class NewJavaScriptImplPane extends JavaScriptImplPane { @@ -10,7 +13,25 @@ public class NewJavaScriptImplPane extends JavaScriptImplPane { } protected JSContentPane createJSContentPane(String[] defaultArgs){ - return new JSContentWithDescriptionPane(defaultArgs); + return new JSContentWithDescriptionPane(defaultArgs) { + @Override + protected boolean isNeedContentWarning() { + DefaultValueAdjustProvider valueAdjust = DesignUtils.getValueAdjust(); + if (valueAdjust != null) { + return valueAdjust.isNeedContentWarning4JsContentPane(); + } + return super.isNeedContentWarning(); + } + + @Override + protected Pair checkContent(String content) { + DefaultValueAdjustProvider valueAdjust = DesignUtils.getValueAdjust(); + if (valueAdjust != null) { + return valueAdjust.checkJsContent(content); + } + return super.checkContent(content); + } + }; } public void populate(JavaScriptImpl javaScript) { From 2062c8874720ce47183ca6d99422fafa80daf880 Mon Sep 17 00:00:00 2001 From: "Richard.Fang" Date: Thu, 6 Mar 2025 10:29:48 +0800 Subject: [PATCH 15/25] =?UTF-8?q?REPORT-148266=20feat:comboBox=E4=BA=8B?= =?UTF-8?q?=E4=BB=B6=E5=8F=A0=E5=8A=A0=E5=AF=BC=E8=87=B4=E9=83=A8=E5=88=86?= =?UTF-8?q?=E6=93=8D=E4=BD=9C=E5=8D=A1=E9=A1=BF=E9=97=AE=E9=A2=98=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/data/DesignTableDataManager.java | 39 ++-- .../data/datapane/TableDataComboBox.java | 171 ++++++++++++++---- .../data/datapane/TreeTableDataDictPane.java | 3 +- .../editor/editor/ColumnSelectedEditor.java | 2 +- .../present/dict/TableDataDictPane.java | 2 +- .../java/com/fr/design/ui/util/UIUtil.java | 54 +++++- .../fr/design/chart/AutoChartTypePane.java | 2 +- .../chartx/component/MapAreaMatchPane.java | 2 +- .../design/mainframe/ChartPropertyPane.java | 5 +- .../chart/gui/data/DatabaseTableDataPane.java | 2 +- .../dscolumn/SelectedDataColumnPane.java | 2 +- 11 files changed, 222 insertions(+), 62 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java b/designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java index 2354007e18..2afcaabe4d 100644 --- a/designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java +++ b/designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java @@ -115,6 +115,9 @@ public abstract class DesignTableDataManager { //增强for循环用的iterator实现的, 如果中间哪个listener修改或删除了(如ChartEditPane.dsChangeListener), // 由于dsListeners是arraylist, 此时会ConcurrentModifyException ChangeEvent e = null; + if (dsListeners.get(i) == null) { + continue; + } dsListeners.get(i).stateChanged(e); } } @@ -185,23 +188,33 @@ public abstract class DesignTableDataManager { globalDsListeners.add(l); } +/** + * 添加模板数据集改变 监听事件. + * + * @param l ChangeListener监听器 + */ +public static void addDsChangeListener(ChangeListener l) { + getDsListenersForCurrentTemplate().add(l); +} + +/** + * 移除模板数据集改变 监听事件. + * + * @param l ChangeListener监听器 + */ +public static void removeDsChangeListener(ChangeListener l) { + getDsListenersForCurrentTemplate().remove(l); +} + /** - * 添加模板数据集改变 监听事件. + * 获取当前模板的监听器列表. * - * @param l ChangeListener监听器 + * @return 模板对应的监听器列表,如果列表不存在则新建. */ - public static void addDsChangeListener(ChangeListener l) { + private static List getDsListenersForCurrentTemplate() { JTemplate template = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); - String key = StringUtils.EMPTY; - if (JTemplate.isValid(template)) { - key = template.getPath(); - } - List dsListeners = dsListenersMap.get(key); - if (dsListeners == null) { - dsListeners = new ArrayList(); - dsListenersMap.put(key, dsListeners); - } - dsListeners.add(l); + String key = JTemplate.isValid(template) ? template.getPath() : StringUtils.EMPTY; + return dsListenersMap.computeIfAbsent(key, k -> new ArrayList<>()); } /** diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/TableDataComboBox.java b/designer-base/src/main/java/com/fr/design/data/datapane/TableDataComboBox.java index ebbdbf0f35..e177837470 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/TableDataComboBox.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/TableDataComboBox.java @@ -1,13 +1,14 @@ package com.fr.design.data.datapane; +import com.fr.design.ui.util.UIUtil; import java.awt.Component; import java.awt.event.ItemEvent; -import java.util.Iterator; -import java.util.Map.Entry; import javax.swing.DefaultComboBoxModel; import javax.swing.JLabel; import javax.swing.JList; +import javax.swing.event.AncestorEvent; +import javax.swing.event.AncestorListener; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; @@ -32,16 +33,53 @@ public class TableDataComboBox extends UIComboBox implements Prepare4DataSourceC protected java.util.Map resMap; private java.util.Map dsMap; private static final long serialVersionUID = 1L; - private boolean refresModel = false; - private String treeName; //树数据集本身的名字 + private boolean refreshModel = false; + private String treeName = StringUtils.EMPTY; //树数据集本身的名字 private ChangeListener changeListener; + /** + * 兼容插件调用 + * + * @param source 传入的数据源 + */ public TableDataComboBox(TableDataSource source){ - this(source,StringUtils.EMPTY); + this(); } + + /** + * 兼容插件调用 + * + * @param source 传入的数据源 + * @param treeName 树数据集名称 + */ public TableDataComboBox(TableDataSource source, String treeName) { + this(treeName); + } + + /** + * 根据树名称创建TableDataComboBox。 + * + * @param treeName 树数据集名称 + */ + public TableDataComboBox(String treeName) { + this(); + // 传入树数据集名称 + this.treeName = treeName; + } + + /** + * 初始化TableDataComboBox + */ + public TableDataComboBox() { super(); - this.treeName = treeName; + setListCellRenderer(); + addComboBoxListener(); + } + + /** + * 设置渲染器 + */ + private void setListCellRenderer() { this.setRenderer(new UIComboBoxRenderer() { private static final long serialVersionUID = 1L; @@ -60,37 +98,66 @@ public class TableDataComboBox extends UIComboBox implements Prepare4DataSourceC return renderer; } }); - refresh(source); - registerDSChangeListener(); } - /** - * refresh ComboBox - * @param source - */ + /** + * 在comboBox可见时添加数据集响应事件与refresh操作 + */ + private void addComboBoxListener() { + this.addAncestorListener(new AncestorListener() { + @Override + public void ancestorAdded(AncestorEvent event) { + registerDSChangeListener(); + refresh(DesignTableDataManager.getEditingTableDataSource()); + } + + @Override + public void ancestorRemoved(AncestorEvent event) { + DesignTableDataManager.removeDsChangeListener(changeListener); + } + + @Override + public void ancestorMoved(AncestorEvent event) { + } + }); + } + + /** + * 刷新数据源并更新下拉框的模型和选中项 + * + * @param source 数据源,用于刷新模型 + */ public void refresh(TableDataSource source) { - TableDataWrapper dataWrapper = getSelectedItem(); - refresModel = true; - setResMap(source); - setDsMap(); - DefaultComboBoxModel model = new DefaultComboBoxModel(); - this.setModel(model); - model.addElement(UIConstants.PENDING); - Iterator> entryIt = dsMap.entrySet().iterator(); - while (entryIt.hasNext()) { - TableDataWrapper tableDataWrapper = entryIt.next().getValue(); - if (!ComparatorUtils.equals(tableDataWrapper.getTableDataName(), treeName)) { - model.addElement(tableDataWrapper); - } - } - if (dataWrapper != null) { - if (DesignTableDataManager.isDsNameChanged(dataWrapper.getTableDataName())) { - this.setSelectedTableDataByName(DesignTableDataManager.getChangedDsNameByOldDsName(dataWrapper.getTableDataName())); - } else { - this.getModel().setSelectedItem(dataWrapper); - } - } - refresModel = false; + UIUtil.executeAsyncTaskAndUpdateUI( + () -> { + setResMap(source); + setDsMap(); + return null; + }, + result -> refreshComboBoxModel() + ); + } + + /** + * 刷新下拉框模型,同时保留当前选中的数据项 + *

+ * 1. 获取下拉框中当前选中的数据项 + * 2. 刷新下拉框的模型(清空并重新填充数据),此操作会重置选中的数据项 + * 3. 在刷新模型后,恢复之前选中的数据项 + *

+ * 关于 `refreshModel` 的作用: + * 1. **抑制事件触发**:下拉框模型在调用 `addElement` 方法时会触发 `fireItemStateChanged` 事件, + * 通过标记 `refreshModel`,可以在刷新过程中抑制此事件 + * 2. **处理异步和顺序问题**:由于取数操作是异步的,可能会导致回调后的 UI 操作与其他逻辑(如 `populateBean`)的调用顺序交错。 + * 标记 `refreshModel` 可确保在刷新模型时,不触发选中事件,从而避免逻辑干扰 + * 3. **逻辑清晰性**:刷新模型本质上是更新数据源的操作,不应触发与用户交互相关的选中事件,避免对上层逻辑造成额外负担 + */ + private void refreshComboBoxModel() { + refreshModel = true; + TableDataWrapper selectedItem = getSelectedItem(); + refreshModel(); + updateSelectedItem(selectedItem); + refreshModel = false; } protected void setResMap(TableDataSource source) { @@ -101,6 +168,26 @@ public class TableDataComboBox extends UIComboBox implements Prepare4DataSourceC dsMap = DesignTableDataManager.getAllDataSetIncludingProcedure(resMap); } + private void refreshModel() { + //创建ComboBox模型并设置 + DefaultComboBoxModel model = new DefaultComboBoxModel(); + this.setModel(model); + model.addElement(UIConstants.PENDING); + // 遍历添加所有数据项到模型,树数据集comboBox下拉模型中排除掉本身 + dsMap.values().stream() + .filter(tableDataWrapper -> tableDataWrapper != null && !ComparatorUtils.equals(tableDataWrapper.getTableDataName(), treeName)) + .forEach(model::addElement); + } + + private void updateSelectedItem(TableDataWrapper dataWrapper) { + if (dataWrapper != null) { + if (DesignTableDataManager.isDsNameChanged(dataWrapper.getTableDataName())) { + this.setSelectedTableData(DesignTableDataManager.getChangedDsNameByOldDsName(dataWrapper.getTableDataName())); + } else { + this.getModel().setSelectedItem(dataWrapper); + } + } + } /** @@ -117,8 +204,18 @@ public class TableDataComboBox extends UIComboBox implements Prepare4DataSourceC } public void setSelectedTableDataByName(String name) { - TableDataWrapper tableDataWrappe = dsMap.get(name) == null? dsMap.get(name + "_P_CURSOR") : dsMap.get(name); - this.getModel().setSelectedItem(tableDataWrappe); + setResMap(DesignTableDataManager.getEditingTableDataSource()); + setDsMap(); + // 数据集名称修改后控件传入的还是旧名称 + if (DesignTableDataManager.isDsNameChanged(name)) { + name = DesignTableDataManager.getChangedDsNameByOldDsName(name); + } + setSelectedTableData(name); + } + + private void setSelectedTableData(String name) { + TableDataWrapper tableDataWrapper = dsMap.get(name) == null ? dsMap.get(name + "_P_CURSOR") : dsMap.get(name); + this.getModel().setSelectedItem(tableDataWrapper); } @Override @@ -132,7 +229,7 @@ public class TableDataComboBox extends UIComboBox implements Prepare4DataSourceC //august:addElement方法竟然会fireItemStateChanged,蛋疼 @Override protected void fireItemStateChanged(ItemEvent e) { - if (!refresModel) { + if (!refreshModel) { super.fireItemStateChanged(e); } } diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/TreeTableDataDictPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/TreeTableDataDictPane.java index 175ddbfda3..fcb8705e9a 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/TreeTableDataDictPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/TreeTableDataDictPane.java @@ -167,8 +167,7 @@ public class TreeTableDataDictPane extends BasicPane implements Previewable { } protected void setTableDataNameComboBox(String treeName) { - tableDataNameComboBox = new TableDataComboBox(DesignTableDataManager.getEditingTableDataSource(), treeName); - + tableDataNameComboBox = new TableDataComboBox(treeName); } private void tdChange(boolean isChangeDS) { diff --git a/designer-base/src/main/java/com/fr/design/editor/editor/ColumnSelectedEditor.java b/designer-base/src/main/java/com/fr/design/editor/editor/ColumnSelectedEditor.java index 5260ce1752..29d6387f5d 100644 --- a/designer-base/src/main/java/com/fr/design/editor/editor/ColumnSelectedEditor.java +++ b/designer-base/src/main/java/com/fr/design/editor/editor/ColumnSelectedEditor.java @@ -31,7 +31,7 @@ public class ColumnSelectedEditor extends Editor implements Prep public ColumnSelectedEditor() { this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_DS_Column")); this.setLayout(FRGUIPaneFactory.createLeftZeroLayout()); - tableDataComboBox = new TableDataComboBox(DesignTableDataManager.getEditingTableDataSource()); + tableDataComboBox = new TableDataComboBox(); columnNames = new String[0]; tableDataComboBox.addItemListener(new ItemListener() { diff --git a/designer-base/src/main/java/com/fr/design/present/dict/TableDataDictPane.java b/designer-base/src/main/java/com/fr/design/present/dict/TableDataDictPane.java index 5ebd426593..f068f71216 100644 --- a/designer-base/src/main/java/com/fr/design/present/dict/TableDataDictPane.java +++ b/designer-base/src/main/java/com/fr/design/present/dict/TableDataDictPane.java @@ -83,7 +83,7 @@ public class TableDataDictPane extends FurtherBasicBeanPane } private void initBasicComponets() { - tableDataNameComboBox = new TableDataComboBox(DesignTableDataManager.getEditingTableDataSource()); + tableDataNameComboBox = new TableDataComboBox(); tableDataNameComboBox.addItemListener(e -> { if (e.getStateChange() == ItemEvent.SELECTED) { tdChange(e); diff --git a/designer-base/src/main/java/com/fr/design/ui/util/UIUtil.java b/designer-base/src/main/java/com/fr/design/ui/util/UIUtil.java index 86093a6d82..8565e90f31 100644 --- a/designer-base/src/main/java/com/fr/design/ui/util/UIUtil.java +++ b/designer-base/src/main/java/com/fr/design/ui/util/UIUtil.java @@ -3,9 +3,12 @@ package com.fr.design.ui.util; import com.fr.log.FineLoggerFactory; import com.fr.third.guava.base.Stopwatch; import com.fr.third.guava.base.Supplier; +import java.util.concurrent.ExecutionException; +import java.util.function.Consumer; +import javax.swing.SwingWorker; +import javax.swing.SwingUtilities; import org.jetbrains.annotations.NotNull; -import javax.swing.SwingUtilities; import java.util.concurrent.TimeUnit; /** @@ -81,4 +84,53 @@ public class UIUtil { } return result; } + + /** + * 执行异步任务并在任务完成后更新UI。 + *

+ * 该方法将执行一个耗时的后台任务,并在任务完成后将结果传递给一个回调函数来更新UI。 + * 使用 SwingWorker 来处理后台任务,确保在任务完成后回到 EDT(事件分发线程) 更新 UI。 + * 提供了一个可选的 `finallyBlock` 参数,用于执行清理操作,例如释放资源或重置状态。 + * + * @param 任务结果的类型 + * @param task 需要在后台执行的任务。该任务的执行过程由 Supplier 提供,返回任务的结果。 + * @param uiUpdater 在任务完成后执行的回调函数,用来处理结果并更新UI。 + * @param finallyBlock 可选的清理操作,在任务结束后无论是否发生异常都会执行。可以传入 null 表示不需要清理操作。常见场景包括状态标志的重置或资源释放。 + * + */ + public static void executeAsyncTaskAndUpdateUI(Supplier task, Consumer uiUpdater, Runnable finallyBlock) { + new SwingWorker() { + @Override + protected T doInBackground() throws Exception { + return task.get(); + } + @Override + protected void done() { + try { + T result = get(); + uiUpdater.accept(result); + } catch (InterruptedException | ExecutionException e) { + FineLoggerFactory.getLogger().debug(e.getMessage(), e); + } finally { + if (finallyBlock != null) { + finallyBlock.run(); + } + } + } + }.execute(); + } + + /** + * 执行异步任务并在任务完成后更新UI。 + *

+ * 该方法将执行一个耗时的后台任务,并在任务完成后将结果传递给一个回调函数来更新UI。 + * 使用 SwingWorker 来处理后台任务,确保在任务完成后回到 EDT(事件分发线程) 更新 UI。 + * + * @param 任务结果的类型 + * @param task 需要在后台执行的任务。该任务的执行过程由 Supplier 提供,返回任务的结果。 + * @param uiUpdater 在任务完成后执行的回调函数,用来处理结果并更新UI。 + */ + public static void executeAsyncTaskAndUpdateUI(Supplier task, Consumer uiUpdater) { + executeAsyncTaskAndUpdateUI(task, uiUpdater, null); + } } diff --git a/designer-chart/src/main/java/com/fr/design/chart/AutoChartTypePane.java b/designer-chart/src/main/java/com/fr/design/chart/AutoChartTypePane.java index 589028ae52..4aaf6a0281 100644 --- a/designer-chart/src/main/java/com/fr/design/chart/AutoChartTypePane.java +++ b/designer-chart/src/main/java/com/fr/design/chart/AutoChartTypePane.java @@ -141,7 +141,7 @@ public class AutoChartTypePane extends ChartWizardPane implements CallbackEvent } private void initDataFiledBox() { - tableNameComboBox = new TableDataComboBox(DesignTableDataManager.getEditingTableDataSource()); + tableNameComboBox = new TableDataComboBox(); tableNameComboBox.addItemListener(new ItemListener() { @Override public void itemStateChanged(ItemEvent e) { diff --git a/designer-chart/src/main/java/com/fr/design/chartx/component/MapAreaMatchPane.java b/designer-chart/src/main/java/com/fr/design/chartx/component/MapAreaMatchPane.java index 58068d10a8..ba25b5b81c 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/component/MapAreaMatchPane.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/component/MapAreaMatchPane.java @@ -128,7 +128,7 @@ public class MapAreaMatchPane extends BasicBeanPane { } private void initButtonGroup() { - tableNameCombox = new TableDataComboBox(DesignTableDataManager.getEditingTableDataSource()); + tableNameCombox = new TableDataComboBox(); tableNameCombox.addItemListener(new ItemListener() { @Override public void itemStateChanged(ItemEvent e) { diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/ChartPropertyPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/ChartPropertyPane.java index 297245960d..fe46528ca5 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/ChartPropertyPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/ChartPropertyPane.java @@ -9,18 +9,17 @@ import com.fr.base.chart.BaseChartCollection; import com.fr.chart.chartattr.ChartCollection; import com.fr.chart.charttypes.ChartTypeManager; import com.fr.chartx.attr.ChartProvider; -import com.fr.decision.webservice.v10.map.geojson.helper.GEOJSONHelper; import com.fr.design.ChartTypeInterfaceManager; import com.fr.design.designer.TargetComponent; import com.fr.design.gui.chart.BaseChartPropertyPane; import com.fr.design.gui.chart.ChartEditPaneProvider; import com.fr.design.gui.frpane.UITitlePanel; import com.fr.design.mainframe.chart.ChartEditPane; +import com.fr.design.ui.util.UIUtil; import com.fr.design.utils.gui.GUICoreUtils; import javax.swing.BorderFactory; import javax.swing.Icon; -import javax.swing.SwingWorker; import java.awt.BorderLayout; import java.awt.Component; @@ -116,7 +115,7 @@ public class ChartPropertyPane extends BaseChartPropertyPane { */ public void populateChartPropertyPane(BaseChartCollection collection, TargetComponent ePane) { if (collection instanceof ChartCollection) { - populateChartPropertyPane((ChartCollection) collection, ePane); + UIUtil.invokeAndWaitIfNeeded(() -> populateChartPropertyPane((ChartCollection) collection, ePane)); } } diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/DatabaseTableDataPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/DatabaseTableDataPane.java index 40983c56b5..3fbf1aa5a4 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/DatabaseTableDataPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/DatabaseTableDataPane.java @@ -82,7 +82,7 @@ public class DatabaseTableDataPane extends BasicPane{ } private void initTableCombox() { - tableNameCombox = new TableDataComboBox(DesignTableDataManager.getEditingTableDataSource()){ + tableNameCombox = new TableDataComboBox(){ //图表的数据集选择下拉框,不需要注册监听,chartEditPane已经注册了。 public void registerDSChangeListener() { diff --git a/designer-realize/src/main/java/com/fr/design/dscolumn/SelectedDataColumnPane.java b/designer-realize/src/main/java/com/fr/design/dscolumn/SelectedDataColumnPane.java index 052fba9046..de10613835 100644 --- a/designer-realize/src/main/java/com/fr/design/dscolumn/SelectedDataColumnPane.java +++ b/designer-realize/src/main/java/com/fr/design/dscolumn/SelectedDataColumnPane.java @@ -330,7 +330,7 @@ public class SelectedDataColumnPane extends BasicPane { protected void initTableNameComboBox() { - tableNameComboBox = new TableDataComboBox(DesignTableDataManager.getEditingTableDataSource()); + tableNameComboBox = new TableDataComboBox(); tableNameComboBox.setPreferredSize(new Dimension(100, 20)); } From a3502c3df1efabddfb2c109f40b314633d34e722 Mon Sep 17 00:00:00 2001 From: lidongy <1879087903@qq.com> Date: Thu, 6 Mar 2025 15:23:02 +0800 Subject: [PATCH 16/25] =?UTF-8?q?REPORT-148067=E3=80=90=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E4=B8=BB=E9=A2=98=E3=80=91=E5=BC=80=E5=90=AF=E6=8E=A7=E4=BB=B6?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E5=A2=9E=E5=BC=BA=E5=90=8E=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E4=B8=BB=E9=A2=98=E6=89=93=E5=BC=80=E6=98=BE=E7=A4=BA=E4=B8=8D?= =?UTF-8?q?=E5=85=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/widgettheme/theme/panel/ControlPreviewCell.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/widgettheme/theme/panel/ControlPreviewCell.java b/designer-base/src/main/java/com/fr/widgettheme/theme/panel/ControlPreviewCell.java index ec36032713..fcf2a75b40 100644 --- a/designer-base/src/main/java/com/fr/widgettheme/theme/panel/ControlPreviewCell.java +++ b/designer-base/src/main/java/com/fr/widgettheme/theme/panel/ControlPreviewCell.java @@ -101,7 +101,12 @@ public class ControlPreviewCell extends JPanel { if (this.reportTheme != null) { if (icon instanceof ImageIcon) { ImageIcon imageIcon = (ImageIcon) icon; - BufferedImage bufferedImage = ImageUtils.colorImage(ImageUtils.imageIconToBufferedImage(imageIcon), getIconColor()); + BufferedImage bufferedImage = ImageUtils.imageIconToBufferedImage(imageIcon); + Color iconColor = getIconColor(); + // 设置为透明色时color是null + if (iconColor != null) { + ImageUtils.colorImage(bufferedImage, iconColor); + } return new ImageIcon(bufferedImage); } } From 372e7d380fc477baee116d0816f438a581171208 Mon Sep 17 00:00:00 2001 From: vito Date: Thu, 13 Mar 2025 11:47:09 +0800 Subject: [PATCH 17/25] =?UTF-8?q?KERNEL-20956=20=E4=BF=AE=E5=A4=8Djxbrowse?= =?UTF-8?q?r=E5=9B=A0=E8=A7=A3=E5=8E=8B=E6=96=87=E4=BB=B6=E5=AF=BC?= =?UTF-8?q?=E8=87=B4=E7=9A=84=E5=90=AF=E5=8A=A8=E5=A4=B1=E8=B4=A5=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/jxbrowser/JxEngine.java | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/jxbrowser/JxEngine.java b/designer-base/src/main/java/com/fr/design/jxbrowser/JxEngine.java index bb2c1f7375..7738082a4c 100644 --- a/designer-base/src/main/java/com/fr/design/jxbrowser/JxEngine.java +++ b/designer-base/src/main/java/com/fr/design/jxbrowser/JxEngine.java @@ -3,8 +3,10 @@ package com.fr.design.jxbrowser; import com.fr.design.DesignerEnvManager; import com.fr.design.ui.ModernUIConstants; import com.fr.log.FineLoggerFactory; +import com.fr.stable.CommonUtils; import com.fr.value.ClearableLazyValue; import com.fr.web.struct.AssembleComponent; +import com.teamdev.jxbrowser.engine.ChromiumBinariesExtractionException; import com.teamdev.jxbrowser.engine.Engine; import com.teamdev.jxbrowser.engine.EngineOptions; import com.teamdev.jxbrowser.engine.RenderingMode; @@ -12,8 +14,11 @@ import com.teamdev.jxbrowser.engine.event.EngineCrashed; import com.teamdev.jxbrowser.net.Network; import com.teamdev.jxbrowser.net.Scheme; import com.teamdev.jxbrowser.net.callback.VerifyCertificateCallback; +import com.teamdev.jxbrowser.os.Environment; import org.jetbrains.annotations.NotNull; +import java.nio.file.Path; +import java.nio.file.Paths; import java.util.Collections; import java.util.Map; @@ -41,7 +46,18 @@ public class JxEngine { .addSwitch("--disable-google-traffic") .addScheme(Scheme.of(ModernUIConstants.EMB_TAG), new NxInterceptRequestCallback(this::getComponent, this::getParameterMap)); - Engine engine = Engine.newInstance(builder.build()); + Engine engine; + try { + engine = Engine.newInstance(builder.build()); + } catch (ChromiumBinariesExtractionException e) { + Path chromiumDir = Paths.get(System.getProperty("jxbrowser.chromium.dir", Environment.defaultChromiumDir().toString())); + if (CommonUtils.deleteFile(chromiumDir.toFile())) { + FineLoggerFactory.getLogger().warn("[jxbrowser]Retry start engine success after delete chromium dir manually: {}", chromiumDir); + engine = Engine.newInstance(builder.build()); + } else { + throw e; + } + } engine.on(EngineCrashed.class, (event) -> { FineLoggerFactory.getLogger().error("jxBrowser engine crashed with exitCode: {}", event.exitCode()); event.engine().close(); From 934b2a76eaa9a7b7925f371055810aea5ac48701 Mon Sep 17 00:00:00 2001 From: "shengzu.xue" Date: Thu, 13 Mar 2025 16:49:53 +0800 Subject: [PATCH 18/25] =?UTF-8?q?REPORT-149091=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E5=8A=A8=E6=80=81=E5=8F=82=E6=95=B0=E5=88=87=E6=8D=A2=E5=BC=82?= =?UTF-8?q?=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dscolumn/SelectedDataColumnPane.java | 26 ++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/dscolumn/SelectedDataColumnPane.java b/designer-realize/src/main/java/com/fr/design/dscolumn/SelectedDataColumnPane.java index de10613835..421bfdb766 100644 --- a/designer-realize/src/main/java/com/fr/design/dscolumn/SelectedDataColumnPane.java +++ b/designer-realize/src/main/java/com/fr/design/dscolumn/SelectedDataColumnPane.java @@ -21,6 +21,7 @@ import com.fr.design.mainframe.ElementCasePane; import com.fr.design.utils.gui.UIComponentUtils; import com.fr.design.widget.FRWidgetFactory; import com.fr.general.data.TableDataColumn; +import com.fr.log.FineLoggerFactory; import com.fr.report.cell.CellElement; import com.fr.report.cell.TemplateCellElement; import com.fr.report.cell.cellattr.core.group.DSColumn; @@ -373,13 +374,33 @@ public class SelectedDataColumnPane extends BasicPane { update(SelectedDataColumnPane.this.cellElement); casePane.fireTargetModified(); } + @Override + public void doCancel() { + editorPane.stopEditing(); + } }); - editorPane.populate(ps == null ? new Parameter[0] : ps); + editorPane.populate(ps == null ? new Parameter[0] : cloneParameterList(ps)); paramDialog.setVisible(true); } }); } + private Parameter[] cloneParameterList(Parameter[] parameters) { + if (parameters == null) { + return null; + } + try { + Parameter[] cloneParameterList = new Parameter[parameters.length]; + for (int i = 0; i < parameters.length; i++) { + cloneParameterList[i] = (Parameter) parameters[i].clone(); + } + return cloneParameterList; + } catch (CloneNotSupportedException e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } + return null; + } + private boolean isColumnName(String columnExp) { return StringUtils.isNotBlank(columnExp) && (columnExp.length() > 0 && columnExp.charAt(0) == '#') && !columnExp.endsWith("#"); @@ -397,8 +418,7 @@ public class SelectedDataColumnPane extends BasicPane { public Dimension getPreferredSize() { if (this.isVisible()) { return super.getPreferredSize(); - } - else { + } else { return new Dimension(); } } From ee764519ef73bbbd0236c28f096dee7ff54beda5 Mon Sep 17 00:00:00 2001 From: "Leo.Qin" Date: Fri, 14 Mar 2025 10:46:36 +0800 Subject: [PATCH 19/25] =?UTF-8?q?REPORT-148096=20=E6=9A=82=E6=97=B6?= =?UTF-8?q?=E8=BF=87=E6=BB=A4=E6=8E=89=E4=B8=8EUI=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E7=9A=84=E5=8D=95=E6=B5=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/actions/help/TutorialActionTest.java | 2 ++ .../design/data/datapane/TableDataPaneListPaneTest.java | 4 +++- .../tabledata/tabledatapane/DBTableDataPaneTest.java | 2 ++ .../design/gui/icombocheckbox/UICheckListPopupTest.java | 2 ++ .../fr/design/mainfarme/toolbar/ToolBarMenuDockTest.java | 8 +++++--- .../com/fr/design/mainframe/JFormSliderPaneTest.java | 4 +++- .../com/fr/design/utils/gui/UIComponentUtilsTest.java | 6 ++++-- .../src/test/java/com/fr/file/FILEChooserPaneTest.java | 2 ++ .../{com.fr => com/fr}/design/mainframe/JFileTest.java | 9 +++------ .../design/mainframe/alphafine/AlphaFineHelperTest.java | 0 .../design/mainframe/alphafine/cell/model/ModelTest.java | 3 +++ .../search/manager/impl/FileSearchManagerTest.java | 0 .../search/manager/impl/PluginSearchManagerTest.java | 0 .../fr/design/mainframe}/impl/SearchManegerTest.java | 0 .../design/mainframe}/info/JWorkBookProcessInfoTest.java | 0 15 files changed, 29 insertions(+), 13 deletions(-) rename designer-realize/src/test/java/{com.fr => com/fr}/design/mainframe/JFileTest.java (95%) rename designer-realize/src/test/java/{com.fr => com/fr}/design/mainframe/alphafine/AlphaFineHelperTest.java (100%) rename designer-realize/src/test/java/{com.fr => com/fr}/design/mainframe/alphafine/cell/model/ModelTest.java (98%) rename designer-realize/src/test/java/{com.fr => com/fr}/design/mainframe/alphafine/search/manager/impl/FileSearchManagerTest.java (100%) rename designer-realize/src/test/java/{com.fr => com/fr}/design/mainframe/alphafine/search/manager/impl/PluginSearchManagerTest.java (100%) rename designer-realize/src/test/java/{com.fr/design/mainframe/alphafine/search/manager => com/fr/design/mainframe}/impl/SearchManegerTest.java (100%) rename designer-realize/src/test/java/{com.fr/design/mainframe/template => com/fr/design/mainframe}/info/JWorkBookProcessInfoTest.java (100%) diff --git a/designer-base/src/test/java/com/fr/design/actions/help/TutorialActionTest.java b/designer-base/src/test/java/com/fr/design/actions/help/TutorialActionTest.java index 5ae51d380f..8bf00f8387 100644 --- a/designer-base/src/test/java/com/fr/design/actions/help/TutorialActionTest.java +++ b/designer-base/src/test/java/com/fr/design/actions/help/TutorialActionTest.java @@ -6,6 +6,7 @@ import com.fr.general.GeneralContext; import com.fr.stable.ProductConstants; import junit.framework.TestCase; import org.easymock.EasyMock; +import org.junit.Ignore; import org.junit.runner.RunWith; import org.powermock.api.easymock.PowerMock; import org.powermock.core.classloader.annotations.PowerMockIgnore; @@ -18,6 +19,7 @@ import java.util.UUID; @RunWith(PowerMockRunner.class) @PowerMockIgnore({"javax.management.*","javax.net.ssl.*"}) @PrepareForTest({Toolkit.class, SystemScaleUtils.class}) +@Ignore("涉及到UI") public class TutorialActionTest extends TestCase { public void setUp() { diff --git a/designer-base/src/test/java/com/fr/design/data/datapane/TableDataPaneListPaneTest.java b/designer-base/src/test/java/com/fr/design/data/datapane/TableDataPaneListPaneTest.java index 48b11be333..53e304e547 100644 --- a/designer-base/src/test/java/com/fr/design/data/datapane/TableDataPaneListPaneTest.java +++ b/designer-base/src/test/java/com/fr/design/data/datapane/TableDataPaneListPaneTest.java @@ -3,6 +3,7 @@ package com.fr.design.data.datapane; import com.fr.design.i18n.Toolkit; import org.easymock.EasyMock; import org.junit.Before; +import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.powermock.api.easymock.PowerMock; @@ -12,7 +13,7 @@ import org.powermock.modules.junit4.PowerMockRunner; import java.util.Map; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; /** * @author Yyming @@ -31,6 +32,7 @@ public class TableDataPaneListPaneTest { PowerMock.replayAll(); } + @Ignore("涉及到UI") @Test public void rename() { TableDataPaneListPane listPane = new TableDataPaneListPane(); diff --git a/designer-base/src/test/java/com/fr/design/data/tabledata/tabledatapane/DBTableDataPaneTest.java b/designer-base/src/test/java/com/fr/design/data/tabledata/tabledatapane/DBTableDataPaneTest.java index e549f13461..49086f200a 100644 --- a/designer-base/src/test/java/com/fr/design/data/tabledata/tabledatapane/DBTableDataPaneTest.java +++ b/designer-base/src/test/java/com/fr/design/data/tabledata/tabledatapane/DBTableDataPaneTest.java @@ -5,6 +5,7 @@ import com.fr.design.data.datapane.sqlpane.SQLEditPane; import com.fr.invoke.Reflect; import junit.framework.TestCase; import org.junit.Assert; +import org.junit.Ignore; /** * @author Yuan.Wang @@ -13,6 +14,7 @@ import org.junit.Assert; */ public class DBTableDataPaneTest extends TestCase { + @Ignore("涉及到UI") public void testGetParameters() { DBTableDataPane pane = new DBTableDataPane(); SQLEditPane editPane = new SQLEditPane(); diff --git a/designer-base/src/test/java/com/fr/design/gui/icombocheckbox/UICheckListPopupTest.java b/designer-base/src/test/java/com/fr/design/gui/icombocheckbox/UICheckListPopupTest.java index a35055c2fd..b20007a5d7 100644 --- a/designer-base/src/test/java/com/fr/design/gui/icombocheckbox/UICheckListPopupTest.java +++ b/designer-base/src/test/java/com/fr/design/gui/icombocheckbox/UICheckListPopupTest.java @@ -4,6 +4,7 @@ import com.fr.design.i18n.Toolkit; import junit.framework.TestCase; import org.junit.Assert; import org.junit.Before; +import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mockito; @@ -33,6 +34,7 @@ public class UICheckListPopupTest extends TestCase { PowerMockito.when(Toolkit.i18nText(Mockito.anyString())).thenReturn("test"); } + @Ignore("涉及到UI") @Test public void testGetSelectedValues() { Object[] values = new Object[]{"a", "b", "c"}; diff --git a/designer-base/src/test/java/com/fr/design/mainfarme/toolbar/ToolBarMenuDockTest.java b/designer-base/src/test/java/com/fr/design/mainfarme/toolbar/ToolBarMenuDockTest.java index a198dace8f..f072d8169a 100644 --- a/designer-base/src/test/java/com/fr/design/mainfarme/toolbar/ToolBarMenuDockTest.java +++ b/designer-base/src/test/java/com/fr/design/mainfarme/toolbar/ToolBarMenuDockTest.java @@ -1,8 +1,5 @@ package com.fr.design.mainfarme.toolbar; -import java.util.HashMap; -import java.util.Locale; - import com.fr.base.svg.SystemScaleUtils; import com.fr.design.DesignerEnvManager; import com.fr.design.actions.community.TechSupportAction; @@ -26,6 +23,7 @@ import com.fr.workspace.Workspace; import org.easymock.EasyMock; import org.junit.Assert; import org.junit.Before; +import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.powermock.api.easymock.PowerMock; @@ -34,6 +32,9 @@ import org.powermock.core.classloader.annotations.PrepareForTest; import org.powermock.modules.junit4.PowerMockRunner; import org.powermock.reflect.Whitebox; +import java.util.HashMap; +import java.util.Locale; + /** * @author Lucian.Chen @@ -51,6 +52,7 @@ import org.powermock.reflect.Whitebox; SystemScaleUtils.class, AlphaFineConfigManager.class}) @PowerMockIgnore({"javax.management.*"}) +@Ignore("涉及到UI") public class ToolBarMenuDockTest { @Before diff --git a/designer-base/src/test/java/com/fr/design/mainframe/JFormSliderPaneTest.java b/designer-base/src/test/java/com/fr/design/mainframe/JFormSliderPaneTest.java index 5853b10094..aa63028d6c 100644 --- a/designer-base/src/test/java/com/fr/design/mainframe/JFormSliderPaneTest.java +++ b/designer-base/src/test/java/com/fr/design/mainframe/JFormSliderPaneTest.java @@ -1,11 +1,11 @@ package com.fr.design.mainframe; -import com.fr.base.ScreenResolution; import com.fr.design.i18n.Toolkit; import com.fr.invoke.Reflect; import org.easymock.EasyMock; import org.junit.Assert; import org.junit.Before; +import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.powermock.api.easymock.PowerMock; @@ -28,6 +28,7 @@ public class JFormSliderPaneTest { PowerMock.replayAll(); } + @Ignore("涉及到UI") @Test public void testGetPreferredValue() { JFormSliderPane sliderPane = new JFormSliderPane(); @@ -39,6 +40,7 @@ public class JFormSliderPaneTest { Assert.assertEquals(400, result); } + @Ignore("涉及到UI") @Test public void testCalSliderValue() { JFormSliderPane sliderPane = new JFormSliderPane(); diff --git a/designer-base/src/test/java/com/fr/design/utils/gui/UIComponentUtilsTest.java b/designer-base/src/test/java/com/fr/design/utils/gui/UIComponentUtilsTest.java index dcb21f7999..a76fa93270 100644 --- a/designer-base/src/test/java/com/fr/design/utils/gui/UIComponentUtilsTest.java +++ b/designer-base/src/test/java/com/fr/design/utils/gui/UIComponentUtilsTest.java @@ -8,6 +8,7 @@ import com.fr.general.GeneralContext; import com.fr.stable.StringUtils; import org.easymock.EasyMock; import org.junit.Before; +import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.powermock.api.easymock.PowerMock; @@ -16,12 +17,12 @@ import org.powermock.core.classloader.annotations.PrepareForTest; import org.powermock.modules.junit4.PowerMockRunner; import javax.swing.Icon; - import java.awt.Component; import java.awt.Graphics; import java.util.Locale; -import static org.junit.Assert.*; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; /** * Created by plough on 2019/1/11. @@ -29,6 +30,7 @@ import static org.junit.Assert.*; @RunWith(PowerMockRunner.class) @PrepareForTest({Toolkit.class}) @PowerMockIgnore("javax.swing.*") +@Ignore("涉及到UI") public class UIComponentUtilsTest { private static final String HTML_TAG_TPL = ""; private static final String HTML_TAG = ""; diff --git a/designer-base/src/test/java/com/fr/file/FILEChooserPaneTest.java b/designer-base/src/test/java/com/fr/file/FILEChooserPaneTest.java index 8db47b9c44..12e0639821 100644 --- a/designer-base/src/test/java/com/fr/file/FILEChooserPaneTest.java +++ b/designer-base/src/test/java/com/fr/file/FILEChooserPaneTest.java @@ -7,6 +7,7 @@ import com.fr.invoke.Reflect; import com.fr.stable.StringUtils; import org.easymock.EasyMock; import org.junit.Assert; +import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.powermock.api.easymock.PowerMock; @@ -21,6 +22,7 @@ import org.powermock.modules.junit4.PowerMockRunner; @RunWith(PowerMockRunner.class) @PowerMockIgnore({"javax.management.*", "javax.swing.*"}) @PrepareForTest({Toolkit.class, FileNodeFILE.class}) +@Ignore("涉及到UI") public class FILEChooserPaneTest { @Test public void testAddChooseFileFilter() { diff --git a/designer-realize/src/test/java/com.fr/design/mainframe/JFileTest.java b/designer-realize/src/test/java/com/fr/design/mainframe/JFileTest.java similarity index 95% rename from designer-realize/src/test/java/com.fr/design/mainframe/JFileTest.java rename to designer-realize/src/test/java/com/fr/design/mainframe/JFileTest.java index 1651043f74..a1da5a0d24 100644 --- a/designer-realize/src/test/java/com.fr/design/mainframe/JFileTest.java +++ b/designer-realize/src/test/java/com/fr/design/mainframe/JFileTest.java @@ -12,7 +12,6 @@ import com.fr.config.dao.impl.LocalXmlEntityDao; import com.fr.design.mainframe.theme.utils.DefaultThemedTemplateCellElementCase; import com.fr.form.main.Form; import com.fr.form.ui.ElementCaseEditor; -import com.fr.form.ui.container.OccupiedLayout; import com.fr.form.ui.container.WFitLayout; import com.fr.general.ImageWithSuffix; import com.fr.general.ModuleContext; @@ -25,17 +24,13 @@ import com.fr.report.restriction.ReportRestrictionScene; import com.fr.report.worksheet.FormElementCase; import com.fr.report.worksheet.WorkSheet; import com.fr.restriction.Restrictions; -import com.fr.stable.StringUtils; import com.fr.stable.module.Module; import com.fr.start.MainDesigner; import com.fr.third.guava.collect.Lists; -import com.fr.transaction.WorkerCallBack; import junit.framework.TestCase; -import org.easymock.EasyMock; import org.junit.Assert; +import org.junit.Ignore; import org.junit.runner.RunWith; -import org.mockito.Mockito; -import org.powermock.api.easymock.PowerMock; import org.powermock.core.classloader.annotations.PowerMockIgnore; import org.powermock.modules.junit4.PowerMockRunner; @@ -57,6 +52,7 @@ public class JFileTest extends TestCase { MainDesigner designer = new MainDesigner(new String[0]); } + @Ignore("涉及到UI") public void testJWorkBookSetPicture() { WorkBook workBook = new WorkBook(); WorkSheet workSheet = new WorkSheet(); @@ -72,6 +68,7 @@ public class JFileTest extends TestCase { Assert.assertEquals(imageWithSuffix, cellElement.getValue()); } + @Ignore("涉及到UI") public void testJFormSetPicture() { Form form = new Form(); ElementCaseEditor editor = new ElementCaseEditor(); diff --git a/designer-realize/src/test/java/com.fr/design/mainframe/alphafine/AlphaFineHelperTest.java b/designer-realize/src/test/java/com/fr/design/mainframe/alphafine/AlphaFineHelperTest.java similarity index 100% rename from designer-realize/src/test/java/com.fr/design/mainframe/alphafine/AlphaFineHelperTest.java rename to designer-realize/src/test/java/com/fr/design/mainframe/alphafine/AlphaFineHelperTest.java diff --git a/designer-realize/src/test/java/com.fr/design/mainframe/alphafine/cell/model/ModelTest.java b/designer-realize/src/test/java/com/fr/design/mainframe/alphafine/cell/model/ModelTest.java similarity index 98% rename from designer-realize/src/test/java/com.fr/design/mainframe/alphafine/cell/model/ModelTest.java rename to designer-realize/src/test/java/com/fr/design/mainframe/alphafine/cell/model/ModelTest.java index 26cfc71684..3f9d43d418 100644 --- a/designer-realize/src/test/java/com.fr/design/mainframe/alphafine/cell/model/ModelTest.java +++ b/designer-realize/src/test/java/com/fr/design/mainframe/alphafine/cell/model/ModelTest.java @@ -7,6 +7,7 @@ import com.fr.json.JSONException; import com.fr.json.JSONObject; import org.junit.Assert; import org.junit.Before; +import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mockito; @@ -26,6 +27,7 @@ public class ModelTest { PowerMockito.when(Toolkit.i18nText(Mockito.anyString())).thenReturn("test"); } + @Ignore("涉及到UI") @Test public void documentModelTest() { DocumentModel documentModel = new DocumentModel("name", "content", 1); @@ -48,6 +50,7 @@ public class ModelTest { Assert.assertNotNull(documentModel.modelToJson()); } + @Ignore("涉及到UI") @Test public void bottomModelTest() { BottomModel bottomModel = new BottomModel(); diff --git a/designer-realize/src/test/java/com.fr/design/mainframe/alphafine/search/manager/impl/FileSearchManagerTest.java b/designer-realize/src/test/java/com/fr/design/mainframe/alphafine/search/manager/impl/FileSearchManagerTest.java similarity index 100% rename from designer-realize/src/test/java/com.fr/design/mainframe/alphafine/search/manager/impl/FileSearchManagerTest.java rename to designer-realize/src/test/java/com/fr/design/mainframe/alphafine/search/manager/impl/FileSearchManagerTest.java diff --git a/designer-realize/src/test/java/com.fr/design/mainframe/alphafine/search/manager/impl/PluginSearchManagerTest.java b/designer-realize/src/test/java/com/fr/design/mainframe/alphafine/search/manager/impl/PluginSearchManagerTest.java similarity index 100% rename from designer-realize/src/test/java/com.fr/design/mainframe/alphafine/search/manager/impl/PluginSearchManagerTest.java rename to designer-realize/src/test/java/com/fr/design/mainframe/alphafine/search/manager/impl/PluginSearchManagerTest.java diff --git a/designer-realize/src/test/java/com.fr/design/mainframe/alphafine/search/manager/impl/SearchManegerTest.java b/designer-realize/src/test/java/com/fr/design/mainframe/impl/SearchManegerTest.java similarity index 100% rename from designer-realize/src/test/java/com.fr/design/mainframe/alphafine/search/manager/impl/SearchManegerTest.java rename to designer-realize/src/test/java/com/fr/design/mainframe/impl/SearchManegerTest.java diff --git a/designer-realize/src/test/java/com.fr/design/mainframe/template/info/JWorkBookProcessInfoTest.java b/designer-realize/src/test/java/com/fr/design/mainframe/info/JWorkBookProcessInfoTest.java similarity index 100% rename from designer-realize/src/test/java/com.fr/design/mainframe/template/info/JWorkBookProcessInfoTest.java rename to designer-realize/src/test/java/com/fr/design/mainframe/info/JWorkBookProcessInfoTest.java From 30450a5c7fb57babb7c18dee41c4cd4f81996415 Mon Sep 17 00:00:00 2001 From: "Leo.Qin" Date: Fri, 14 Mar 2025 11:13:08 +0800 Subject: [PATCH 20/25] =?UTF-8?q?REPORT-148096=20=E8=AF=A5=E6=96=B9?= =?UTF-8?q?=E6=B3=95=E7=9A=84=E5=8D=95=E6=B5=8B=E6=B2=A1=E7=94=A8=E4=BA=86?= =?UTF-8?q?=EF=BC=8C=E4=B9=8B=E5=89=8D=E8=A1=A5=E5=85=85=E4=BA=86=E6=96=B0?= =?UTF-8?q?=E7=9A=84=E6=B2=A1=E6=9C=89=E5=88=A0=E9=99=A4=E6=97=A7=E7=9A=84?= =?UTF-8?q?=20&&=20=E6=94=B9=E5=8A=A8=EF=BC=8C=E5=87=BA=E7=8E=B0=E4=BA=86?= =?UTF-8?q?=E6=9C=AA=E9=A2=84=E6=9C=9F=E8=B0=83=E7=94=A8=E7=9A=84=E6=96=B9?= =?UTF-8?q?=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/mainframe/JTemplateNameHelperTest.java | 14 +------------- .../mobile/ui/UniteStyleDefinePaneTest.java | 10 +++++++++- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/designer-base/src/test/java/com/fr/design/mainframe/JTemplateNameHelperTest.java b/designer-base/src/test/java/com/fr/design/mainframe/JTemplateNameHelperTest.java index 0202028480..2b7b5cbfe3 100644 --- a/designer-base/src/test/java/com/fr/design/mainframe/JTemplateNameHelperTest.java +++ b/designer-base/src/test/java/com/fr/design/mainframe/JTemplateNameHelperTest.java @@ -1,8 +1,7 @@ package com.fr.design.mainframe; -import junit.framework.TestCase; - import com.fr.invoke.Reflect; +import junit.framework.TestCase; /** * @author shine @@ -11,17 +10,6 @@ import com.fr.invoke.Reflect; */ public class JTemplateNameHelperTest extends TestCase { - public void testNewTemplateNameByIndex() { - - String name = JTemplateNameHelper.newTemplateNameByIndex("TEST"); - - assertEquals("TEST1", name); - - String name1 = JTemplateNameHelper.newTemplateNameByIndex("TEST"); - - assertEquals("TEST2", name1); - } - public void testGetFileNameIndex() { //正常情况 assertEquals("1", Reflect.on(JTemplateNameHelper.class).call("getFileNameIndex", "WorkBook", "WorkBook1").toString()); diff --git a/designer-base/src/test/java/com/fr/design/mainframe/mobile/ui/UniteStyleDefinePaneTest.java b/designer-base/src/test/java/com/fr/design/mainframe/mobile/ui/UniteStyleDefinePaneTest.java index 857a367d21..40e4d9b8db 100644 --- a/designer-base/src/test/java/com/fr/design/mainframe/mobile/ui/UniteStyleDefinePaneTest.java +++ b/designer-base/src/test/java/com/fr/design/mainframe/mobile/ui/UniteStyleDefinePaneTest.java @@ -1,17 +1,25 @@ package com.fr.design.mainframe.mobile.ui; +import com.fr.design.mainframe.DesignerContext; +import com.fr.design.mainframe.DesignerFrame; import com.fr.form.ui.container.cardlayout.WCardTagLayout; import com.fr.general.cardtag.mobile.UniteStyle; import com.fr.invoke.Reflect; import junit.framework.TestCase; +import org.easymock.EasyMock; import org.junit.Test; -import java.awt.*; +import java.awt.Color; public class UniteStyleDefinePaneTest extends TestCase { @Test public void testDefaultConfig() { + DesignerFrame mockFrame = EasyMock.mock(DesignerFrame.class); + DesignerContext.setDesignerFrame(mockFrame); + EasyMock.expect(mockFrame.isServerConfig()).andReturn(false).anyTimes(); + EasyMock.replay(mockFrame); + UniteStyleDefinePane definePane = new UniteStyleDefinePane(new WCardTagLayout()); Reflect.on(definePane).call("initDefaultConfig"); From a125b40d18b40bc4b89017d3619b4e96d78ab4be Mon Sep 17 00:00:00 2001 From: "Leo.Qin" Date: Fri, 14 Mar 2025 11:25:52 +0800 Subject: [PATCH 21/25] =?UTF-8?q?REPORT-148096=20=E6=95=B4=E4=BD=93?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E5=B7=B2=E9=87=8D=E6=9E=84=EF=BC=8C=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E6=97=A0=E6=95=88=E5=8D=95=E6=B5=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../socketio/DesignerSocketIOTest.java | 60 ------------------- 1 file changed, 60 deletions(-) delete mode 100644 designer-realize/src/test/java/com/fr/design/mainframe/socketio/DesignerSocketIOTest.java diff --git a/designer-realize/src/test/java/com/fr/design/mainframe/socketio/DesignerSocketIOTest.java b/designer-realize/src/test/java/com/fr/design/mainframe/socketio/DesignerSocketIOTest.java deleted file mode 100644 index b775f56e9d..0000000000 --- a/designer-realize/src/test/java/com/fr/design/mainframe/socketio/DesignerSocketIOTest.java +++ /dev/null @@ -1,60 +0,0 @@ -package com.fr.design.mainframe.socketio; - -import com.fr.invoke.Reflect; -import com.fr.workspace.WorkContext; -import com.fr.workspace.Workspace; -import io.socket.client.IO; -import io.socket.client.Socket; - -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: Maksim - * @Date: Created in 2019/12/9 - * @Description: - */ -@RunWith(PowerMockRunner.class) -@PrepareForTest({WorkContext.class,DesignerSocketIO.class, IO.class}) -public class DesignerSocketIOTest { - - @Test - public void close() throws Exception { - this.update(); - DesignerSocketIO.close(); - DesignerSocketIO.Status status = Reflect.on(DesignerSocketIO.class).field("status").get(); - Socket socket = Reflect.on(DesignerSocketIO.class).field("socket").get(); - - Assert.assertEquals(DesignerSocketIO.Status.Disconnecting,status); - Assert.assertNull(socket); - } - - @Test - public void update() throws Exception { - Workspace current = EasyMock.mock(Workspace.class); - EasyMock.expect(current.isLocal()).andReturn(false); - - PowerMock.mockStatic(WorkContext.class); - EasyMock.expect(WorkContext.getCurrent()).andReturn(current); - - String[] uri = {"http://127.0.0.1:8888/workspace","http://127.0.0.1:9999/workspace"}; - PowerMock.mockStaticPartial(DesignerSocketIO.class,"getSocketUri"); - PowerMock.expectPrivate(DesignerSocketIO.class,"getSocketUri").andReturn(uri); - - EasyMock.replay(current); - PowerMock.replayAll(); - - DesignerSocketIO.update(); - DesignerSocketIO.Status status = Reflect.on(DesignerSocketIO.class).field("status").get(); - Socket socket = Reflect.on(DesignerSocketIO.class).field("socket").get(); - - Assert.assertEquals(DesignerSocketIO.Status.Connected,status); - Assert.assertNotNull(socket); - } -} \ No newline at end of file From 92c87cb4e9041eef9907a88b3cf6bdf1b71bc0b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Brian=2ELuo-=E7=BD=97=E6=97=AD?= Date: Mon, 17 Mar 2025 15:31:16 +0800 Subject: [PATCH 22/25] =?UTF-8?q?REPORT-148138=20=E5=8D=95=E6=B5=8B?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=8C=E7=94=B1=E4=BA=8E=E8=B5=84=E6=BA=90?= =?UTF-8?q?=E5=90=8C=E5=90=8D=E5=AF=BC=E8=87=B4=E8=A6=86=E7=9B=96=EF=BC=8C?= =?UTF-8?q?=E5=87=BA=E7=8E=B0=E5=8D=95=E6=B5=8B=E9=94=99=E8=AF=AF=EF=BC=8C?= =?UTF-8?q?=E9=80=9A=E8=BF=87=E4=BF=AE=E6=94=B9=E8=B5=84=E6=BA=90=E8=A7=A3?= =?UTF-8?q?=E5=86=B3=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../javascript/jsapi/JSAPITreeHelperTest.java | 4 +-- .../fr/design/javascript/jsapi/category.json | 31 ++++++++++++++++++- .../com/fr/design/javascript/jsapi/jsapi.json | 27 +++++++++++++++- 3 files changed, 58 insertions(+), 4 deletions(-) diff --git a/designer-base/src/test/java/com/fr/design/javascript/jsapi/JSAPITreeHelperTest.java b/designer-base/src/test/java/com/fr/design/javascript/jsapi/JSAPITreeHelperTest.java index e0d5ae7c9e..096c416128 100644 --- a/designer-base/src/test/java/com/fr/design/javascript/jsapi/JSAPITreeHelperTest.java +++ b/designer-base/src/test/java/com/fr/design/javascript/jsapi/JSAPITreeHelperTest.java @@ -13,7 +13,7 @@ public class JSAPITreeHelperTest extends TestCase { assertTrue(names.contains( "getToolbar")); assertTrue(names.contains( "changeFormat")); List allNames = JSAPITreeHelper.getAllNames(); - assertEquals(allNames.size(),16); + assertEquals(allNames.size(),104); } public void testGetDirectCategory(){ @@ -26,6 +26,6 @@ public class JSAPITreeHelperTest extends TestCase { public void testCreateJSAPITree(){ DefaultMutableTreeNode rootNode = new DefaultMutableTreeNode(); JSAPITreeHelper.createJSAPITree(rootNode); - assertEquals(2,rootNode.getChildCount()); + assertEquals(3,rootNode.getChildCount()); } } diff --git a/designer-base/src/test/resources/com/fr/design/javascript/jsapi/category.json b/designer-base/src/test/resources/com/fr/design/javascript/jsapi/category.json index 2d0e50ba02..ece3628ab5 100644 --- a/designer-base/src/test/resources/com/fr/design/javascript/jsapi/category.json +++ b/designer-base/src/test/resources/com/fr/design/javascript/jsapi/category.json @@ -2,16 +2,45 @@ "Fine-Design_JSAPI_Public_Module": { "Fine-Design_JSAPI_Public_Module_Global": { "Fine-Design_JSAPI_Public_Module_Global_Universal": {}, + "Fine-Design_JSAPI_Public_Module_Global_FR": {}, + "Fine-Design_JSAPI_Public_Module_Global_FS": {}, "Fine-Design_JSAPI_Public_Module_Global_Mobile": {} }, "Fine-Design_JSAPI_Public_Module_Widget": { - "Fine-Design_JSAPI_Public_Module_Date_Widget_Peculiar": {} + "Fine-Design_JSAPI_Public_Module_Widget_Get": {}, + "Fine-Design_JSAPI_Public_Module_Widget_Universal": {}, + "Fine-Design_JSAPI_Public_Module_Date_Widget_Peculiar": {}, + "Fine-Design_JSAPI_Public_Module_Button_Widget_Peculiar": {}, + "Fine-Design_JSAPI_Public_Module_Combobox_Widget_Peculiar": {} + }, + "Fine-Design_JSAPI_Public_Module_Table": { + "Fine-Design_JSAPI_Public_Module_Table_Marquee": {}, + "Fine-Design_JSAPI_Public_Module_Table_Scrollbar": {}, + "Fine-Design_JSAPI_Public_Module_Table_Cell_Style": {}, + "Fine-Design_JSAPI_Public_Module_Table_Row_Height_Col_Width": {}, + "Fine-Design_JSAPI_Public_Module_Table_Cell_Value": {}, + "Fine-Design_JSAPI_Public_Module_Table_Cell_Radius": {} }, "Fine-Design_JSAPI_Public_Module_Toolbar": { "Fine-Design_JSAPI_Public_Module_Toolbar_Email_Button": {} + }, + "Fine-Design_JSAPI_Public_Module_Report_Page": { + "Fine-Design_JSAPI_Public_Module_Report_Page_Jump": {}, + "Fine-Design_JSAPI_Public_Module_Report_Page_Number_Get": {} + }, + "Fine-Design_JSAPI_Public_Module_Report_Export": {} + }, + "Fine-Design_JSAPI_Cpt": { + "Fine-Design_JSAPI_Cpt_Page_Preview": { + "Fine-Design_JSAPI_Cpt_Page_Preview_Folding_Tree": {} + }, + "Fine-Design_JSAPI_Cpt_Write_Preview": {}, + "Fine-Design_JSAPI_Cpt_View_Preview": { + "Fine-Design_JSAPI_Cpt_View_Preview_Report_Location": {} } }, "Fine-Design_JSAPI_Form": { + "Fine-Design_JSAPI_Form_Component_Get": {}, "Fine-Design_JSAPI_Form_Component_Tab": {} } } \ No newline at end of file diff --git a/designer-base/src/test/resources/com/fr/design/javascript/jsapi/jsapi.json b/designer-base/src/test/resources/com/fr/design/javascript/jsapi/jsapi.json index 4ff0a321ed..dcad373927 100644 --- a/designer-base/src/test/resources/com/fr/design/javascript/jsapi/jsapi.json +++ b/designer-base/src/test/resources/com/fr/design/javascript/jsapi/jsapi.json @@ -1,8 +1,33 @@ { "Fine-Design_JSAPI_Public_Module_Global_Universal": ["_g()", "getParameterContainer", "parameterCommit", "loadContentPane", "getPreviewType"], + "Fine-Design_JSAPI_Public_Module_Global_FR": [ "servletURL", "serverURL", "server", "fineServletURL", "SessionMgr.getSessionID", "showDialog", "closeDialog", + "doHyperlinkByGet", "doHyperlinkByPost", "doURLPrint", "Msg", "remoteEvaluate", "jsonEncode", "jsonDecode", + "ajax", "isEmpty", "isArray", "cellStr2ColumnRow", "columnRow2CellStr"], + "Fine-Design_JSAPI_Public_Module_Global_FS": ["signOut", "tabPane.closeActiveTab", "tabPane.addItem"], "Fine-Design_JSAPI_Public_Module_Global_Mobile": ["location", "Mobile.getDeviceInfo"], + "Fine-Design_JSAPI_Public_Module_Widget_Get": ["this", "this.options.form", "getWidgetByName"], + "Fine-Design_JSAPI_Public_Module_Widget_Universal": ["getValue", "getText", "setValue", "visible", "invisible", "setVisible", "isVisible", "setEnable", "isEnabled", + "reset", "getType", "setWaterMark", "fireEvent", "setPopupStyle"], "Fine-Design_JSAPI_Public_Module_Date_Widget_Peculiar":["setMaxAndMinDate"], + "Fine-Design_JSAPI_Public_Module_Button_Widget_Peculiar":["doClick"], + "Fine-Design_JSAPI_Public_Module_Combobox_Widget_Peculiar":["setName4Empty"], + "Fine-Design_JSAPI_Public_Module_Table_Marquee":["startMarquee", "stopMarquee"], + "Fine-Design_JSAPI_Public_Module_Table_Scrollbar":["setHScrollBarVisible", "setVScrollBarVisible"], + "Fine-Design_JSAPI_Public_Module_Table_Cell_Style":["addEffect"], + "Fine-Design_JSAPI_Public_Module_Table_Row_Height_Col_Width":["setRowHeight", "setColWidth"], + "Fine-Design_JSAPI_Public_Module_Table_Cell_Value":["getCellValue", "setCellValue"], + "Fine-Design_JSAPI_Public_Module_Table_Cell_Radius":["setCellRadius"], "Fine-Design_JSAPI_Public_Module_Toolbar":["toolBarFloat", "setStyle","getToolbar"], "Fine-Design_JSAPI_Public_Module_Toolbar_Email_Button":["changeFormat"], - "Fine-Design_JSAPI_Form_Component_Tab":["showCardByIndex", "showCardByIndex", "getShowIndex", "setTitleVisible"] + "Fine-Design_JSAPI_Public_Module_Report_Page_Jump":["gotoPreviousPage", "gotoNextPage", "gotoLastPage", "gotoFirstPage", "gotoPage"], + "Fine-Design_JSAPI_Public_Module_Report_Page_Number_Get":["getCurrentPageIndex", "getReportTotalPage", "currentPageIndex", "reportTotalPage"], + "Fine-Design_JSAPI_Public_Module_Report_Export":["exportReportToExcel", "exportReportToImage", "exportReportToPDF", "exportReportToWord"], + "Fine-Design_JSAPI_Cpt_Page_Preview_Folding_Tree":["expandNodeLayer", "collapseNodeLayer", "expandAllNodeLayer", "collapseAllNodeLayer"], + "Fine-Design_JSAPI_Cpt_Write_Preview":["getWidgetByCell", "appendReportRC", "appendReportRow", + "deleteReportRC", "deleteRows", "refreshAllSheets", "loadSheetByIndex", "loadSheetByName", "isDirtyPage", + "isAutoStash", "writeReport", "verifyAndWriteReport", "verifyReport", "importExcel", "importExcel_Clean", + "importExcel_Append", "importExcel_Cover", "stash", "clear"], + "Fine-Design_JSAPI_Cpt_View_Preview_Report_Location":["centerReport"], + "Fine-Design_JSAPI_Form_Component_Get":["getAllWidgets"], + "Fine-Design_JSAPI_Form_Component_Tab":["showCardByIndex", "getShowIndex", "setTitleVisible"] } \ No newline at end of file From caede8d25ff4849797f10dfb669944d12d05b91d Mon Sep 17 00:00:00 2001 From: "shengzu.xue" Date: Tue, 18 Mar 2025 09:59:46 +0800 Subject: [PATCH 23/25] =?UTF-8?q?REPORT-149012=20alphafine=E4=B8=AD?= =?UTF-8?q?=E6=90=9C=E7=B4=A2=E4=B9=8B=E5=89=8D=E5=8F=AF=E4=BB=A5=E5=9C=A8?= =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E5=99=A8=E4=B8=AD=E6=90=9C=E5=88=B0BI?= =?UTF-8?q?=E7=9A=84=E6=A8=A1=E6=9D=BF=EF=BC=8C=E7=8E=B0=E5=9C=A8=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0cid=E5=8F=82=E6=95=B0=EF=BC=8C=E5=8F=AA=E6=90=9C?= =?UTF-8?q?=E7=B4=A2fr=E7=9B=B8=E5=85=B3=E6=A8=A1=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../alphafine/search/helper/FineMarketClientHelper.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/helper/FineMarketClientHelper.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/helper/FineMarketClientHelper.java index 817a47cca4..c240b1227f 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/helper/FineMarketClientHelper.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/helper/FineMarketClientHelper.java @@ -55,6 +55,8 @@ public class FineMarketClientHelper { public static final String TEMPLATES_PARENT_PACKAGE = "parent/"; public static final String TEMPLATES_TAGS = "filter"; public static final String NAME_SEARCH = "?searchKeyword="; + public static final String CID_SEARCH = "&cid="; + public static final String FR_CID_TYPE = "template_type-1,template_type-2,template_type-3"; public static final String RESPONSE_STATE = "state"; public static final String RESPONSE_SUCCESS = "ok"; @@ -273,7 +275,7 @@ public class FineMarketClientHelper { * 通过名字搜索模板信息 */ public @Nullable JSONArray getTemplateInfoByName(String name) throws IOException { - String url = FINE_MARKET_TEMPLATE_INFO + NAME_SEARCH + ClientHelper.urlEncode(name, EncodeConstants.ENCODING_UTF_8); + String url = FINE_MARKET_TEMPLATE_INFO + NAME_SEARCH + ClientHelper.urlEncode(name, EncodeConstants.ENCODING_UTF_8) + CID_SEARCH + FR_CID_TYPE; String jsonString = HttpToolbox.get(url); JSONObject jsonObject = new JSONObject(jsonString); String responseState = (String) jsonObject.get(RESPONSE_STATE); From 45a112ad1db836146e8b23ea6ce30e5f9d64286b Mon Sep 17 00:00:00 2001 From: lemon Date: Tue, 18 Mar 2025 15:18:44 +0800 Subject: [PATCH 24/25] =?UTF-8?q?REPORT-148266=20revert:=20=E6=92=A4?= =?UTF-8?q?=E5=9B=9ETableDataComboBox=E6=95=B0=E6=8D=AE=E9=9B=86=E5=90=8D?= =?UTF-8?q?=E7=A7=B0=E5=B1=95=E7=A4=BA=E7=9A=84=E6=94=B9=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/data/datapane/TableDataComboBox.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/TableDataComboBox.java b/designer-base/src/main/java/com/fr/design/data/datapane/TableDataComboBox.java index e177837470..d8f8e63fb0 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/TableDataComboBox.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/TableDataComboBox.java @@ -206,10 +206,6 @@ public class TableDataComboBox extends UIComboBox implements Prepare4DataSourceC public void setSelectedTableDataByName(String name) { setResMap(DesignTableDataManager.getEditingTableDataSource()); setDsMap(); - // 数据集名称修改后控件传入的还是旧名称 - if (DesignTableDataManager.isDsNameChanged(name)) { - name = DesignTableDataManager.getChangedDsNameByOldDsName(name); - } setSelectedTableData(name); } From dbfee2c111403fb02425cb21fc6be64c87f8f9c7 Mon Sep 17 00:00:00 2001 From: "shengzu.xue" Date: Wed, 19 Mar 2025 15:09:11 +0800 Subject: [PATCH 25/25] =?UTF-8?q?REPORT-143899=20=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E6=96=B0=E5=BB=BA=E6=96=87=E4=BB=B6=E5=A4=B9=E6=B2=A1?= =?UTF-8?q?=E6=9C=89=E6=9D=83=E9=99=90=20=E4=BF=AE=E6=94=B9=E9=80=BB?= =?UTF-8?q?=E8=BE=91=E5=88=A0=E9=99=A4=E5=8D=95=E4=B8=AA=E8=8A=82=E7=82=B9?= =?UTF-8?q?=E5=90=8E=E9=BB=98=E8=AE=A4=E9=80=89=E4=B8=AD=E4=B8=8A=E5=B1=82?= =?UTF-8?q?=E8=8A=82=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/file/TemplateTreePane.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/file/TemplateTreePane.java b/designer-base/src/main/java/com/fr/design/file/TemplateTreePane.java index 5dfedc2662..cb3de24929 100644 --- a/designer-base/src/main/java/com/fr/design/file/TemplateTreePane.java +++ b/designer-base/src/main/java/com/fr/design/file/TemplateTreePane.java @@ -397,7 +397,11 @@ public class TemplateTreePane extends JPanel implements FileOperations { if (paths == null) { reportletsTree.refresh(); } else { - for (TreePath path : Objects.requireNonNull(reportletsTree.getSelectionPaths())) { + // 删除一个节点的情况下,默认选中为该节点的上一级节点 + if (paths.length == 1 && paths[0].getParentPath() != null) { + reportletsTree.setSelectionPath(paths[0].getParentPath()); + } + for (TreePath path : Objects.requireNonNull(paths)) { reportletsTree.refreshParent(path); } }