diff --git a/designer-form/src/main/java/com/fr/design/fit/common/TemplateTool.java b/designer-form/src/main/java/com/fr/design/fit/common/TemplateTool.java index b8954d5f7e..ae1e98f885 100644 --- a/designer-form/src/main/java/com/fr/design/fit/common/TemplateTool.java +++ b/designer-form/src/main/java/com/fr/design/fit/common/TemplateTool.java @@ -46,11 +46,8 @@ public class TemplateTool { if (AdaptiveSwitchUtil.isSwitchJFromIng()) { currentType = DesignerUIModeConfig.getInstance().newUIMode() ? JFormType.NEW_TYPE : JFormType.OLD_TYPE; } else { - if (jTemplate instanceof NewJForm) { - NewJForm newJForm = (NewJForm) jTemplate; - if (LightTool.containNewFormFlag(newJForm.getTarget()) || newJForm.getTarget().getTemplateID() == null) { - currentType = JFormType.NEW_TYPE; - } + if (isNewJForm(jTemplate)) { + currentType = JFormType.NEW_TYPE; } } //UI转换 @@ -62,6 +59,16 @@ public class TemplateTool { } }; + private static boolean isNewJForm(JTemplate jTemplate) { + if (jTemplate instanceof NewJForm) { + NewJForm newJForm = (NewJForm) jTemplate; + if (LightTool.containNewFormFlag(newJForm.getTarget()) || newJForm.getTarget().getTemplateID() == null) { + return true; + } + } + return false; + } + public static Listener getSwitchListener() { return switchListener; }