Browse Source

REPORT-4928 参数面板显示兼容插件在9.0设计器失效问题

master
yaoh.wu 7 years ago
parent
commit
bc88e92008
  1. 22
      designer_form/src/com/fr/design/designer/creator/XWParameterLayout.java
  2. 24
      designer_form/src/com/fr/design/parameter/RootDesignDefinePane.java

22
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

24
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<WParameterLayout> {
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<WParameterLayout> {
};
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<WParameterLayout> {
useParamsTemplate.setSelected(ob.isUseParamsTemplate());
designerWidth.setValue(ob.getDesignWidth());
hAlignmentPane.setSelectedItem(ob.getPosition());
if (extraPropertyGroupPane != null) {
extraPropertyGroupPane.populate(ob);
}
}

Loading…
Cancel
Save