From 565b8edc829d8de086a64e5f34195d44404d8352 Mon Sep 17 00:00:00 2001 From: neil Date: Thu, 16 Jun 2016 17:25:15 +0800 Subject: [PATCH] =?UTF-8?q?=E5=86=B2=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/designer/creator/XElementCase.java | 20 ++++++++++++++++--- .../mobile/ElementCasePropertyTable.java | 15 +++++++++++++- 2 files changed, 31 insertions(+), 4 deletions(-) diff --git a/designer_form/src/com/fr/design/designer/creator/XElementCase.java b/designer_form/src/com/fr/design/designer/creator/XElementCase.java index 29310ca0c..952360f54 100644 --- a/designer_form/src/com/fr/design/designer/creator/XElementCase.java +++ b/designer_form/src/com/fr/design/designer/creator/XElementCase.java @@ -9,7 +9,10 @@ import com.fr.design.gui.ilable.UILabel; import com.fr.design.mainframe.CoverReportPane; import com.fr.design.mainframe.EditingMouseListener; import com.fr.design.mainframe.FormDesigner; -import com.fr.design.mainframe.widget.editors.*; +import com.fr.design.mainframe.WidgetPropertyPane; +import com.fr.design.mainframe.widget.editors.BooleanEditor; +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.PaddingMarginCellRenderer; import com.fr.form.FormElementCaseContainerProvider; @@ -18,6 +21,8 @@ import com.fr.form.ui.ElementCaseEditor; import com.fr.general.Inter; import com.fr.stable.ArrayUtils; import com.fr.stable.core.PropertyChangeAdapter; +import com.fr.stable.fun.FitProvider; +import com.fr.stable.fun.ReportFitAttrProvider; import javax.swing.*; import java.awt.*; @@ -29,6 +34,7 @@ import java.beans.PropertyDescriptor; public class XElementCase extends XBorderStyleWidgetCreator implements FormElementCaseContainerProvider{ private UILabel imageLable; private JPanel coverPanel; + private FormDesigner designer; public XElementCase(ElementCaseEditor widget, Dimension initSize) { super(widget, initSize); @@ -78,10 +84,18 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme }; FormElementCaseEditorProcessor processor = ExtraDesignClassManager.getInstance().getPropertyTableEditor(); - if (processor == null){ + this.designer = WidgetPropertyPane.getInstance().getEditingFormDesigner(); + FitProvider wbTpl = (FitProvider) designer.getTarget(); + ReportFitAttrProvider fitAttr = wbTpl.getFitAttr(); + ElementCaseEditor editor = this.toData(); + ReportFitAttrProvider reportFitAttr = editor.getReportFitAttr() == null ? fitAttr : editor.getReportFitAttr(); + PropertyDescriptor[] extraEditor = processor.createPropertyDescriptor(this.data.getClass(), reportFitAttr); + if (processor == null) { return propertyTableEditor; } - PropertyDescriptor[] extraEditor = processor.createPropertyDescriptor(this.data.getClass()); + if (editor.getReportFitAttr() == null) { + editor.setReportFitInPc(processor.getFitStateInPC(fitAttr)); + } return (CRPropertyDescriptor[]) ArrayUtils.addAll(propertyTableEditor, extraEditor); } diff --git a/designer_form/src/com/fr/design/designer/properties/mobile/ElementCasePropertyTable.java b/designer_form/src/com/fr/design/designer/properties/mobile/ElementCasePropertyTable.java index 85c70f810..c846d48f5 100644 --- a/designer_form/src/com/fr/design/designer/properties/mobile/ElementCasePropertyTable.java +++ b/designer_form/src/com/fr/design/designer/properties/mobile/ElementCasePropertyTable.java @@ -1,6 +1,7 @@ package com.fr.design.designer.properties.mobile; import com.fr.base.FRContext; +import com.fr.base.mobile.MobileFitAttrState; import com.fr.design.designer.beans.events.DesignerEvent; import com.fr.design.designer.creator.CRPropertyDescriptor; import com.fr.design.designer.creator.XCreator; @@ -27,17 +28,20 @@ public class ElementCasePropertyTable extends AbstractPropertyTable{ private XCreator xCreator; private FormDesigner designer; + private boolean cascade = false; public ElementCasePropertyTable(XCreator xCreator) { this.xCreator = xCreator; } public CRPropertyDescriptor[] supportedDescriptor() throws IntrospectionException { - if (((ElementCaseEditor ) xCreator.toData()).getVerticalAttr().getState() == 2 && !((ElementCaseEditor ) xCreator.toData()).isHeightRestrict()) { + if (((ElementCaseEditor ) xCreator.toData()).getVerticalAttr() == MobileFitAttrState.VERTICAL && !((ElementCaseEditor ) xCreator.toData()).isHeightRestrict()) { ((ElementCaseEditor ) xCreator.toData()).setHeightRestrict(true); + cascade = true; return revealHeightLimit(); } CRPropertyDescriptor[] crp = ((ElementCaseEditor) xCreator.toData()).isHeightRestrict() ? revealHeightLimit() : getDefault(); + cascade = ((ElementCaseEditor ) xCreator.toData()).getVerticalAttr() == MobileFitAttrState.VERTICAL; return crp; } @@ -53,6 +57,7 @@ public class ElementCasePropertyTable extends AbstractPropertyTable{ .putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, Inter.getLocText("FR-Designer_Fit-App")), new CRPropertyDescriptor("heightRestrict", this.xCreator.toData().getClass()).setEditorClass(InChangeBooleanEditor.class) .setI18NName(Inter.getLocText("Form-EC_heightrestrict")) + .setRendererClass(BooleanRender.class) .putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, Inter.getLocText("FR-Designer_Fit-App")) }; List defaultList = new ArrayList<>(); @@ -103,6 +108,14 @@ public class ElementCasePropertyTable extends AbstractPropertyTable{ designer.getEditListenerTable().fireCreatorModified(DesignerEvent.CREATOR_EDITED); } + @Override + public boolean isCellEditable(int row, int column) { + if (cascade && row ==3 ) { + return false; + } + return super.isCellEditable(row, column); + } + public void populate(FormDesigner designer) { this.designer = designer; initPropertyGroups(this.designer.getTarget());