From 00c4744eec30a9d801c59972568d2a1b3bbc47c4 Mon Sep 17 00:00:00 2001 From: hades Date: Fri, 10 Apr 2020 17:28:30 +0800 Subject: [PATCH 1/2] MOBILE-26388 && MOBILE-26387 && MOBILE-26189 --- .../designer/creator/XWAbsoluteLayout.java | 12 ------- .../design/mainframe/WidgetPropertyPane.java | 3 +- .../mobile/TabMobileWidgetDefinePane.java | 32 ++++++++++++++----- 3 files changed, 26 insertions(+), 21 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteLayout.java b/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteLayout.java index 22d702dfd5..56fcf64866 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteLayout.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteLayout.java @@ -13,11 +13,8 @@ import com.fr.design.designer.beans.adapters.layout.FRAbsoluteLayoutAdapter; import com.fr.design.designer.beans.location.Direction; import com.fr.design.designer.beans.models.SelectionModel; import com.fr.design.designer.creator.cardlayout.XWTabFitLayout; -import com.fr.design.designer.properties.mobile.MobileBooKMarkUsePropertyUI; import com.fr.design.form.layout.FRAbsoluteLayout; -import com.fr.design.form.util.FormDesignerUtils; import com.fr.design.form.util.XCreatorConstants; -import com.fr.design.fun.WidgetPropertyUIProvider; import com.fr.design.icon.IconPathConstants; import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.EditingMouseListener; @@ -593,13 +590,4 @@ public class XWAbsoluteLayout extends XLayoutContainer { public boolean isSupportShared() { return true; } - - @Override - public WidgetPropertyUIProvider[] getWidgetPropertyUIProviders() { - if (FormDesignerUtils.isAppRelayout(WidgetPropertyPane.getInstance().getEditingFormDesigner())) { - return new WidgetPropertyUIProvider[] {new MobileBooKMarkUsePropertyUI(this)}; - } else { - return super.getWidgetPropertyUIProviders(); - } - } } diff --git a/designer-form/src/main/java/com/fr/design/mainframe/WidgetPropertyPane.java b/designer-form/src/main/java/com/fr/design/mainframe/WidgetPropertyPane.java index c96683f319..f7668b30a1 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/WidgetPropertyPane.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/WidgetPropertyPane.java @@ -9,6 +9,7 @@ import com.fr.design.designer.creator.*; import com.fr.design.designer.properties.EventPropertyTable; import com.fr.design.designer.properties.mobile.MobileBookMarkPropertyUI; import com.fr.design.designer.properties.mobile.MobileStylePropertyUI; +import com.fr.design.form.util.FormDesignerUtils; import com.fr.design.fun.WidgetPropertyUIProvider; import com.fr.design.gui.ibutton.UIHeadGroup; import com.fr.design.gui.icontainer.UIScrollPane; @@ -178,7 +179,7 @@ public class WidgetPropertyPane extends FormDockView implements BaseWidgetProper if (selection != null && xCreator != null) { embeddedPropertyUIProviders = selection.getSelectedCreator().getWidgetPropertyUIProviders(); if(!designer.getDesignerMode().isFormParameterEditor()) { - if (!xCreator.acceptType(XWAbsoluteLayout.class, XWFitLayout.class)) { + if (!xCreator.acceptType(XWAbsoluteLayout.class, XWFitLayout.class) && FormDesignerUtils.isAppRelayout(designer)) { embeddedPropertyUIProviders = ArrayUtils.insert(0, embeddedPropertyUIProviders, new MobileBookMarkPropertyUI(xCreator)); } if (xCreator.supportMobileStyle()) { 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 5cf7f74f78..51d9aa10ae 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 @@ -5,6 +5,7 @@ import com.fr.design.constants.LayoutConstants; import com.fr.design.designer.IntervalConstants; import com.fr.design.designer.creator.XCreator; import com.fr.design.foldablepane.UIExpandablePane; +import com.fr.design.form.util.FormDesignerUtils; import com.fr.design.gui.frpane.AttributeChangeListener; import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.FRGUIPaneFactory; @@ -14,6 +15,7 @@ import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.WidgetPropertyPane; import com.fr.design.mainframe.widget.accessibles.AccessibleTemplateStyleEditor; import com.fr.design.mainframe.widget.accessibles.MobileTemplateStylePane; +import com.fr.design.widget.ui.designer.mobile.component.MobileBookMarkUsePane; import com.fr.design.widget.ui.designer.mobile.component.MobileComponentMarginPane; import com.fr.design.widget.ui.designer.mobile.component.MobileComponentLayoutIntervalPane; import com.fr.form.ui.container.cardlayout.WCardTagLayout; @@ -30,6 +32,7 @@ public class TabMobileWidgetDefinePane extends MobileWidgetDefinePane { private AttributeChangeListener changeListener; private MobileComponentMarginPane marginPane; private MobileComponentLayoutIntervalPane intervalPane; + private MobileBookMarkUsePane mobileBookMarkUsePane; public TabMobileWidgetDefinePane(XCreator xCreator) { this.xCreator = xCreator; @@ -62,9 +65,15 @@ public class TabMobileWidgetDefinePane extends MobileWidgetDefinePane { JPanel holder = FRGUIPaneFactory.createBorderLayout_S_Pane(); holder.add(jPanel, BorderLayout.NORTH); if (!shouldHidePadding(designer)) { + JPanel innerAdvancePane = FRGUIPaneFactory.createBorderLayout_S_Pane(); marginPane = new MobileComponentMarginPane(FormTabPaddingAttrMark.XML_TAG); intervalPane = new MobileComponentLayoutIntervalPane(FormTabPaddingAttrMark.XML_TAG); - UIExpandablePane advancePane = new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Advanced"), 280, 20, marginPane); + if (FormDesignerUtils.isAppRelayout(designer)) { + mobileBookMarkUsePane = new MobileBookMarkUsePane(); + innerAdvancePane.add(mobileBookMarkUsePane, BorderLayout.SOUTH); + } + innerAdvancePane.add(marginPane, BorderLayout.CENTER); + UIExpandablePane advancePane = new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Advanced"), 280, 20, innerAdvancePane); UIExpandablePane layoutPane = new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Layout"), 280, 20, intervalPane); //高级 holder.add(advancePane, BorderLayout.CENTER); @@ -77,27 +86,34 @@ public class TabMobileWidgetDefinePane extends MobileWidgetDefinePane { @Override public void populate(FormDesigner designer) { - templateStyleEditor.setValue(((WCardTagLayout) xCreator.toData()).getMobileTemplateStyle()); + WCardTagLayout wCardTagLayout = (WCardTagLayout) xCreator.toData(); + templateStyleEditor.setValue((wCardTagLayout).getMobileTemplateStyle()); // 数据 populate 完成后,再设置监听 this.bindListeners2Widgets(); this.addAttributeChangeListener(changeListener); if (marginPane != null) {//业务层面可以写成shouldHidePadding但是这样写应该性能差点 - marginPane.populate((WCardTagLayout) xCreator.toData()); + marginPane.populate(wCardTagLayout); } if (intervalPane != null) { - intervalPane.populate((WCardTagLayout) xCreator.toData()); + intervalPane.populate(wCardTagLayout); + } + if (mobileBookMarkUsePane != null) { + mobileBookMarkUsePane.populate(xCreator); } } @Override public void update() { - ((WCardTagLayout) xCreator.toData()).setMobileTemplateStyle((MobileTemplateStyle) templateStyleEditor.getValue()); + WCardTagLayout wCardTagLayout = (WCardTagLayout) xCreator.toData(); + (wCardTagLayout).setMobileTemplateStyle((MobileTemplateStyle) templateStyleEditor.getValue()); DesignerContext.getDesignerFrame().getSelectedJTemplate().fireTargetModified(); // 触发设计器保存按钮亮起来 if (marginPane != null) { - marginPane.update((WCardTagLayout) xCreator.toData()); + marginPane.update(wCardTagLayout); } if (intervalPane != null) { - intervalPane.update((WCardTagLayout) xCreator.toData()); + intervalPane.update(wCardTagLayout); } - } + if (mobileBookMarkUsePane != null) { + mobileBookMarkUsePane.update(xCreator); + } } } From 3d72ad46378adea54965c2277183b836ce9671cd Mon Sep 17 00:00:00 2001 From: hades Date: Fri, 10 Apr 2020 17:30:01 +0800 Subject: [PATCH 2/2] fix --- .../widget/ui/designer/mobile/TabMobileWidgetDefinePane.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 51d9aa10ae..3f3d34eaf7 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 @@ -115,5 +115,6 @@ public class TabMobileWidgetDefinePane extends MobileWidgetDefinePane { } if (mobileBookMarkUsePane != null) { mobileBookMarkUsePane.update(xCreator); - } } + } + } }