You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
63 lines
2.3 KiB
63 lines
2.3 KiB
package com.fr.widgettheme.widget.mobile.provider; |
|
|
|
import com.fr.form.ui.TextArea; |
|
import com.fr.widgettheme.theme.widget.mobile.style.WidgetThemeMobileCommonExtraStyle; |
|
import com.fr.widgettheme.widget.mobile.pane.FileEditorMobileStyleDefinePane; |
|
import com.fr.widgettheme.widget.mobile.pane.FreeButtonMobileStyleDefinePane; |
|
import com.fr.widgettheme.widget.mobile.pane.LabelMobileStyleDefinePane; |
|
import com.fr.widgettheme.theme.widget.mobile.style.FileEditorStyle; |
|
import com.fr.design.beans.BasicBeanPane; |
|
import com.fr.design.mainframe.mobile.ui.MobileStyleCustomDefinePane; |
|
import com.fr.form.ui.FreeButton; |
|
import com.fr.form.ui.Label; |
|
import com.fr.form.ui.MultiFileEditor; |
|
import com.fr.form.ui.Widget; |
|
import com.fr.form.ui.mobile.MobileCommonExtraStyle; |
|
import com.fr.form.ui.mobile.MobileStyle; |
|
import com.fr.widgettheme.widget.mobile.pane.TextAreaMobileStyleDefinePane; |
|
|
|
/** |
|
* 样式创建工厂 |
|
* |
|
* @author Coral.Chen |
|
* @since 11.0 |
|
* Created on 2023/5/15 |
|
*/ |
|
public class DisplayEnhanceMobileStyleFactory { |
|
|
|
/** |
|
* 先写个简单工厂处理一下特殊的控件 |
|
* |
|
* @param widget |
|
* @return 特殊控件的通用属性面板 |
|
*/ |
|
public static BasicBeanPane<MobileStyle> createWidgetMobileStyleDefinePane(Widget widget, Class<? extends MobileStyleCustomDefinePane> customDefinePane, Class<? extends MobileStyle> mobileStyle) { |
|
if (widget instanceof Label) { |
|
return new LabelMobileStyleDefinePane(widget, customDefinePane, mobileStyle); |
|
} |
|
if (widget instanceof MultiFileEditor) { |
|
return new FileEditorMobileStyleDefinePane(widget, customDefinePane, mobileStyle); |
|
} |
|
if (widget instanceof FreeButton) { |
|
return new FreeButtonMobileStyleDefinePane(widget, customDefinePane, mobileStyle); |
|
} |
|
if (widget instanceof TextArea) { |
|
return new TextAreaMobileStyleDefinePane(widget, customDefinePane, mobileStyle); |
|
} |
|
return null; |
|
} |
|
|
|
/** |
|
* 生成控件移动端通用属性 |
|
* |
|
* @param widget |
|
* @return |
|
*/ |
|
public static Class<? extends MobileCommonExtraStyle> classForWidgetCommonExtraStyle(Widget widget) { |
|
if (widget instanceof MultiFileEditor) { |
|
return FileEditorStyle.class; |
|
} |
|
return WidgetThemeMobileCommonExtraStyle.class; |
|
} |
|
|
|
} |