From f86bc5a8f3a74fd8c0bb32e6f3aa42e39bc26145 Mon Sep 17 00:00:00 2001 From: hzzz Date: Thu, 24 Aug 2017 18:04:35 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A7=E6=A8=A1=E6=9D=BF=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E6=97=B6=E5=80=99=E5=8A=A0ID?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/design/mainframe/JTemplate.java | 10 ++++++++++ .../com/fr/design/parameter/RootDesignDefinePane.java | 4 ++++ 2 files changed, 14 insertions(+) diff --git a/designer_base/src/com/fr/design/mainframe/JTemplate.java b/designer_base/src/com/fr/design/mainframe/JTemplate.java index aa42804db..4f9c7a205 100644 --- a/designer_base/src/com/fr/design/mainframe/JTemplate.java +++ b/designer_base/src/com/fr/design/mainframe/JTemplate.java @@ -1055,4 +1055,14 @@ public abstract class JTemplate> ex return uiButtons; } + + /** + * 由于老版本的模板没有模板ID,当勾选使用参数模板时候,就加一个模板ID + * @param isUseParamTemplate 是否使用参数模板 + */ + public void needAddTemplateId(boolean isUseParamTemplate) { + if (isUseParamTemplate && StringUtils.isEmpty(template.getTemplateID())) { + template.initTemplateID(); + } + } } diff --git a/designer_form/src/com/fr/design/parameter/RootDesignDefinePane.java b/designer_form/src/com/fr/design/parameter/RootDesignDefinePane.java index ac265cc20..85b84588b 100644 --- a/designer_form/src/com/fr/design/parameter/RootDesignDefinePane.java +++ b/designer_form/src/com/fr/design/parameter/RootDesignDefinePane.java @@ -4,6 +4,7 @@ import com.fr.base.BaseUtils; import com.fr.design.data.DataCreatorUI; import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XWParameterLayout; +import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.icheckbox.UICheckBox; @@ -13,6 +14,7 @@ import com.fr.design.gui.itextfield.UITextField; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; +import com.fr.design.mainframe.JTemplate; import com.fr.design.mainframe.widget.accessibles.AccessibleBackgroundEditor; import com.fr.design.widget.ui.designer.AbstractDataModify; import com.fr.form.ui.container.WParameterLayout; @@ -124,6 +126,8 @@ public class RootDesignDefinePane extends AbstractDataModify { wParameterLayout.setDesignWidth((int) designerWidth.getValue()); wParameterLayout.setDelayDisplayContent(displayReport.isSelected()); wParameterLayout.setUseParamsTemplate(useParamsTemplate.isSelected()); + JTemplate jTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); + jTemplate.needAddTemplateId(useParamsTemplate.isSelected()); wParameterLayout.setBackground((Background) background.getValue()); wParameterLayout.setPosition(hAlignmentPane.getSelectedIndex()); return wParameterLayout;