|
|
@ -3,6 +3,11 @@ |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
package com.fr.design.designer.creator; |
|
|
|
package com.fr.design.designer.creator; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.fr.base.theme.FineColorManager; |
|
|
|
|
|
|
|
import com.fr.base.theme.FormTheme; |
|
|
|
|
|
|
|
import com.fr.base.theme.TemplateTheme; |
|
|
|
|
|
|
|
import com.fr.base.theme.TemplateThemeAware; |
|
|
|
|
|
|
|
import com.fr.base.theme.TemplateThemeCompatible; |
|
|
|
import com.fr.design.ExtraDesignClassManager; |
|
|
|
import com.fr.design.ExtraDesignClassManager; |
|
|
|
import com.fr.design.designer.creator.cardlayout.XCardAddButton; |
|
|
|
import com.fr.design.designer.creator.cardlayout.XCardAddButton; |
|
|
|
import com.fr.design.designer.creator.cardlayout.XCardSwitchButton; |
|
|
|
import com.fr.design.designer.creator.cardlayout.XCardSwitchButton; |
|
|
@ -11,11 +16,15 @@ import com.fr.design.designer.creator.cardlayout.XWCardMainBorderLayout; |
|
|
|
import com.fr.design.designer.creator.cardlayout.XWCardTagLayout; |
|
|
|
import com.fr.design.designer.creator.cardlayout.XWCardTagLayout; |
|
|
|
import com.fr.design.designer.creator.cardlayout.XWCardTitleLayout; |
|
|
|
import com.fr.design.designer.creator.cardlayout.XWCardTitleLayout; |
|
|
|
import com.fr.design.designer.creator.cardlayout.XWTabFitLayout; |
|
|
|
import com.fr.design.designer.creator.cardlayout.XWTabFitLayout; |
|
|
|
|
|
|
|
import com.fr.design.file.HistoryTemplateListCache; |
|
|
|
import com.fr.design.fun.ChartWidgetOptionProvider; |
|
|
|
import com.fr.design.fun.ChartWidgetOptionProvider; |
|
|
|
import com.fr.design.fun.FormWidgetOptionProvider; |
|
|
|
import com.fr.design.fun.FormWidgetOptionProvider; |
|
|
|
import com.fr.design.fun.ParameterWidgetOptionProvider; |
|
|
|
import com.fr.design.fun.ParameterWidgetOptionProvider; |
|
|
|
|
|
|
|
import com.fr.design.mainframe.JTemplate; |
|
|
|
import com.fr.design.module.DesignModuleFactory; |
|
|
|
import com.fr.design.module.DesignModuleFactory; |
|
|
|
import com.fr.design.utils.gui.LayoutUtils; |
|
|
|
import com.fr.design.utils.gui.LayoutUtils; |
|
|
|
|
|
|
|
import com.fr.form.main.Form; |
|
|
|
|
|
|
|
import com.fr.form.main.WidgetGather; |
|
|
|
import com.fr.form.parameter.FormSubmitButton; |
|
|
|
import com.fr.form.parameter.FormSubmitButton; |
|
|
|
import com.fr.form.ui.Button; |
|
|
|
import com.fr.form.ui.Button; |
|
|
|
import com.fr.form.ui.CardAddButton; |
|
|
|
import com.fr.form.ui.CardAddButton; |
|
|
@ -216,6 +225,16 @@ public class XCreatorUtils { |
|
|
|
return xClazz; |
|
|
|
return xClazz; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static XCreator createThemedXCreator(Widget widget) { |
|
|
|
|
|
|
|
XCreator creator = createXCreator(widget); |
|
|
|
|
|
|
|
JTemplate<?,?> template = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); |
|
|
|
|
|
|
|
TemplateTheme theme = template.getTemplateTheme(); |
|
|
|
|
|
|
|
if (theme instanceof FormTheme) { |
|
|
|
|
|
|
|
setupTemplateTheme(creator, (FormTheme) theme, TemplateThemeCompatible.NONE); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return creator; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 创建creator |
|
|
|
* 创建creator |
|
|
|
* |
|
|
|
* |
|
|
@ -356,4 +375,21 @@ public class XCreatorUtils { |
|
|
|
} |
|
|
|
} |
|
|
|
return null; |
|
|
|
return null; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static void setupTemplateTheme(XCreator container, final FormTheme currentTemplateUsingTheme, TemplateThemeCompatible compatible) { |
|
|
|
|
|
|
|
FineColorManager.traverse(container.toData(), new FineColorManager.FineColorReplaceByTheme(currentTemplateUsingTheme, compatible)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Form.traversalWidget(container.toData(), new WidgetGather() { |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public void dealWith(Widget widget) { |
|
|
|
|
|
|
|
TemplateThemeAware<FormTheme> themedWidget = (TemplateThemeAware) widget; |
|
|
|
|
|
|
|
themedWidget.onTemplateUsingThemeChange(currentTemplateUsingTheme, compatible); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public boolean dealWithAllCards() { |
|
|
|
|
|
|
|
return true; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, TemplateThemeAware.class); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |