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 084ab77947..d0973988d6 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 c1725e8b72..6cfa4a2667 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); + } }