From 83da497124d59ceab039864866c97c99ab7ca53a Mon Sep 17 00:00:00 2001 From: PanLi320 <854954082@qq.com> Date: Mon, 9 Jan 2017 14:02:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../designer/creator/XLayoutContainer.java | 21 +++++++++++++++++++ .../creator/cardlayout/XWTabFitLayout.java | 15 +++---------- 2 files changed, 24 insertions(+), 12 deletions(-) diff --git a/designer_form/src/com/fr/design/designer/creator/XLayoutContainer.java b/designer_form/src/com/fr/design/designer/creator/XLayoutContainer.java index 47f4270a5..381b16f87 100644 --- a/designer_form/src/com/fr/design/designer/creator/XLayoutContainer.java +++ b/designer_form/src/com/fr/design/designer/creator/XLayoutContainer.java @@ -81,6 +81,27 @@ public abstract class XLayoutContainer extends XBorderStyleWidgetCreator impleme }; } + /** + * 控件名属性 + * @return + * @throws IntrospectionException + */ + public CRPropertyDescriptor createWidgetNameDescriptor() throws IntrospectionException { + return new CRPropertyDescriptor("widgetName", this.data.getClass()).setI18NName(Inter + .getLocText("FR-Designer_Form-Widget_Name")); + } + + /** + * 边距属性 + * @return + * @throws IntrospectionException + */ + public CRPropertyDescriptor createMarginDescriptor() throws IntrospectionException { + return new CRPropertyDescriptor("margin", this.data.getClass()).setEditorClass(PaddingMarginEditor.class) + .setI18NName(Inter.getLocText("FR-Designer_Layout-Padding")) + .putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced"); + } + /** * 返回对应的wlayout * @return wlayout控件 diff --git a/designer_form/src/com/fr/design/designer/creator/cardlayout/XWTabFitLayout.java b/designer_form/src/com/fr/design/designer/creator/cardlayout/XWTabFitLayout.java index 298f2877f..0c5b1d03b 100644 --- a/designer_form/src/com/fr/design/designer/creator/cardlayout/XWTabFitLayout.java +++ b/designer_form/src/com/fr/design/designer/creator/cardlayout/XWTabFitLayout.java @@ -197,20 +197,11 @@ public class XWTabFitLayout extends XWFitLayout { } protected CRPropertyDescriptor[] defaultDescriptor() throws IntrospectionException { - if (super.supportedDescriptor().length < 3) { - return null; - } CRPropertyDescriptor[] crPropertyDescriptors = { - super.supportedDescriptor()[0], - super.supportedDescriptor()[2] + super.createWidgetNameDescriptor(), + super.createMarginDescriptor() }; - CRPropertyDescriptor widgetName = super.supportedDescriptor()[0]; - CRPropertyDescriptor margin = super.supportedDescriptor()[2]; - if (widgetName.getName().equals(WIDGET_NAME) && margin.getName().equals(MARGIN)) { - return crPropertyDescriptors; - } else { - return null; - } + return crPropertyDescriptors; } private void checkButonType() {