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