Browse Source

MOBILE-32704 11.0部分插件内置

fix-lag
Heyman 3 years ago
parent
commit
d5cd331596
  1. 9
      designer-base/src/main/java/com/fr/design/ExtraDesignClassManager.java
  2. 6
      designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileParamSettingPane.java
  3. 47
      designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileStylePane.java
  4. 41
      designer-base/src/main/java/com/fr/design/mainframe/mobile/utils/MobileStyleProviderManager.java

9
designer-base/src/main/java/com/fr/design/ExtraDesignClassManager.java

@ -18,6 +18,7 @@ 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.utils.MobileStyleProviderManager;
import com.fr.design.menu.ShortCut;
import com.fr.design.widget.Appearance;
import com.fr.design.widget.mobile.WidgetMobilePane;
@ -267,15 +268,17 @@ public class ExtraDesignClassManager extends AbstractExtraClassManager implement
return map;
}
public List<MobileWidgetStyleProvider> getMobileStyleOfWidget(String xType) {
public MobileWidgetStyleProvider[] getMobileStyleOfWidget(String xType) {
Set<MobileWidgetStyleProvider> set = getArray(MobileWidgetStyleProvider.XML_TAG);
Set<MobileWidgetStyleProvider> allSet = MobileStyleProviderManager.getArray(MobileWidgetStyleProvider.XML_TAG);
allSet.addAll(set);
List<MobileWidgetStyleProvider> providers = new ArrayList<>();
for (MobileWidgetStyleProvider provider : set) {
for (MobileWidgetStyleProvider provider : allSet) {
if (ComparatorUtils.equalsIgnoreCase(provider.xTypeForWidget(), xType)) {
providers.add(provider);
}
}
return providers;
return providers.toArray(new MobileWidgetStyleProvider[providers.size()]);
}
@Override

6
designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileParamSettingPane.java

@ -7,8 +7,7 @@ import com.fr.design.fun.MobileParamUIProvider;
import com.fr.design.layout.FRGUIPaneFactory;
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.design.mainframe.mobile.utils.MobileStyleProviderManager;
import com.fr.form.ui.mobile.MobileParamStyle;
import com.fr.general.ComparatorUtils;
import com.fr.report.ExtraReportClassManager;
@ -137,10 +136,11 @@ public class MobileParamSettingPane extends BasicPane {
private MobileParamUIProvider[] getMobileParamUIProviders() {
Set<MobileParamUIProvider> paramUIProviders = ExtraDesignClassManager.getInstance().getArray(MobileParamUIProvider.XML_TAG);
Set<MobileParamUIProvider> otherParamUIProviders = MobileStyleProviderManager.getArray(MobileParamUIProvider.XML_TAG);
List<MobileParamUIProvider> result = new ArrayList<>();
result.add(new DefaultMobileParamUIProvider());
result.add(new MobileTopParamStyleProvider());
result.addAll(paramUIProviders);
result.addAll(otherParamUIProviders);
Set<String> nameSets = paramUIProviders.stream().map(MobileParamUIProvider::displayName).collect(Collectors.toSet());
// 兼容老接口
Set<MobileParamStyleProvider> paramStyleProviders = ExtraReportClassManager.getInstance().getArray(MobileParamStyleProvider.MARK_STRING);

47
designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileStylePane.java

@ -5,19 +5,10 @@ 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;
@ -25,12 +16,8 @@ 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 {
@ -40,26 +27,6 @@ public class MobileStylePane extends BasicPane {
private CardLayout card;
private JList styleList;
private Map<String, BasicBeanPane<MobileStyle>> map = new HashMap<>();
private static Set<MobileWidgetStyleProvider> set = new HashSet<>();
static {
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.add(simpleStyleProvider);
set.add(navigationStyleProvider);
set.add(simpleDateStyleProvider);
set.add(simpleComboStyleProvider);
set.add(simpleComboCheckBoxStyleProvider);
set.add(capsuleRadioGroupStyleProvider);
set.add(unitedRadioGroupStyleProvider);
set.add(imageRadioGroupStyleProvider);
}
public MobileStylePane(Widget widget) {
if(widget instanceof WScaleLayout) {
@ -162,18 +129,8 @@ public class MobileStylePane extends BasicPane {
private MobileWidgetStyleProvider[] getMobileWidgetStyleProviders() {
DefaultMobileWidgetStyleProvider defaultMobileWidgetStyleProvider = new DefaultMobileWidgetStyleProvider();
List<MobileWidgetStyleProvider> providers = new ArrayList<>();
for (MobileWidgetStyleProvider provider : set) {
if (ComparatorUtils.equalsIgnoreCase(provider.xTypeForWidget(), widget.getXType())) {
providers.add(provider);
}
}
List<MobileWidgetStyleProvider> otherProviders = ExtraDesignClassManager.getInstance().getMobileStyleOfWidget(widget.getXType());
providers.addAll(otherProviders);
MobileWidgetStyleProvider[] styleProviders = providers.toArray(new MobileWidgetStyleProvider[providers.size()]);
styleProviders = ArrayUtils.insert(0, styleProviders, defaultMobileWidgetStyleProvider);
MobileWidgetStyleProvider[] styleProviders = ExtraDesignClassManager.getInstance().getMobileStyleOfWidget(widget.getXType());
styleProviders = ArrayUtils.insert(0, styleProviders, defaultMobileWidgetStyleProvider);
return styleProviders;
}
}

41
designer-base/src/main/java/com/fr/design/mainframe/mobile/utils/MobileStyleProviderManager.java

@ -0,0 +1,41 @@
package com.fr.design.mainframe.mobile.utils;
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.mainframe.mobile.provider.topparam.MobileTopParamStyleProvider;
import com.fr.stable.fun.mark.Mutable;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
public class MobileStyleProviderManager {
private static Set<Mutable> mobileWidgetStyleProviderSet = new HashSet<Mutable>() {{
add(new SimpleStyleProvider());
add(new NavigationStyleProvider());
add(new SimpleDateStyleProvider());
add(new SimpleComboStyleProvider());
add(new SimpleComboCheckBoxStyleProvider());
add(new CapsuleRadioGroupStyleProvider());
add(new UnitedRadioGroupStyleProvider());
add(new ImageRadioGroupStyleProvider());
}};
private static Set<Mutable> mobileParamUIProviderSet = new HashSet<Mutable>() {{
add(new MobileTopParamStyleProvider());
}};
private static Map<String, Set<Mutable>> map = new HashMap<String, Set<Mutable>>() {{
put("MobileWidgetStyleProvider", mobileWidgetStyleProviderSet);
put("MobileParamUIProvider", mobileParamUIProviderSet);
}};
public static <T extends Mutable> Set<T> getArray(String mark) {
return (Set<T>) map.get(mark);
}
}
Loading…
Cancel
Save