From 7b53cb3a58761047bfb32278a0f5585288517c8f Mon Sep 17 00:00:00 2001 From: Hans Date: Fri, 23 Oct 2020 10:08:13 +0800 Subject: [PATCH] =?UTF-8?q?MOBILE-29820=20=E7=A7=BB=E5=8A=A8=E7=AB=AFtab?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E9=A1=B5=E9=9D=A2=E7=BC=BA=E5=B0=91=E6=BB=9A?= =?UTF-8?q?=E5=8A=A8=E6=9D=A1=20=E6=B7=BB=E5=8A=A0=E6=BB=9A=E5=8A=A8?= =?UTF-8?q?=E6=9D=A1=20=E6=9C=80=E5=A4=96=E5=B1=82=E7=9B=B4=E6=8E=A5?= =?UTF-8?q?=E4=BD=BF=E7=94=A8JPanel=EF=BC=8C=E6=B2=A1=E6=9C=89=E5=B8=83?= =?UTF-8?q?=E5=B1=80=E7=BA=A6=E6=9D=9F=E5=AF=BC=E8=87=B4=E5=B8=83=E5=B1=80?= =?UTF-8?q?=E5=BC=82=E5=B8=B8=EF=BC=8C=E9=9C=80=E8=A6=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mobile/TabMobileWidgetDefinePane.java | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/TabMobileWidgetDefinePane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/TabMobileWidgetDefinePane.java index b6a6b7eaf..af591abdd 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/TabMobileWidgetDefinePane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/TabMobileWidgetDefinePane.java @@ -24,6 +24,7 @@ import com.fr.design.widget.ui.designer.mobile.component.MobileTabCommonSettingP import com.fr.form.ui.container.cardlayout.WCardTagLayout; import com.fr.general.cardtag.mobile.MobileTemplateStyle; +import java.awt.Dimension; import javax.swing.JPanel; import javax.swing.BorderFactory; import java.awt.BorderLayout; @@ -40,10 +41,12 @@ public class TabMobileWidgetDefinePane extends MobileWidgetDefinePane { private MobileTabCommonSettingPane mobileTabCommonSettingPane; private JPanel contentJPanel; private BasicScrollPane scrollPane; + private JPanel holder; + private Dimension dimension; public TabMobileWidgetDefinePane(XCreator xCreator) { this.xCreator = xCreator; - contentJPanel = new JPanel(); + contentJPanel = FRGUIPaneFactory.createCenterFlowZeroGapBorderPane(); scrollPane = new AttrScrollPane() { @Override protected JPanel createContentPane() { @@ -79,7 +82,18 @@ public class TabMobileWidgetDefinePane extends MobileWidgetDefinePane { UILabel label = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Tab_Style_Template")); templateStyleEditor = new AccessibleTemplateStyleEditor(new MobileTemplateStylePane((WCardTagLayout) xCreator.toData())); JPanel jPanel = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{label, templateStyleEditor}, {new UILabel()}}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L1, LayoutConstants.VGAP_LARGE); - JPanel holder = FRGUIPaneFactory.createBorderLayout_S_Pane(); + holder = new JPanel(new BorderLayout()) { + @Override + public Dimension getPreferredSize() { + if (dimension == null) { + return super.getPreferredSize(); + } else { + Dimension defaultDimension = super.getPreferredSize(); + defaultDimension.width = dimension.width; + return defaultDimension; + } + } + }; holder.add(jPanel, BorderLayout.NORTH); JPanel innerAdvancePane = FRGUIPaneFactory.createBorderLayout_S_Pane(); if (!shouldHidePadding(designer)) { @@ -111,6 +125,9 @@ public class TabMobileWidgetDefinePane extends MobileWidgetDefinePane { public void populate(FormDesigner designer) { WCardTagLayout wCardTagLayout = (WCardTagLayout) xCreator.toData(); MobileTemplateStyle mobileTemplateStyle = wCardTagLayout.getMobileTemplateStyle(); + if (dimension == null) { + dimension = holder.getPreferredSize(); + } templateStyleEditor.setValue(mobileTemplateStyle); // 数据 populate 完成后,再设置监听 this.bindListeners2Widgets();