From e9c268f525e4e0a8a9c7780473ebf98ba90ac6fd Mon Sep 17 00:00:00 2001 From: "Bruce.Deng" Date: Wed, 22 Feb 2023 13:46:40 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-83259=20&=20REPORT-83263=20=E3=80=90?= =?UTF-8?q?=E6=9C=80=E5=BC=BA=E6=8E=A7=E4=BB=B6=E3=80=91=E6=8E=A7=E4=BB=B6?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E8=B7=9F=E9=9A=8F=E4=B8=BB=E9=A2=98&?= =?UTF-8?q?=E5=BC=80=E6=94=BE=E8=87=AA=E5=AE=9A=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/fun/TemplateThemePaneProvider.java | 22 +++++++++ .../AbstractTemplateThemePaneProvider.java | 25 ++++++++++ .../mainframe/theme/FormThemeProfilePane.java | 9 +++- .../theme/ReportThemeProfilePane.java | 10 +++- .../theme/TemplateThemeEditorPane.java | 27 ++++++++-- .../AbstractThemePreviewPaneProcessor.java | 23 +++++++++ .../processor/ThemePreviewPaneProcessor.java | 35 +++++++++++++ .../fun/WidgetAdvancedPaneProvider.java | 34 +++++++++++++ .../AbstractWidgetAdvancedPaneProvider.java | 25 ++++++++++ .../parameter/RootDesignDefinePane.java | 49 ++++++++++++++++--- .../ui/designer/FieldEditorDefinePane.java | 31 ++++++++++-- .../com/fr/design/mainframe/JWorkBook.java | 3 ++ 12 files changed, 278 insertions(+), 15 deletions(-) create mode 100644 designer-base/src/main/java/com/fr/design/fun/TemplateThemePaneProvider.java create mode 100644 designer-base/src/main/java/com/fr/design/fun/impl/AbstractTemplateThemePaneProvider.java create mode 100644 designer-base/src/main/java/com/fr/design/mainframe/theme/processor/AbstractThemePreviewPaneProcessor.java create mode 100644 designer-base/src/main/java/com/fr/design/mainframe/theme/processor/ThemePreviewPaneProcessor.java create mode 100644 designer-form/src/main/java/com/fr/design/fun/WidgetAdvancedPaneProvider.java create mode 100644 designer-form/src/main/java/com/fr/design/fun/impl/AbstractWidgetAdvancedPaneProvider.java diff --git a/designer-base/src/main/java/com/fr/design/fun/TemplateThemePaneProvider.java b/designer-base/src/main/java/com/fr/design/fun/TemplateThemePaneProvider.java new file mode 100644 index 0000000000..e33cb4e302 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/fun/TemplateThemePaneProvider.java @@ -0,0 +1,22 @@ +package com.fr.design.fun; + +import com.fr.design.beans.BasicBeanPane; +import com.fr.stable.fun.mark.Mutable; + +/** + * @author Bruce.Deng + * @version 11.0 + * Created by Bruce.Deng on 2023/2/7 + */ +public interface TemplateThemePaneProvider extends Mutable { + + String XML_TAG = "TemplateThemePaneProvider"; + + int CURRENT_LEVEL = 1; + + String getTabName(); + + + BasicBeanPane getTab(); + +} diff --git a/designer-base/src/main/java/com/fr/design/fun/impl/AbstractTemplateThemePaneProvider.java b/designer-base/src/main/java/com/fr/design/fun/impl/AbstractTemplateThemePaneProvider.java new file mode 100644 index 0000000000..5dd4387277 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/fun/impl/AbstractTemplateThemePaneProvider.java @@ -0,0 +1,25 @@ +package com.fr.design.fun.impl; + +import com.fr.design.fun.TemplateThemePaneProvider; +import com.fr.stable.fun.impl.AbstractProvider; +import com.fr.stable.fun.mark.API; + +/** + * @author Bruce.Deng + * @version 11.0 + * Created by Bruce.Deng on 2023/2/7 + */ +@API(level = TemplateThemePaneProvider.CURRENT_LEVEL) +public abstract class AbstractTemplateThemePaneProvider extends AbstractProvider implements TemplateThemePaneProvider { + + @Override + public int currentAPILevel() { + return CURRENT_LEVEL; + } + + @Override + public String mark4Provider() { + return getClass().getName(); + } + +} diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/FormThemeProfilePane.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/FormThemeProfilePane.java index 798bb73c59..d3807ffbbe 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/FormThemeProfilePane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/FormThemeProfilePane.java @@ -4,12 +4,14 @@ import com.fr.base.theme.FormTheme; import com.fr.base.theme.TemplateThemeConfig; import com.fr.base.theme.settings.ThemedComponentStyle; import com.fr.base.theme.settings.ThemedFormBodyStyle; +import com.fr.design.ExtraDesignClassManager; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.theme.edit.ChartStyleFormEditPane; import com.fr.design.mainframe.theme.edit.ComponentStyleEditPane; import com.fr.design.mainframe.theme.edit.FormBodyStyleEditPane; import com.fr.design.mainframe.theme.preview.FormThemePreviewPane; +import com.fr.design.mainframe.theme.processor.ThemePreviewPaneProcessor; import javax.swing.JPanel; @@ -31,7 +33,11 @@ public class FormThemeProfilePane extends TemplateThemeProfilePane { } @Override - public FormThemePreviewPane createThemePreviewPane() { + public TemplateThemePreviewPane createThemePreviewPane() { + ThemePreviewPaneProcessor processor = ExtraDesignClassManager.getInstance().getSingle(ThemePreviewPaneProcessor.XML_TAG); + if (processor != null) { + return processor.createFormThemePreviewPane(); + } return new FormThemePreviewPane(); } @@ -61,6 +67,7 @@ public class FormThemeProfilePane extends TemplateThemeProfilePane { componentStyleSettingPane = new ComponentStyleEditPane(); addCustomEditorPane(i18nText("Fine-Design_Predefined_Component_Style"), componentStyleSettingPane); + addExtraEditPane(); } @Override diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/ReportThemeProfilePane.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/ReportThemeProfilePane.java index f0f25f677f..4d1e1b51e0 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/ReportThemeProfilePane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/ReportThemeProfilePane.java @@ -2,10 +2,11 @@ package com.fr.design.mainframe.theme; import com.fr.base.theme.ReportTheme; import com.fr.base.theme.TemplateThemeConfig; +import com.fr.design.ExtraDesignClassManager; import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.theme.edit.ReportBodyStyleEditPane; import com.fr.design.mainframe.theme.preview.ReportThemePreviewPane; -import javax.swing.JPanel; +import com.fr.design.mainframe.theme.processor.ThemePreviewPaneProcessor; /** * @author Starryi @@ -20,7 +21,11 @@ public class ReportThemeProfilePane extends TemplateThemeProfilePane createThemePreviewPane() { + ThemePreviewPaneProcessor processor = ExtraDesignClassManager.getInstance().getSingle(ThemePreviewPaneProcessor.XML_TAG); + if (processor != null) { + return processor.createReportThemePreviewPane(); + } return new ReportThemePreviewPane(); } @@ -44,6 +49,7 @@ public class ReportThemeProfilePane extends TemplateThemeProfilePane extends J protected ColorListPane colorListPane; protected CellStyleListEditPane cellStyleSettingPane; protected ChartStyleEditPane chartStyleSettingPane; + protected final List> extraPaneList = new ArrayList<>(); protected boolean isPopulating = false; protected UITabbedPane uiTabbedPane; @@ -192,6 +196,18 @@ public abstract class TemplateThemeEditorPane extends J }); uiTabbedPane.addTab(title, settingPane); } + + protected void addExtraEditPane() { + Set> providers = ExtraDesignClassManager.getInstance().getArray(TemplateThemePaneProvider.XML_TAG); + if (providers != null) { + for (TemplateThemePaneProvider provider : providers) { + BasicBeanPane tab = provider.getTab(); + extraPaneList.add(tab); + addCustomEditorPane(provider.getTabName(), tab); + } + } + } + protected JPanel createCellStyleSettingPane() { JPanel container = FRGUIPaneFactory.createBorderLayout_S_Pane(); cellStyleSettingPane = new CellStyleListEditPane(); @@ -223,6 +239,9 @@ public abstract class TemplateThemeEditorPane extends J colorListPane.populate(theme.getColorScheme().getColors()); populateBean4CustomEditors(theme); + for (BasicBeanPane pane : extraPaneList) { + pane.populateBean(theme); + } isPopulating = false; } @@ -243,7 +262,9 @@ public abstract class TemplateThemeEditorPane extends J theme.setColorScheme(colorScheme); updateBean4CustomEditors(theme); - + for (BasicBeanPane pane : extraPaneList) { + pane.updateBean(theme); + } return theme; } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/processor/AbstractThemePreviewPaneProcessor.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/processor/AbstractThemePreviewPaneProcessor.java new file mode 100644 index 0000000000..839944d9fe --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/processor/AbstractThemePreviewPaneProcessor.java @@ -0,0 +1,23 @@ +package com.fr.design.mainframe.theme.processor; + +import com.fr.stable.fun.mark.API; + +/** + * @author Bruce.Deng + * @version 11.0 + * Created by Bruce.Deng on 2023/2/14 + */ +@API(level = ThemePreviewPaneProcessor.CURRENT_LEVEL) +public abstract class AbstractThemePreviewPaneProcessor implements ThemePreviewPaneProcessor { + + @Override + public int currentAPILevel() { + return CURRENT_LEVEL; + } + + @Override + public int layerIndex() { + return DEFAULT_LAYER_INDEX; + } + +} diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/processor/ThemePreviewPaneProcessor.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/processor/ThemePreviewPaneProcessor.java new file mode 100644 index 0000000000..93b17b8e92 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/processor/ThemePreviewPaneProcessor.java @@ -0,0 +1,35 @@ +package com.fr.design.mainframe.theme.processor; + +import com.fr.base.theme.FormTheme; +import com.fr.base.theme.ReportTheme; +import com.fr.design.mainframe.theme.TemplateThemePreviewPane; +import com.fr.stable.fun.mark.Immutable; + +/** + * 主题样式预览界面接口 + * + * @author Bruce.Deng + * @version 11.0 + * Created by Bruce.Deng on 2023/2/14 + */ +public interface ThemePreviewPaneProcessor extends Immutable { + + String XML_TAG = "ThemePreviewPaneProcessor"; + + int CURRENT_LEVEL = 1; + + /** + * 创建报表主题样式预览界面 + * + * @return 报表主题样式预览界面 + */ + TemplateThemePreviewPane createReportThemePreviewPane(); + + /** + * 创建决策报表主题样式预览界面 + * + * @return 决策报表主题样式预览界面 + */ + TemplateThemePreviewPane createFormThemePreviewPane(); + +} diff --git a/designer-form/src/main/java/com/fr/design/fun/WidgetAdvancedPaneProvider.java b/designer-form/src/main/java/com/fr/design/fun/WidgetAdvancedPaneProvider.java new file mode 100644 index 0000000000..9c5466abe2 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/fun/WidgetAdvancedPaneProvider.java @@ -0,0 +1,34 @@ +package com.fr.design.fun; + +import com.fr.design.beans.BasicBeanPane; +import com.fr.design.designer.creator.XCreator; +import com.fr.stable.fun.mark.Mutable; + +/** + * 控件属性面板的高级设置项扩展 + * + * @author Bruce.Deng + * @version 11.0 + * Created by Bruce.Deng on 2023/2/15 + */ +public interface WidgetAdvancedPaneProvider extends Mutable { + + String XML_TAG = "WidgetAdvancedPaneProvider"; + + int CURRENT_LEVEL = 1; + + /** + * 是否需要处理 + * + * @param creator + * @return true:需要处理/false:不处理 + */ + boolean accept(XCreator creator); + + /** + * 创建控件高级设置项的追加面板 + * + * @return 高级设置项追加面板 + */ + BasicBeanPane createExtraAdvancedPane(); +} diff --git a/designer-form/src/main/java/com/fr/design/fun/impl/AbstractWidgetAdvancedPaneProvider.java b/designer-form/src/main/java/com/fr/design/fun/impl/AbstractWidgetAdvancedPaneProvider.java new file mode 100644 index 0000000000..2ceef7df53 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/fun/impl/AbstractWidgetAdvancedPaneProvider.java @@ -0,0 +1,25 @@ +package com.fr.design.fun.impl; + +import com.fr.design.fun.WidgetAdvancedPaneProvider; +import com.fr.stable.fun.impl.AbstractProvider; +import com.fr.stable.fun.mark.API; + +/** + * @author Bruce.Deng + * @version 11.0 + * Created by Bruce.Deng on 2023/2/15 + */ +@API(level = WidgetAdvancedPaneProvider.CURRENT_LEVEL) +public abstract class AbstractWidgetAdvancedPaneProvider extends AbstractProvider implements WidgetAdvancedPaneProvider { + + @Override + public int currentAPILevel() { + return CURRENT_LEVEL; + } + + @Override + public String mark4Provider() { + return getClass().getName(); + } + +} diff --git a/designer-form/src/main/java/com/fr/design/parameter/RootDesignDefinePane.java b/designer-form/src/main/java/com/fr/design/parameter/RootDesignDefinePane.java index 9b4dfb4c44..e130d4f00c 100644 --- a/designer-form/src/main/java/com/fr/design/parameter/RootDesignDefinePane.java +++ b/designer-form/src/main/java/com/fr/design/parameter/RootDesignDefinePane.java @@ -2,6 +2,7 @@ package com.fr.design.parameter; import com.fr.base.BaseUtils; import com.fr.design.ExtraDesignClassManager; +import com.fr.design.beans.BasicBeanPane; import com.fr.design.data.DataCreatorUI; import com.fr.design.designer.IntervalConstants; import com.fr.design.designer.creator.CRPropertyDescriptor; @@ -13,6 +14,7 @@ import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.fit.common.TemplateTool; import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.fun.ParameterExpandablePaneUIProvider; +import com.fr.design.fun.WidgetAdvancedPaneProvider; import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.ilable.UILabel; @@ -41,6 +43,8 @@ import javax.swing.JPanel; import java.awt.BorderLayout; import java.awt.Component; import java.awt.Rectangle; +import java.util.ArrayList; +import java.util.List; import java.util.Set; /** @@ -59,6 +63,7 @@ public class RootDesignDefinePane extends AbstractDataModify { //是否是新设计模式下决策报表 private boolean newForm; private PropertyGroupPane extraPropertyGroupPane; + protected final List> extraPaneList = new ArrayList<>(); public RootDesignDefinePane(XCreator xCreator) { super(xCreator); @@ -144,7 +149,6 @@ public class RootDesignDefinePane extends AbstractDataModify { fireAfterEditor.setSelected(false); } }); - background = new AccessibleBackgroundEditor(); Icon[] hAlignmentIconArray = {BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_left_normal.png"), BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_center_normal.png"), BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_right_normal.png"),}; @@ -159,7 +163,7 @@ public class RootDesignDefinePane extends AbstractDataModify { int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}}; Component[][] components = new Component[][]{ new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Label_Name")), labelNameTextField}, - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Base_Background")), background}, + new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Base_Background")), getBackgroundPane()}, new Component[]{displayReport, null}, new Component[]{useParamsTemplate, null}, new Component[]{fireAfterEditor, null}, @@ -199,7 +203,6 @@ public class RootDesignDefinePane extends AbstractDataModify { fireAfterEditor.setSelected(false); } }); - background = new AccessibleBackgroundEditor(); double f = TableLayout.FILL; double p = TableLayout.PREFERRED; @@ -208,7 +211,7 @@ public class RootDesignDefinePane extends AbstractDataModify { int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}}; Component[][] components = new Component[][]{ new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Label_Name")), labelNameTextField}, - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Base_Background")), background}, + new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Base_Background")), getBackgroundPane()}, new Component[]{displayReport, null}, new Component[]{useParamsTemplate, null}, new Component[]{fireAfterEditor, null}, @@ -229,7 +232,13 @@ public class RootDesignDefinePane extends AbstractDataModify { @Override public void populateBean(WParameterLayout ob) { labelNameTextField.setText(ob.getLabelName()); - background.setValue(ob.getBackground()); + if (extraPaneList.isEmpty()) { + background.setValue(ob.getBackground()); + } else { + for (BasicBeanPane pane : extraPaneList) { + pane.populateBean(ob); + } + } displayReport.setSelected(ob.isDelayDisplayContent()); useParamsTemplate.setSelected(ob.isUseParamsTemplate()); fireAfterEditor.setEnabled(ob.isUseParamsTemplate()); @@ -277,8 +286,14 @@ public class RootDesignDefinePane extends AbstractDataModify { wParameterLayout.setParamsFireStopEdit(fireAfterEditor.isSelected()); JTemplate jTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); jTemplate.needAddTemplateIdAttr(useParamsTemplate.isSelected()); - wParameterLayout.setBackground((Background) background.getValue()); wParameterLayout.setPosition((Integer) hAlignmentPane.getSelectedItem()); + if (extraPaneList.isEmpty()) { + wParameterLayout.setBackground((Background) background.getValue()); + } else { + for (BasicBeanPane pane : extraPaneList) { + pane.updateBean(wParameterLayout); + } + } return wParameterLayout; } @@ -299,6 +314,13 @@ public class RootDesignDefinePane extends AbstractDataModify { JTemplate jTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); jTemplate.needAddTemplateIdAttr(useParamsTemplate.isSelected()); wParameterLayout.setBackground((Background) background.getValue()); + if (extraPaneList.isEmpty()) { + background.setValue(wParameterLayout.getBackground()); + } else { + for (BasicBeanPane pane : extraPaneList) { + pane.populateBean(wParameterLayout); + } + } //设置参数模板面板的高度 int height = (int) paraHeight.getTextField().getValue(); FormDesigner designer = TemplateTool.getCurrentEditingNewJForm().getFormDesign(); @@ -331,4 +353,19 @@ public class RootDesignDefinePane extends AbstractDataModify { public DataCreatorUI dataUI() { return null; } + + private Component getBackgroundPane() { + Set> providers = ExtraDesignClassManager.getInstance().getArray(WidgetAdvancedPaneProvider.XML_TAG); + if (providers != null) { + for (WidgetAdvancedPaneProvider provider : providers) { + if (provider.accept(creator)) { + BasicBeanPane extraAdvancedPane = provider.createExtraAdvancedPane(); + extraPaneList.add(extraAdvancedPane); + return extraAdvancedPane; + } + } + } + background = new AccessibleBackgroundEditor(); + return background; + } } diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/FieldEditorDefinePane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/FieldEditorDefinePane.java index 4ee699e0fe..c3939db996 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/FieldEditorDefinePane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/FieldEditorDefinePane.java @@ -1,6 +1,7 @@ package com.fr.design.widget.ui.designer; import com.fr.design.ExtraDesignClassManager; +import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.ErrorMsgTextFieldAdapter; import com.fr.design.beans.UITextFieldAdapter; import com.fr.design.constants.LayoutConstants; @@ -12,6 +13,7 @@ import com.fr.design.designer.creator.XWFitLayout; import com.fr.design.designer.creator.XWParameterLayout; import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.fun.TextFieldAdapterProvider; +import com.fr.design.fun.WidgetAdvancedPaneProvider; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.itextfield.UITextField; @@ -27,6 +29,9 @@ import java.awt.BorderLayout; import java.awt.Component; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; +import java.util.ArrayList; +import java.util.List; +import java.util.Set; public abstract class FieldEditorDefinePane extends AbstractDataModify { protected UICheckBox allowBlankCheckBox; @@ -35,7 +40,7 @@ public abstract class FieldEditorDefinePane extends Abstr protected JPanel validatePane; protected FontSizeComboPane fontSizePane; protected UITextField labelNameTextField; - + protected final List> extraPaneList = new ArrayList<>(); public FieldEditorDefinePane(XCreator xCreator) { super(xCreator); @@ -49,8 +54,9 @@ public abstract class FieldEditorDefinePane extends Abstr allowBlankCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); fontSizePane = new FontSizeComboPane(); JPanel contentPane = this.setFirstContentPane(); - JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); - jPanel.add(contentPane, BorderLayout.CENTER); + JPanel jPanel = FRGUIPaneFactory.createYBoxEmptyBorderPane(); + jPanel.add(contentPane); + this.addExtraAdvancedPane(jPanel, creator); contentPane.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0)); if (contentPane != null) { UIExpandablePane uiExpandablePane = new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Advanced"), 280, 20, jPanel); @@ -59,12 +65,28 @@ public abstract class FieldEditorDefinePane extends Abstr this.addValidatePane(); } + protected void addExtraAdvancedPane(JPanel jPanel, XCreator xCreator) { + Set> providers = ExtraDesignClassManager.getInstance().getArray(WidgetAdvancedPaneProvider.XML_TAG); + if (providers != null) { + for (WidgetAdvancedPaneProvider provider : providers) { + if (provider.accept(xCreator)) { + BasicBeanPane extraAdvancedPane = provider.createExtraAdvancedPane(); + extraPaneList.add(extraAdvancedPane); + jPanel.add(extraAdvancedPane); + } + } + } + } + @Override public void populateBean(T ob) { this.allowBlankCheckBox.setSelected(ob.isAllowBlank()); this.errorMsgTextField.setText(ob.getErrorMessage()); this.fontSizePane.setValue(ob.getFontSize()); this.labelNameTextField.setText(ob.getLabelName()); + for (BasicBeanPane pane : extraPaneList) { + pane.populateBean(ob); + } populateSubFieldEditorBean(ob); } @@ -78,6 +100,9 @@ public abstract class FieldEditorDefinePane extends Abstr e.setErrorMessage(this.errorMsgTextField.getText()); e.setFontSize(fontSizePane.getValue()); e.setLabelName(labelNameTextField.getText()); + for (BasicBeanPane pane : extraPaneList) { + pane.updateBean(e); + } return e; } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java b/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java index cab4c6a185..d4fa7ed5cf 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java @@ -1311,6 +1311,7 @@ public class JWorkBook extends JTemplate { boolean shouldCreateUndoState = compatible == TemplateThemeCompatible.NONE && !StringUtils.equals(oldTheme.getName(), newTheme.getName()); getTarget().setTemplateTheme(newTheme, compatible); + getTarget().getReportParameterAttr().onTemplateUsingThemeChange(newTheme, compatible); setTarget((WorkBook) FineColorSynchronizer.flush(getTarget(), newTheme, compatible)); if (HistoryTemplateListCache.getInstance().getCurrentEditingTemplate() == this) { @@ -1318,6 +1319,8 @@ public class JWorkBook extends JTemplate { reportComposite.setSelectedIndex(reportComposite.getSelectedIndex()); TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter()).refreshDockingView(); DesignerContext.getDesignerFrame().resetToolkitByPlus(HistoryTemplateListPane.getInstance().getCurrentEditingTemplate()); + // 刷新参数面板界面 + populateReportParameterAttr(); } super.setTemplateTheme(newTheme, compatible);