From e5903dbf9d5e35d5683e6dbe4b212b04e0336f81 Mon Sep 17 00:00:00 2001 From: PanLi320 <854954082@qq.com> Date: Mon, 9 Jan 2017 11:25:12 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-1438=20=E5=B1=9E=E6=80=A7=E6=8E=A7?= =?UTF-8?q?=E5=88=B6=EF=BC=8C=E4=B9=8B=E5=89=8D=E7=9B=B4=E6=8E=A5=E6=8B=BF?= =?UTF-8?q?=E7=9A=84button=E7=9A=84=E5=B1=9E=E6=80=A7=EF=BC=8C=E5=A4=9A?= =?UTF-8?q?=E4=BA=86=E4=B8=80=E4=B8=AA=E6=A0=B7=E5=BC=8F=E7=9A=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 这边条件判断取一下,留下两个默认的属性即可。 --- .../creator/cardlayout/XWTabFitLayout.java | 22 +++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) 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 775d4c38c..298f2877f 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 @@ -42,7 +42,8 @@ public class XWTabFitLayout extends XWFitLayout { // tab布局在拖拽导致的缩放里(含间隔时),如果拖拽宽高大于组件宽高,会导致调整的时候找不到原来的组件 // 这里先将拖拽之前的宽高先做备份 public static final Color NORMAL_GRAL = new Color(236,236,236); - public static final Color CHOOSED_GRAL = new Color(222,222,222); + private static final String WIDGET_NAME = "widgetName"; + private static final String MARGIN = "margin"; private Dimension referDim; private Background initialBackground; private Background overBackground; @@ -105,7 +106,7 @@ public class XWTabFitLayout extends XWFitLayout { public CRPropertyDescriptor[] supportedDescriptor() throws IntrospectionException { checkButonType(); CRPropertyDescriptor[] crp = ((WTabFitLayout) data).isCustomStyle() ? getisCustomStyle() : getisnotCustomStyle(); - return ArrayUtils.addAll(super.supportedDescriptor(), crp); + return ArrayUtils.addAll(defaultDescriptor(), crp); } protected CRPropertyDescriptor[] getisCustomStyle() throws IntrospectionException { @@ -195,6 +196,23 @@ public class XWTabFitLayout extends XWFitLayout { return crPropertyDescriptors[i]; } + protected CRPropertyDescriptor[] defaultDescriptor() throws IntrospectionException { + if (super.supportedDescriptor().length < 3) { + return null; + } + CRPropertyDescriptor[] crPropertyDescriptors = { + super.supportedDescriptor()[0], + super.supportedDescriptor()[2] + }; + 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; + } + } + private void checkButonType() { if (this.xCardSwitchButton == null) { return;