Browse Source
Merge in DESIGN/design from ~OBO/design1:release/11.0 to release/11.0 * commit '8c64f9d6c81b290cebb393e7fb3b9f69e934736f': REPORT-111619 控件增强-更多的样式配置--报表支撑 主题预览界面支持控件及提升跟随tab切换release/11.0
Obo-王学仁
11 months ago
11 changed files with 176 additions and 32 deletions
@ -0,0 +1,62 @@ |
|||||||
|
package com.fr.widgettheme; |
||||||
|
|
||||||
|
import com.fr.base.theme.TemplateTheme; |
||||||
|
import com.fr.widgettheme.theme.widget.style.MobileThemedWidgetStyle; |
||||||
|
import com.fr.widgettheme.theme.widget.style.ThemedWidgetStyle; |
||||||
|
|
||||||
|
/** |
||||||
|
* 主题样式预览终端类型 |
||||||
|
* |
||||||
|
* @author obo |
||||||
|
* @since 11.0 |
||||||
|
* Created on 2024/2/2 |
||||||
|
*/ |
||||||
|
public enum ThemePreviewTerminal { |
||||||
|
|
||||||
|
/** |
||||||
|
* 桌面端,为默认类型 |
||||||
|
*/ |
||||||
|
PC(0) { |
||||||
|
@Override |
||||||
|
public ThemedWidgetStyle getThemeWidgetStyle(TemplateTheme theme) { |
||||||
|
return (ThemedWidgetStyle) theme.getWidgetStyle(); |
||||||
|
} |
||||||
|
}, |
||||||
|
|
||||||
|
/** |
||||||
|
* 移动端 |
||||||
|
*/ |
||||||
|
MOBILE(1) { |
||||||
|
@Override |
||||||
|
public ThemedWidgetStyle getThemeWidgetStyle(TemplateTheme theme) { |
||||||
|
return (MobileThemedWidgetStyle) theme.getMobileWidgetStyle(); |
||||||
|
} |
||||||
|
}; |
||||||
|
|
||||||
|
/** |
||||||
|
* 类型码 |
||||||
|
*/ |
||||||
|
final int code; |
||||||
|
|
||||||
|
ThemePreviewTerminal(int code) { |
||||||
|
this.code = code; |
||||||
|
} |
||||||
|
|
||||||
|
public int getCode() { |
||||||
|
return code; |
||||||
|
} |
||||||
|
|
||||||
|
public abstract ThemedWidgetStyle getThemeWidgetStyle(TemplateTheme theme); |
||||||
|
|
||||||
|
/** |
||||||
|
* 根据code获取对应的枚举 |
||||||
|
*/ |
||||||
|
public static ThemePreviewTerminal getTypeByCode(int code) { |
||||||
|
for (ThemePreviewTerminal type : ThemePreviewTerminal.values()) { |
||||||
|
if (type.code == code) { |
||||||
|
return type; |
||||||
|
} |
||||||
|
} |
||||||
|
throw new IllegalArgumentException("Invalid ThemePreviewTerminalType code :" + code); |
||||||
|
} |
||||||
|
} |
Loading…
Reference in new issue