From bc88e92008b546e85618bec6614a3e3d71b6bdb4 Mon Sep 17 00:00:00 2001 From: "yaoh.wu" Date: Tue, 31 Oct 2017 17:39:46 +0800 Subject: [PATCH 1/2] =?UTF-8?q?REPORT-4928=20=E5=8F=82=E6=95=B0=E9=9D=A2?= =?UTF-8?q?=E6=9D=BF=E6=98=BE=E7=A4=BA=E5=85=BC=E5=AE=B9=E6=8F=92=E4=BB=B6?= =?UTF-8?q?=E5=9C=A89.0=E8=AE=BE=E8=AE=A1=E5=99=A8=E5=A4=B1=E6=95=88?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../designer/creator/XWParameterLayout.java | 22 +++++++++++------ .../parameter/RootDesignDefinePane.java | 24 ++++++++++++++++--- 2 files changed, 36 insertions(+), 10 deletions(-) diff --git a/designer_form/src/com/fr/design/designer/creator/XWParameterLayout.java b/designer_form/src/com/fr/design/designer/creator/XWParameterLayout.java index 084ab7794..d0973988d 100644 --- a/designer_form/src/com/fr/design/designer/creator/XWParameterLayout.java +++ b/designer_form/src/com/fr/design/designer/creator/XWParameterLayout.java @@ -72,13 +72,7 @@ public class XWParameterLayout extends XWAbsoluteLayout { .putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced"), }; - ParameterWindowEditorProcessor processor = ExtraDesignClassManager.getInstance().getSingle(ParameterWindowEditorProcessor.MARK_STRING); - if (processor == null) { - return propertyTableEditor; - } - CRPropertyDescriptor[] extraEditor = processor.createPropertyDescriptor(this.data.getClass()); - - return ArrayUtils.addAll(propertyTableEditor, extraEditor); + return ArrayUtils.addAll(propertyTableEditor, getExtraTableEditor()); } @Override @@ -86,6 +80,20 @@ public class XWParameterLayout extends XWAbsoluteLayout { return new FRParameterLayoutAdapter(this); } + /** + * 获取插件给该控件提供的额外属性表 + * TODO 需要抽成额外的接口,因为{@link XCreator#supportedDescriptor()} 提供的属性里面的默认属性面板都是额外自己画的,因此插件提供额外属性应该有一个方法去获取; + * TODO 此外,需要将基本高级等分开,在控件的对应属性(基本,高级还有一些其他分类)中进行过滤生成对应的面板。 + * @return 插件给该控件提供的额外属性表 + */ + public CRPropertyDescriptor[] getExtraTableEditor(){ + ParameterWindowEditorProcessor processor = ExtraDesignClassManager.getInstance().getSingle(ParameterWindowEditorProcessor.MARK_STRING); + if (processor == null) { + return null; + } + return processor.createPropertyDescriptor(this.data.getClass()); + } + /** * 该组件是否可以拖入参数面板 * @return 是则返回true diff --git a/designer_form/src/com/fr/design/parameter/RootDesignDefinePane.java b/designer_form/src/com/fr/design/parameter/RootDesignDefinePane.java index c1725e8b7..6cfa4a266 100644 --- a/designer_form/src/com/fr/design/parameter/RootDesignDefinePane.java +++ b/designer_form/src/com/fr/design/parameter/RootDesignDefinePane.java @@ -3,6 +3,8 @@ package com.fr.design.parameter; import com.fr.base.BaseUtils; import com.fr.design.data.DataCreatorUI; import com.fr.design.designer.IntervalConstants; +import com.fr.design.designer.creator.CRPropertyDescriptor; +import com.fr.design.designer.creator.PropertyGroupPane; import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XWParameterLayout; import com.fr.design.file.HistoryTemplateListPane; @@ -23,8 +25,11 @@ import com.fr.general.Background; import com.fr.general.Inter; import com.fr.report.stable.FormConstants; -import javax.swing.*; -import java.awt.*; +import javax.swing.BorderFactory; +import javax.swing.Icon; +import javax.swing.JPanel; +import java.awt.BorderLayout; +import java.awt.Component; /** * Created by ibm on 2017/8/2. @@ -37,6 +42,10 @@ public class RootDesignDefinePane extends AbstractDataModify { private AccessibleBackgroundEditor background; private UIButtonGroup hAlignmentPane; private UITextField labelNameTextField; + /** + * 插件带来的额外属性 + */ + private PropertyGroupPane extraPropertyGroupPane; public RootDesignDefinePane(XCreator xCreator) { super(xCreator); @@ -100,7 +109,12 @@ public class RootDesignDefinePane extends AbstractDataModify { }; JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W0, IntervalConstants.INTERVAL_L1); panel.setBorder(BorderFactory.createEmptyBorder(IntervalConstants.INTERVAL_L1, 0, IntervalConstants.INTERVAL_L1, 0)); - jPanel.add(panel); + CRPropertyDescriptor[] extraTableEditor = new CRPropertyDescriptor[0]; + extraTableEditor = root.getExtraTableEditor(); + extraPropertyGroupPane = new PropertyGroupPane(extraTableEditor, root); + + jPanel.add(panel, BorderLayout.NORTH); + jPanel.add(extraPropertyGroupPane, BorderLayout.CENTER); return jPanel; } @@ -117,6 +131,10 @@ public class RootDesignDefinePane extends AbstractDataModify { useParamsTemplate.setSelected(ob.isUseParamsTemplate()); designerWidth.setValue(ob.getDesignWidth()); hAlignmentPane.setSelectedItem(ob.getPosition()); + + if (extraPropertyGroupPane != null) { + extraPropertyGroupPane.populate(ob); + } } From 00ff062d4914e19864747fef6984204d67da6a47 Mon Sep 17 00:00:00 2001 From: "yaoh.wu" Date: Tue, 31 Oct 2017 23:02:21 +0800 Subject: [PATCH 2/2] f --- .../src/com/fr/design/designer/creator/XWParameterLayout.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer_form/src/com/fr/design/designer/creator/XWParameterLayout.java b/designer_form/src/com/fr/design/designer/creator/XWParameterLayout.java index d0973988d..a158dc753 100644 --- a/designer_form/src/com/fr/design/designer/creator/XWParameterLayout.java +++ b/designer_form/src/com/fr/design/designer/creator/XWParameterLayout.java @@ -89,7 +89,7 @@ public class XWParameterLayout extends XWAbsoluteLayout { public CRPropertyDescriptor[] getExtraTableEditor(){ ParameterWindowEditorProcessor processor = ExtraDesignClassManager.getInstance().getSingle(ParameterWindowEditorProcessor.MARK_STRING); if (processor == null) { - return null; + return new CRPropertyDescriptor[0]; } return processor.createPropertyDescriptor(this.data.getClass()); }