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.
47 lines
1.4 KiB
47 lines
1.4 KiB
1 year ago
|
package com.fr.widgettheme.util;
|
||
|
|
||
|
import com.fr.base.io.AttrMark;
|
||
|
import com.fr.base.io.IOFile;
|
||
|
import com.fr.design.file.HistoryTemplateListCache;
|
||
|
import com.fr.design.mainframe.JTemplate;
|
||
|
import com.fr.stable.StringUtils;
|
||
|
import com.fr.widgettheme.control.attr.WidgetDisplayEnhanceMarkAttr;
|
||
|
|
||
|
/**
|
||
|
* 控件主题设计器部分工具类
|
||
|
*
|
||
|
* @author obo
|
||
|
* @since 11.0
|
||
|
* Created on 2023/11/13
|
||
|
*/
|
||
|
public class WidgetThemeDesignerUtils {
|
||
|
|
||
|
private WidgetThemeDesignerUtils() {
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* 从 WorkBook 中加载 WatermarkAttr 属性对象
|
||
|
*
|
||
|
* @param template AttrMark 对象,包括 WorkBook
|
||
|
* @return StrongestControlMarkAttr 对象
|
||
|
*/
|
||
|
public static WidgetDisplayEnhanceMarkAttr getStrongestControlAttrFromTemplate(AttrMark template) {
|
||
|
return template.getAttrMark(WidgetDisplayEnhanceMarkAttr.XML_TAG);
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* 判断是否启用了控件显示增强
|
||
|
*
|
||
|
* @return 开启与否
|
||
|
*/
|
||
|
public static boolean enableWidgetEnhance() {
|
||
|
JTemplate<?, ?> jTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();
|
||
|
if (JTemplate.isValid(jTemplate)) {
|
||
|
IOFile ioFile = (IOFile) jTemplate.getTarget();
|
||
|
WidgetDisplayEnhanceMarkAttr mark = ioFile.getAttrMark(WidgetDisplayEnhanceMarkAttr.XML_TAG);
|
||
|
return mark != null && mark.isWidgetEnhance();
|
||
|
}
|
||
|
return false;
|
||
|
}
|
||
|
}
|