From fb41e9e6020c447301566496bbb7d8536c4c0028 Mon Sep 17 00:00:00 2001 From: Heyman Date: Tue, 17 Aug 2021 15:29:27 +0800 Subject: [PATCH] =?UTF-8?q?MOBILE-32704=2011.0=E9=83=A8=E5=88=86=E6=8F=92?= =?UTF-8?q?=E4=BB=B6=E5=86=85=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/ExtraDesignClassManager.java | 34 ++------------ .../DefaultMobileParamUIProvider.java | 4 +- .../EmptyMobileParamUIProvider.java | 4 +- .../DefaultMobileParamDefinePane.java | 2 +- .../EmptyMobileParamDefinePane.java | 2 +- .../{topparam => }/MobileParamDefinePane.java | 4 +- .../MobileParamSettingPane.java | 7 +-- .../mainframe/mobile/ui/MobileStylePane.java | 45 ++++++++++++++++++- .../AccessibleMobileParamEditor.java | 2 +- .../designer/mobile/ParaMobileDefinePane.java | 9 +--- 10 files changed, 60 insertions(+), 53 deletions(-) rename designer-base/src/main/java/com/fr/design/mainframe/mobile/provider/{topparam => }/DefaultMobileParamUIProvider.java (86%) rename designer-base/src/main/java/com/fr/design/mainframe/mobile/provider/{topparam => }/EmptyMobileParamUIProvider.java (89%) rename designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/{topparam => }/DefaultMobileParamDefinePane.java (95%) rename designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/{topparam => }/EmptyMobileParamDefinePane.java (95%) rename designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/{topparam => }/MobileParamDefinePane.java (92%) rename designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/{topparam => }/MobileParamSettingPane.java (95%) diff --git a/designer-base/src/main/java/com/fr/design/ExtraDesignClassManager.java b/designer-base/src/main/java/com/fr/design/ExtraDesignClassManager.java index 199576320..c25d7d80a 100644 --- a/designer-base/src/main/java/com/fr/design/ExtraDesignClassManager.java +++ b/designer-base/src/main/java/com/fr/design/ExtraDesignClassManager.java @@ -18,14 +18,6 @@ import com.fr.design.fun.TableDataDefineProvider; import com.fr.design.fun.ToolbarItemProvider; import com.fr.design.gui.core.WidgetOption; import com.fr.design.gui.core.WidgetOptionFactory; -import com.fr.design.mainframe.mobile.provider.combo.SimpleComboCheckBoxStyleProvider; -import com.fr.design.mainframe.mobile.provider.combo.SimpleComboStyleProvider; -import com.fr.design.mainframe.mobile.provider.date.NavigationStyleProvider; -import com.fr.design.mainframe.mobile.provider.date.SimpleDateStyleProvider; -import com.fr.design.mainframe.mobile.provider.date.SimpleStyleProvider; -import com.fr.design.mainframe.mobile.provider.radiogroup.CapsuleRadioGroupStyleProvider; -import com.fr.design.mainframe.mobile.provider.radiogroup.ImageRadioGroupStyleProvider; -import com.fr.design.mainframe.mobile.provider.radiogroup.UnitedRadioGroupStyleProvider; import com.fr.design.menu.ShortCut; import com.fr.design.widget.Appearance; import com.fr.design.widget.mobile.WidgetMobilePane; @@ -275,35 +267,15 @@ public class ExtraDesignClassManager extends AbstractExtraClassManager implement return map; } - public MobileWidgetStyleProvider[] getMobileStyleOfWidget(String xType) { + public List getMobileStyleOfWidget(String xType) { Set set = getArray(MobileWidgetStyleProvider.XML_TAG); - Set allSet = new HashSet<>(); - - SimpleStyleProvider simpleStyleProvider = new SimpleStyleProvider(); - NavigationStyleProvider navigationStyleProvider = new NavigationStyleProvider(); - SimpleDateStyleProvider simpleDateStyleProvider = new SimpleDateStyleProvider(); - SimpleComboStyleProvider simpleComboStyleProvider = new SimpleComboStyleProvider(); - SimpleComboCheckBoxStyleProvider simpleComboCheckBoxStyleProvider = new SimpleComboCheckBoxStyleProvider(); - CapsuleRadioGroupStyleProvider capsuleRadioGroupStyleProvider = new CapsuleRadioGroupStyleProvider(); - UnitedRadioGroupStyleProvider unitedRadioGroupStyleProvider = new UnitedRadioGroupStyleProvider(); - ImageRadioGroupStyleProvider imageRadioGroupStyleProvider = new ImageRadioGroupStyleProvider(); - allSet.add(simpleStyleProvider); - allSet.add(navigationStyleProvider); - allSet.add(simpleDateStyleProvider); - allSet.add(simpleComboStyleProvider); - allSet.add(simpleComboCheckBoxStyleProvider); - allSet.add(capsuleRadioGroupStyleProvider); - allSet.add(unitedRadioGroupStyleProvider); - allSet.add(imageRadioGroupStyleProvider); - - allSet.addAll(set); List providers = new ArrayList<>(); - for (MobileWidgetStyleProvider provider : allSet) { + for (MobileWidgetStyleProvider provider : set) { if (ComparatorUtils.equalsIgnoreCase(provider.xTypeForWidget(), xType)) { providers.add(provider); } } - return providers.toArray(new MobileWidgetStyleProvider[providers.size()]); + return providers; } @Override diff --git a/designer-base/src/main/java/com/fr/design/mainframe/mobile/provider/topparam/DefaultMobileParamUIProvider.java b/designer-base/src/main/java/com/fr/design/mainframe/mobile/provider/DefaultMobileParamUIProvider.java similarity index 86% rename from designer-base/src/main/java/com/fr/design/mainframe/mobile/provider/topparam/DefaultMobileParamUIProvider.java rename to designer-base/src/main/java/com/fr/design/mainframe/mobile/provider/DefaultMobileParamUIProvider.java index 1d0f68fe5..3448ab202 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/mobile/provider/topparam/DefaultMobileParamUIProvider.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/mobile/provider/DefaultMobileParamUIProvider.java @@ -1,8 +1,8 @@ -package com.fr.design.mainframe.mobile.provider.topparam; +package com.fr.design.mainframe.mobile.provider; import com.fr.design.beans.BasicBeanPane; import com.fr.design.fun.impl.AbstractMobileParamUIProvider; -import com.fr.design.mainframe.mobile.ui.topparam.DefaultMobileParamDefinePane; +import com.fr.design.mainframe.mobile.ui.DefaultMobileParamDefinePane; import com.fr.form.ui.mobile.MobileParamStyle; import com.fr.form.ui.mobile.impl.DefaultMobileParameterStyle; import com.fr.locale.InterProviderFactory; diff --git a/designer-base/src/main/java/com/fr/design/mainframe/mobile/provider/topparam/EmptyMobileParamUIProvider.java b/designer-base/src/main/java/com/fr/design/mainframe/mobile/provider/EmptyMobileParamUIProvider.java similarity index 89% rename from designer-base/src/main/java/com/fr/design/mainframe/mobile/provider/topparam/EmptyMobileParamUIProvider.java rename to designer-base/src/main/java/com/fr/design/mainframe/mobile/provider/EmptyMobileParamUIProvider.java index c0affc739..46ed13071 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/mobile/provider/topparam/EmptyMobileParamUIProvider.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/mobile/provider/EmptyMobileParamUIProvider.java @@ -1,8 +1,8 @@ -package com.fr.design.mainframe.mobile.provider.topparam; +package com.fr.design.mainframe.mobile.provider; import com.fr.design.beans.BasicBeanPane; import com.fr.design.fun.impl.AbstractMobileParamUIProvider; -import com.fr.design.mainframe.mobile.ui.topparam.EmptyMobileParamDefinePane; +import com.fr.design.mainframe.mobile.ui.EmptyMobileParamDefinePane; import com.fr.form.ui.mobile.MobileParamStyle; import com.fr.report.fun.MobileParamStyleProvider; import com.fr.report.mobile.EmptyMobileParamStyle; diff --git a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/topparam/DefaultMobileParamDefinePane.java b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/DefaultMobileParamDefinePane.java similarity index 95% rename from designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/topparam/DefaultMobileParamDefinePane.java rename to designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/DefaultMobileParamDefinePane.java index 9e6167bbf..838e8f599 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/topparam/DefaultMobileParamDefinePane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/DefaultMobileParamDefinePane.java @@ -1,4 +1,4 @@ -package com.fr.design.mainframe.mobile.ui.topparam; +package com.fr.design.mainframe.mobile.ui; import com.fr.design.beans.BasicBeanPane; import com.fr.design.i18n.Toolkit; diff --git a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/topparam/EmptyMobileParamDefinePane.java b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/EmptyMobileParamDefinePane.java similarity index 95% rename from designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/topparam/EmptyMobileParamDefinePane.java rename to designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/EmptyMobileParamDefinePane.java index 7d298e8c9..b973d599a 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/topparam/EmptyMobileParamDefinePane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/EmptyMobileParamDefinePane.java @@ -1,4 +1,4 @@ -package com.fr.design.mainframe.mobile.ui.topparam; +package com.fr.design.mainframe.mobile.ui; import com.fr.design.beans.BasicBeanPane; import com.fr.design.i18n.Toolkit; diff --git a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/topparam/MobileParamDefinePane.java b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileParamDefinePane.java similarity index 92% rename from designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/topparam/MobileParamDefinePane.java rename to designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileParamDefinePane.java index d2fccc88f..cd9ee2202 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/topparam/MobileParamDefinePane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileParamDefinePane.java @@ -1,9 +1,9 @@ -package com.fr.design.mainframe.mobile.ui.topparam; +package com.fr.design.mainframe.mobile.ui; import com.fr.design.beans.BasicBeanPane; import com.fr.design.fun.MobileParamUIProvider; import com.fr.design.layout.FRGUIPaneFactory; -import com.fr.design.mainframe.mobile.provider.topparam.EmptyMobileParamUIProvider; +import com.fr.design.mainframe.mobile.provider.EmptyMobileParamUIProvider; import com.fr.form.ui.mobile.MobileParamStyle; import com.fr.general.ComparatorUtils; import com.fr.invoke.Reflect; diff --git a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/topparam/MobileParamSettingPane.java b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileParamSettingPane.java similarity index 95% rename from designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/topparam/MobileParamSettingPane.java rename to designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileParamSettingPane.java index 5f702520f..ae29a57e2 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/topparam/MobileParamSettingPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileParamSettingPane.java @@ -1,13 +1,14 @@ -package com.fr.design.mainframe.mobile.ui.topparam; +package com.fr.design.mainframe.mobile.ui; import com.fr.design.ExtraDesignClassManager; import com.fr.design.beans.BasicBeanPane; import com.fr.design.dialog.BasicPane; import com.fr.design.fun.MobileParamUIProvider; import com.fr.design.layout.FRGUIPaneFactory; -import com.fr.design.mainframe.mobile.provider.topparam.DefaultMobileParamUIProvider; -import com.fr.design.mainframe.mobile.provider.topparam.EmptyMobileParamUIProvider; +import com.fr.design.mainframe.mobile.provider.DefaultMobileParamUIProvider; +import com.fr.design.mainframe.mobile.provider.EmptyMobileParamUIProvider; import com.fr.design.mainframe.mobile.provider.topparam.MobileTopParamStyleProvider; +import com.fr.design.mainframe.mobile.ui.MobileParamDefinePane; import com.fr.form.ui.mobile.MobileParamStyle; import com.fr.general.ComparatorUtils; import com.fr.report.ExtraReportClassManager; diff --git a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileStylePane.java b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileStylePane.java index 3573427ca..97e1903f0 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileStylePane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileStylePane.java @@ -5,10 +5,19 @@ import com.fr.design.beans.BasicBeanPane; import com.fr.design.dialog.BasicPane; import com.fr.design.fun.MobileWidgetStyleProvider; import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.mainframe.mobile.provider.combo.SimpleComboCheckBoxStyleProvider; +import com.fr.design.mainframe.mobile.provider.combo.SimpleComboStyleProvider; +import com.fr.design.mainframe.mobile.provider.date.NavigationStyleProvider; +import com.fr.design.mainframe.mobile.provider.date.SimpleDateStyleProvider; +import com.fr.design.mainframe.mobile.provider.date.SimpleStyleProvider; +import com.fr.design.mainframe.mobile.provider.radiogroup.CapsuleRadioGroupStyleProvider; +import com.fr.design.mainframe.mobile.provider.radiogroup.ImageRadioGroupStyleProvider; +import com.fr.design.mainframe.mobile.provider.radiogroup.UnitedRadioGroupStyleProvider; import com.fr.form.ui.Widget; import com.fr.form.ui.container.WScaleLayout; import com.fr.form.ui.mobile.MobileStyle; import com.fr.form.ui.widget.CRBoundsWidget; +import com.fr.general.ComparatorUtils; import com.fr.log.FineLoggerFactory; import com.fr.stable.ArrayUtils; @@ -16,8 +25,12 @@ import javax.swing.*; import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; import java.awt.*; +import java.util.ArrayList; import java.util.HashMap; +import java.util.HashSet; +import java.util.List; import java.util.Map; +import java.util.Set; public class MobileStylePane extends BasicPane { @@ -129,8 +142,36 @@ public class MobileStylePane extends BasicPane { private MobileWidgetStyleProvider[] getMobileWidgetStyleProviders() { DefaultMobileWidgetStyleProvider defaultMobileWidgetStyleProvider = new DefaultMobileWidgetStyleProvider(); - MobileWidgetStyleProvider[] styleProviders = ExtraDesignClassManager.getInstance().getMobileStyleOfWidget(widget.getXType()); - styleProviders = ArrayUtils.insert(0, styleProviders, defaultMobileWidgetStyleProvider); + SimpleStyleProvider simpleStyleProvider = new SimpleStyleProvider(); + NavigationStyleProvider navigationStyleProvider = new NavigationStyleProvider(); + SimpleDateStyleProvider simpleDateStyleProvider = new SimpleDateStyleProvider(); + SimpleComboStyleProvider simpleComboStyleProvider = new SimpleComboStyleProvider(); + SimpleComboCheckBoxStyleProvider simpleComboCheckBoxStyleProvider = new SimpleComboCheckBoxStyleProvider(); + CapsuleRadioGroupStyleProvider capsuleRadioGroupStyleProvider = new CapsuleRadioGroupStyleProvider(); + UnitedRadioGroupStyleProvider unitedRadioGroupStyleProvider = new UnitedRadioGroupStyleProvider(); + ImageRadioGroupStyleProvider imageRadioGroupStyleProvider = new ImageRadioGroupStyleProvider(); + + Set set = new HashSet<>(); + set.add(simpleStyleProvider); + set.add(navigationStyleProvider); + set.add(simpleDateStyleProvider); + set.add(simpleComboStyleProvider); + set.add(simpleComboCheckBoxStyleProvider); + set.add(capsuleRadioGroupStyleProvider); + set.add(unitedRadioGroupStyleProvider); + set.add(imageRadioGroupStyleProvider); + + List providers = new ArrayList<>(); + for (MobileWidgetStyleProvider provider : set) { + if (ComparatorUtils.equalsIgnoreCase(provider.xTypeForWidget(), widget.getXType())) { + providers.add(provider); + } + } + List otherProviders = ExtraDesignClassManager.getInstance().getMobileStyleOfWidget(widget.getXType()); + providers.addAll(otherProviders); + MobileWidgetStyleProvider[] styleProviders = providers.toArray(new MobileWidgetStyleProvider[providers.size()]); + + styleProviders = ArrayUtils.insert(0, styleProviders, defaultMobileWidgetStyleProvider); return styleProviders; } } \ No newline at end of file diff --git a/designer-form/src/main/java/com/fr/design/mainframe/widget/accessibles/AccessibleMobileParamEditor.java b/designer-form/src/main/java/com/fr/design/mainframe/widget/accessibles/AccessibleMobileParamEditor.java index c150d0531..94fa4607c 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/widget/accessibles/AccessibleMobileParamEditor.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/widget/accessibles/AccessibleMobileParamEditor.java @@ -4,7 +4,7 @@ import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.WidgetPropertyPane; -import com.fr.design.mainframe.mobile.ui.topparam.MobileParamSettingPane; +import com.fr.design.mainframe.mobile.ui.MobileParamSettingPane; import com.fr.design.mainframe.widget.wrappers.MobileParamWrapper; import com.fr.form.ui.container.WParameterLayout; import com.fr.form.ui.mobile.MobileParamStyle; diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ParaMobileDefinePane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ParaMobileDefinePane.java index 0713cd8c3..168298526 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ParaMobileDefinePane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ParaMobileDefinePane.java @@ -15,24 +15,17 @@ import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.MobileWidgetListPane; import com.fr.design.mainframe.WidgetPropertyPane; -import com.fr.design.mainframe.mobile.ui.topparam.MobileParamSettingPane; +import com.fr.design.mainframe.mobile.ui.MobileParamSettingPane; import com.fr.design.mainframe.widget.accessibles.AccessibleMobileParamEditor; import com.fr.form.ui.container.WParameterLayout; import com.fr.form.ui.container.WSortLayout; import com.fr.form.ui.mobile.MobileParamStyle; -import com.fr.general.CloudCenter; -import com.fr.log.FineLoggerFactory; import com.fr.report.mobile.EmptyMobileParamStyle; import javax.swing.BorderFactory; import javax.swing.JPanel; import java.awt.BorderLayout; import java.awt.Component; -import java.awt.Cursor; -import java.awt.Desktop; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; -import java.net.URI; import java.util.Set; /**