Browse Source

新功能已实现,手机报表最大高度的限制,测试可行。默认高度比:0.75(75%)。

master
Lee 9 years ago
parent
commit
05c3e3b86e
  1. 69
      designer_form/src/com/fr/design/designer/creator/XElementCase.java

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

@ -7,9 +7,7 @@ import com.fr.design.gui.ilable.UILabel;
import com.fr.design.mainframe.CoverReportPane; import com.fr.design.mainframe.CoverReportPane;
import com.fr.design.mainframe.EditingMouseListener; import com.fr.design.mainframe.EditingMouseListener;
import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.FormDesigner;
import com.fr.design.mainframe.widget.editors.BooleanEditor; import com.fr.design.mainframe.widget.editors.*;
import com.fr.design.mainframe.widget.editors.PaddingMarginEditor;
import com.fr.design.mainframe.widget.editors.WLayoutBorderStyleEditor;
import com.fr.design.mainframe.widget.renderer.LayoutBorderStyleRenderer; import com.fr.design.mainframe.widget.renderer.LayoutBorderStyleRenderer;
import com.fr.design.mainframe.widget.renderer.PaddingMarginCellRenderer; import com.fr.design.mainframe.widget.renderer.PaddingMarginCellRenderer;
import com.fr.form.FormElementCaseContainerProvider; import com.fr.form.FormElementCaseContainerProvider;
@ -54,37 +52,74 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme
* @throws IntrospectionException 异常 * @throws IntrospectionException 异常
*/ */
public CRPropertyDescriptor[] supportedDescriptor() throws IntrospectionException { public CRPropertyDescriptor[] supportedDescriptor() throws IntrospectionException {
CRPropertyDescriptor[] crp = ((ElementCaseEditor) data).isHeightRestrict() ? revealHeightLimit() : getDefault();
FormElementCaseEditorProcessor processor = ExtraDesignClassManager.getInstance().getPropertyTableEditor();
if (processor == null) {
return crp;
}
PropertyDescriptor[] extraEditor = processor.createPropertyDescriptor(this.data.getClass());
return (CRPropertyDescriptor[]) ArrayUtils.addAll(crp, extraEditor);
}
CRPropertyDescriptor[] propertyTableEditor = new CRPropertyDescriptor[]{ protected CRPropertyDescriptor createNonListenerProperties(int i) throws IntrospectionException {
CRPropertyDescriptor[] propertyTableEditor = {
new CRPropertyDescriptor("widgetName", this.data.getClass()) new CRPropertyDescriptor("widgetName", this.data.getClass())
.setI18NName(Inter.getLocText("Form-Widget_Name")), .setI18NName(Inter.getLocText("Form-Widget_Name")),
new CRPropertyDescriptor("borderStyle", this.data.getClass()).setEditorClass( new CRPropertyDescriptor("borderStyle", this.data.getClass()).setEditorClass(
WLayoutBorderStyleEditor.class).setRendererClass(LayoutBorderStyleRenderer.class).setI18NName( WLayoutBorderStyleEditor.class).setRendererClass(LayoutBorderStyleRenderer.class).setI18NName(
Inter.getLocText("FR-Designer-Widget_Style")).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced") Inter.getLocText("FR-Designer-Widget_Style")).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced"),
.setPropertyChangeListener(new PropertyChangeAdapter() {
@Override
public void propertyChange() {
initStyle();
}
}),
new CRPropertyDescriptor("margin", this.data.getClass()).setEditorClass(PaddingMarginEditor.class) new CRPropertyDescriptor("margin", this.data.getClass()).setEditorClass(PaddingMarginEditor.class)
.setRendererClass(PaddingMarginCellRenderer.class).setI18NName(Inter.getLocText("FR-Layout_Padding")) .setRendererClass(PaddingMarginCellRenderer.class).setI18NName(Inter.getLocText("FR-Layout_Padding"))
.putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced"), .putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced"),
new CRPropertyDescriptor("showToolBar", this.data.getClass()).setEditorClass(BooleanEditor.class) new CRPropertyDescriptor("showToolBar", this.data.getClass()).setEditorClass(BooleanEditor.class)
.setI18NName(Inter.getLocText("Form-EC_toolbar")) .setI18NName(Inter.getLocText("Form-EC_toolbar"))
.putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced"), .putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced"),
new CRPropertyDescriptor("heightRestrict", this.data.getClass()).setEditorClass(InChangeBooleanEditor.class)
.setI18NName(Inter.getLocText("Form-EC_heightrestrict"))
.putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced"),
new CRPropertyDescriptor("heightPercent", this.data.getClass()).setEditorClass(DoubleEditor.class)
.setI18NName(Inter.getLocText("Form-EC_heightpercent"))
.putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced")
};
return propertyTableEditor[i];
}
protected CRPropertyDescriptor[] revealHeightLimit() throws IntrospectionException {
return new CRPropertyDescriptor[] {
createNonListenerProperties(0),
createNonListenerProperties(1).
setPropertyChangeListener(new PropertyChangeAdapter() {
@Override
public void propertyChange() {
initStyle();
}
}),
createNonListenerProperties(2),
createNonListenerProperties(3),
createNonListenerProperties(4),
createNonListenerProperties(5)
}; };
}
FormElementCaseEditorProcessor processor = ExtraDesignClassManager.getInstance().getPropertyTableEditor(); protected CRPropertyDescriptor[] getDefault() throws IntrospectionException {
if (processor == null){ return new CRPropertyDescriptor[] {
return propertyTableEditor; createNonListenerProperties(0),
createNonListenerProperties(1).
setPropertyChangeListener(new PropertyChangeAdapter() {
@Override
public void propertyChange() {
initStyle();
} }
PropertyDescriptor[] extraEditor = processor.createPropertyDescriptor(this.data.getClass()); }),
return (CRPropertyDescriptor[]) ArrayUtils.addAll(propertyTableEditor, extraEditor); createNonListenerProperties(2),
createNonListenerProperties(3),
createNonListenerProperties(4)
};
} }
@Override @Override
protected String getIconName() { protected String getIconName() {
return "text_field_16.png"; return "text_field_16.png";

Loading…
Cancel
Save