|
|
|
@ -24,6 +24,9 @@ import com.fr.log.FineLoggerFactory;
|
|
|
|
|
import com.fr.widgettheme.widget.mobile.pane.IconColorMobileStyleDefinePane; |
|
|
|
|
import org.jetbrains.annotations.NotNull; |
|
|
|
|
|
|
|
|
|
import java.util.HashSet; |
|
|
|
|
import java.util.Set; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 控件主题移动端样式窗口创建类 |
|
|
|
|
* |
|
|
|
@ -36,6 +39,28 @@ public class WidgetThemeMobileStyleDefinePaneCreator {
|
|
|
|
|
private WidgetThemeMobileStyleDefinePaneCreator() { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 需要特殊处理的控件集合 |
|
|
|
|
*/ |
|
|
|
|
private static final Set<Class<? extends Widget>> SPECIAL_WIDGET_SET = new HashSet<>(); |
|
|
|
|
/** |
|
|
|
|
* 带有图标颜色的控件集合 |
|
|
|
|
*/ |
|
|
|
|
private static final Set<Class<? extends Widget>> ICON_WIDGET_SET = new HashSet<>(); |
|
|
|
|
|
|
|
|
|
static { |
|
|
|
|
SPECIAL_WIDGET_SET.add(FreeButton.class); |
|
|
|
|
SPECIAL_WIDGET_SET.add(Label.class); |
|
|
|
|
SPECIAL_WIDGET_SET.add(MultiFileEditor.class); |
|
|
|
|
SPECIAL_WIDGET_SET.add(TextArea.class); |
|
|
|
|
ICON_WIDGET_SET.add(TextEditor.class); |
|
|
|
|
ICON_WIDGET_SET.add(NumberEditor.class); |
|
|
|
|
ICON_WIDGET_SET.add(Password.class); |
|
|
|
|
ICON_WIDGET_SET.add(DateEditor.class); |
|
|
|
|
ICON_WIDGET_SET.add(ComboBox.class); |
|
|
|
|
ICON_WIDGET_SET.add(ComboCheckBox.class); |
|
|
|
|
ICON_WIDGET_SET.add(TreeEditor.class); |
|
|
|
|
} |
|
|
|
|
/** |
|
|
|
|
* 创建移动端控件样式属性窗口 |
|
|
|
|
* |
|
|
|
@ -47,7 +72,7 @@ public class WidgetThemeMobileStyleDefinePaneCreator {
|
|
|
|
|
public static BasicBeanPane<MobileStyle> createBaseBeanPane(Widget widget, Class<? extends MobileStyleCustomDefinePane> customDefinePane, Class<? extends MobileStyle> mobileStyle) { |
|
|
|
|
try { |
|
|
|
|
if (WidgetThemeDesignerUtils.enableWidgetEnhance()) { |
|
|
|
|
if (specialCommonWidget(widget)) { |
|
|
|
|
if (isSpecialWidget(widget)) { |
|
|
|
|
return DisplayEnhanceMobileStyleFactory.createWidgetMobileStyleDefinePane(widget, customDefinePane, mobileStyle); |
|
|
|
|
} else if (isIconWidget(widget)) { |
|
|
|
|
return new IconColorMobileStyleDefinePane(widget, customDefinePane, mobileStyle); |
|
|
|
@ -68,7 +93,7 @@ public class WidgetThemeMobileStyleDefinePaneCreator {
|
|
|
|
|
* @return class
|
|
|
|
|
*/ |
|
|
|
|
public static @NotNull Class<? extends MobileCommonExtraStyle> classForCommonExtraStyle(Widget widget) { |
|
|
|
|
if (specialCommonWidget(widget)) { |
|
|
|
|
if (isSpecialWidget(widget)) { |
|
|
|
|
return DisplayEnhanceMobileStyleFactory.classForWidgetCommonExtraStyle(widget); |
|
|
|
|
} else { |
|
|
|
|
return WidgetThemeMobileCommonExtraStyle.class; |
|
|
|
@ -82,8 +107,8 @@ public class WidgetThemeMobileStyleDefinePaneCreator {
|
|
|
|
|
* @param widget 控件 |
|
|
|
|
* @return 是/否 |
|
|
|
|
*/ |
|
|
|
|
private static boolean specialCommonWidget(Widget widget) { |
|
|
|
|
return widget instanceof FreeButton || widget instanceof Label || widget instanceof MultiFileEditor || widget instanceof TextArea; |
|
|
|
|
private static boolean isSpecialWidget(Widget widget) { |
|
|
|
|
return SPECIAL_WIDGET_SET.contains(widget.getClass()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -93,9 +118,6 @@ public class WidgetThemeMobileStyleDefinePaneCreator {
|
|
|
|
|
* @return 是/否 |
|
|
|
|
*/ |
|
|
|
|
private static boolean isIconWidget(Widget widget) { |
|
|
|
|
return widget instanceof TextEditor || widget instanceof NumberEditor || widget instanceof Password || |
|
|
|
|
widget instanceof DateEditor || widget instanceof ComboBox || widget instanceof ComboCheckBox || |
|
|
|
|
widget instanceof TreeEditor || |
|
|
|
|
WidgetThemeServerUtils.isNewComboBoxTreeEditor(widget); |
|
|
|
|
return ICON_WIDGET_SET.contains(widget.getClass()) || WidgetThemeServerUtils.isNewComboBoxTreeEditor(widget); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|