Browse Source

REPORT-364 修改

master
PanLi320 8 years ago
parent
commit
77272c3687
  1. 2
      designer_base/src/com/fr/design/fun/FormElementCaseEditorProvider.java
  2. 44
      designer_base/src/com/fr/design/fun/impl/AbstractFormElementCaseEditorProcessor.java
  3. 25
      designer_form/src/com/fr/design/designer/creator/XElementCase.java

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

@ -19,7 +19,7 @@ public interface FormElementCaseEditorProvider extends Mutable {
//加个provider返回tab的接口
//design_base依赖了form
PropertyDescriptor[] createPropertyDescriptor (Class<?> temp, Form reportAttr, ElementCaseEditor editor);
PropertyDescriptor[] createPropertyDescriptor (Class<?> temp, Form form, ElementCaseEditor editor);
/**
* 生成属性表

44
designer_base/src/com/fr/design/fun/impl/AbstractFormElementCaseEditorProcessor.java

@ -0,0 +1,44 @@
package com.fr.design.fun.impl;
import com.fr.design.fun.FormElementCaseEditorProcessor;
import com.fr.stable.fun.ReportFitAttrProvider;
import com.fr.stable.fun.mark.API;
import java.beans.PropertyDescriptor;
/**
* Created by zhouping on 2015/9/10.
*/
@API(level = FormElementCaseEditorProcessor.CURRENT_LEVEL)
public abstract class AbstractFormElementCaseEditorProcessor implements FormElementCaseEditorProcessor {
public int currentAPILevel() {
return CURRENT_LEVEL;
}
public int layerIndex() {
return DEFAULT_LAYER_INDEX;
}
/**
* 生成属性表
* @param temp 传入当前操作的class
* @param reportFitAttr 传入的自适应属性
* @return 返回属性表
*/
@Override
public PropertyDescriptor[] createPropertyDescriptor(Class<?> temp, ReportFitAttrProvider reportFitAttr) {
return new PropertyDescriptor[0];
}
/**
* 返回pc自适应属性值
* @param fitAttrProvider 传入的自适应属性
* @return 返回pc自适应属性值
*/
@Override
public int getFitStateInPC(ReportFitAttrProvider fitAttrProvider) {
return 0;
}
}

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

@ -4,6 +4,7 @@ import com.fr.base.BaseUtils;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.designer.properties.mobile.ElementCasePropertyUI;
import com.fr.design.form.util.XCreatorConstants;
import com.fr.design.fun.FormElementCaseEditorProcessor;
import com.fr.design.fun.FormElementCaseEditorProvider;
import com.fr.design.fun.WidgetPropertyUIProvider;
import com.fr.design.fun.impl.AbstractFormElementCaseEditorProvider;
@ -25,6 +26,8 @@ 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.FitProvider;
import com.fr.stable.fun.ReportFitAttrProvider;
import javax.swing.*;
import java.awt.*;
@ -107,11 +110,27 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme
continue;
}
this.designer = WidgetPropertyPane.getInstance().getEditingFormDesigner();
Form formAttr = designer.getTarget();
PropertyDescriptor[] extraEditor = provider.createPropertyDescriptor(this.data.getClass(), formAttr, this.toData());
Form form = designer.getTarget();
PropertyDescriptor[] extraEditor = provider.createPropertyDescriptor(this.data.getClass(), form, this.toData());
propertyTableEditor = (CRPropertyDescriptor[]) ArrayUtils.addAll(propertyTableEditor, extraEditor);
}
return propertyTableEditor;
FormElementCaseEditorProcessor processor = ExtraDesignClassManager.getInstance().getSingle(FormElementCaseEditorProcessor.MARK_STRING);
if (processor == null) {
return propertyTableEditor;
}
this.designer = WidgetPropertyPane.getInstance().getEditingFormDesigner();
FitProvider wbTpl = (FitProvider) designer.getTarget();
ReportFitAttrProvider fitAttr = wbTpl.getFitAttr();
ElementCaseEditor editor = this.toData();
//兼容之前报表块(之前三个选项为:默认 横向 双向 现在是:横向 双向 不自适应)
if (editor.getFitStateInPC() == 0) {
editor.setReportFitAttr(null);
}
ReportFitAttrProvider reportFitAttr = editor.getReportFitAttr() == null ? fitAttr : editor.getReportFitAttr();
PropertyDescriptor[] extraEditor = processor.createPropertyDescriptor(this.data.getClass(), reportFitAttr);
return (CRPropertyDescriptor[]) ArrayUtils.addAll(propertyTableEditor, extraEditor);
}
@Override

Loading…
Cancel
Save