Browse Source

REPORT-745 designer_base和form依赖关系内容修改

master
PanLi320 8 years ago
parent
commit
f340f302ac
  1. 9
      designer_base/src/com/fr/design/fun/FormElementCaseEditorProvider.java
  2. 14
      designer_base/src/com/fr/design/fun/impl/AbstractFormElementCaseEditorProvider.java
  3. 24
      designer_form/src/com/fr/design/designer/creator/XElementCase.java

9
designer_base/src/com/fr/design/fun/FormElementCaseEditorProvider.java

@ -1,11 +1,11 @@
package com.fr.design.fun;
import com.fr.form.ui.ElementCaseEditor;
import com.fr.stable.fun.IOFileAttrMark;
import com.fr.stable.fun.ReportFitAttrProvider;
import com.fr.form.main.Form;
import com.fr.stable.fun.mark.Mutable;
import java.beans.PropertyDescriptor;
import java.util.Map;
/**
* Created by zhouping on 2015/9/10.
@ -16,10 +16,7 @@ public interface FormElementCaseEditorProvider extends Mutable {
int CURRENT_LEVEL = 1;
//加个provider返回tab的接口
//design_base依赖了form
PropertyDescriptor[] createPropertyDescriptor (Class<?> temp, Form form, ElementCaseEditor editor);
PropertyDescriptor[] createPropertyDescriptor (Class<?> temp, Map<String, IOFileAttrMark> attrMarkMap, ReportFitAttrProvider reportFitAttr);
/**
* 生成属性表

14
designer_base/src/com/fr/design/fun/impl/AbstractFormElementCaseEditorProvider.java

@ -1,12 +1,12 @@
package com.fr.design.fun.impl;
import com.fr.design.fun.FormElementCaseEditorProvider;
import com.fr.form.main.Form;
import com.fr.form.ui.ElementCaseEditor;
import com.fr.stable.fun.IOFileAttrMark;
import com.fr.stable.fun.ReportFitAttrProvider;
import com.fr.stable.fun.mark.API;
import java.beans.PropertyDescriptor;
import java.util.Map;
/**
* Created by zhouping on 2015/9/10.
@ -24,7 +24,7 @@ public abstract class AbstractFormElementCaseEditorProvider implements FormEleme
}
@Override
public PropertyDescriptor[] createPropertyDescriptor(Class<?> temp, Form reportAttr, ElementCaseEditor editor) {
public PropertyDescriptor[] createPropertyDescriptor(Class<?> temp, Map<String, IOFileAttrMark> attrMarkMap, ReportFitAttrProvider reportFitAttr) {
return new PropertyDescriptor[0];
}
@ -48,12 +48,4 @@ public abstract class AbstractFormElementCaseEditorProvider implements FormEleme
public int getFitStateInPC(ReportFitAttrProvider fitAttrProvider) {
return 0;
}
@Override
public boolean equals(Object obj) {
if(obj == null) {
return false;
}
return true;
}
}

24
designer_form/src/com/fr/design/designer/creator/XElementCase.java

@ -22,11 +22,13 @@ import com.fr.form.FormElementCaseContainerProvider;
import com.fr.form.FormElementCaseProvider;
import com.fr.form.ui.ElementCaseEditor;
import com.fr.general.Inter;
import com.fr.plugin.ExtraClassManager;
import com.fr.stable.ArrayUtils;
import com.fr.stable.CoreGraphHelper;
import com.fr.stable.core.PropertyChangeAdapter;
import com.fr.form.main.Form;
import com.fr.stable.fun.ExtraAttrMapProvider;
import com.fr.stable.fun.FitProvider;
import com.fr.stable.fun.IOFileAttrMark;
import com.fr.stable.fun.ReportFitAttrProvider;
import javax.swing.*;
@ -100,7 +102,7 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme
.putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced"),
new CRPropertyDescriptor("showToolBar", this.data.getClass()).setEditorClass(BooleanEditor.class)
.setI18NName(Inter.getLocText("Form-EC_toolbar"))
.putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced"),
.putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced")
};
//这边有个插件兼容问题,之后还是要改回process才行
@ -110,8 +112,22 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme
continue;
}
this.designer = WidgetPropertyPane.getInstance().getEditingFormDesigner();
Form form = designer.getTarget();
PropertyDescriptor[] extraEditor = provider.createPropertyDescriptor(this.data.getClass(), form, this.toData());
ElementCaseEditor editor = this.toData();
Set<ExtraAttrMapProvider> setAttr = ExtraClassManager.getInstance().getArray(ExtraAttrMapProvider.XML_TAG);
for (ExtraAttrMapProvider attrProvider:setAttr) {
if (attrProvider == null) {
continue;
}
editor.addAttrMark((IOFileAttrMark) attrProvider);
}
FitProvider fitProvider = (FitProvider) designer.getTarget();
ReportFitAttrProvider fitAttr = fitProvider.getFitAttr();
//兼容之前报表块(之前三个选项为:默认 横向 双向 现在是:横向 双向 不自适应)
if (editor.getFitStateInPC() == 0) {
editor.setReportFitAttr(null);
}
ReportFitAttrProvider reportFitAttr = editor.getReportFitAttr() == null ? fitAttr : editor.getReportFitAttr();
PropertyDescriptor[] extraEditor = provider.createPropertyDescriptor(this.data.getClass(), editor.getAttrMarkMap(), reportFitAttr);
propertyTableEditor = (CRPropertyDescriptor[]) ArrayUtils.addAll(propertyTableEditor, extraEditor);
}

Loading…
Cancel
Save