|
|
@ -664,9 +664,11 @@ public class JForm extends JTemplate<Form, FormUndoState> implements BaseJForm<F |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
protected void applyUndoState(FormUndoState u) { |
|
|
|
protected void applyUndoState(FormUndoState u) { |
|
|
|
try { |
|
|
|
try { |
|
|
|
|
|
|
|
Form undoForm = (Form) u.getForm().clone(); |
|
|
|
|
|
|
|
undoForm.checkAndResetTheme(); |
|
|
|
if (this.index == FORM_TAB) { |
|
|
|
if (this.index == FORM_TAB) { |
|
|
|
//JForm的target重置
|
|
|
|
//JForm的target重置
|
|
|
|
this.setTarget((Form) u.getForm().clone()); |
|
|
|
this.setTarget(undoForm); |
|
|
|
JForm.this.refreshRoot(); |
|
|
|
JForm.this.refreshRoot(); |
|
|
|
this.formDesign.getArea().setAreaSize(u.getAreaSize(), u.getHorizontalValue(), u.getVerticalValue(), u.getWidthValue(), u.getHeightValue(), u.getSlideValue()); |
|
|
|
this.formDesign.getArea().setAreaSize(u.getAreaSize(), u.getHorizontalValue(), u.getVerticalValue(), u.getWidthValue(), u.getHeightValue(), u.getSlideValue()); |
|
|
|
//撤销的时候要重新选择的body布局
|
|
|
|
//撤销的时候要重新选择的body布局
|
|
|
@ -685,7 +687,6 @@ public class JForm extends JTemplate<Form, FormUndoState> implements BaseJForm<F |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
// 只在报表块里撤销是不需要修改外部form对象的, 因为编辑的是当前报表块.
|
|
|
|
// 只在报表块里撤销是不需要修改外部form对象的, 因为编辑的是当前报表块.
|
|
|
|
// 修改了JForm的Target需要同步修改formDesign的Target.
|
|
|
|
// 修改了JForm的Target需要同步修改formDesign的Target.
|
|
|
|
Form undoForm = (Form) u.getForm().clone(); |
|
|
|
|
|
|
|
String widgetName = this.formDesign.getElementCaseContainerName(); |
|
|
|
String widgetName = this.formDesign.getElementCaseContainerName(); |
|
|
|
//这儿太坑了,u.getForm() 与 getTarget内容不一样
|
|
|
|
//这儿太坑了,u.getForm() 与 getTarget内容不一样
|
|
|
|
FormElementCaseProvider dataTable = undoForm.getElementCaseByName(widgetName); |
|
|
|
FormElementCaseProvider dataTable = undoForm.getElementCaseByName(widgetName); |
|
|
@ -1188,10 +1189,20 @@ public class JForm extends JTemplate<Form, FormUndoState> implements BaseJForm<F |
|
|
|
FormTheme oldTheme = getTarget().getTemplateTheme(); |
|
|
|
FormTheme oldTheme = getTarget().getTemplateTheme(); |
|
|
|
boolean shouldCreateUndoState = compatible == TemplateThemeCompatible.NONE && !StringUtils.equals(oldTheme.getName(), newTheme.getName()); |
|
|
|
boolean shouldCreateUndoState = compatible == TemplateThemeCompatible.NONE && !StringUtils.equals(oldTheme.getName(), newTheme.getName()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
FormArea formArea = formDesign.getArea(); |
|
|
|
|
|
|
|
int horizontalValue = formArea.getHorizontalValue(); |
|
|
|
|
|
|
|
int verticalValue= formArea.getVerticalValue(); |
|
|
|
|
|
|
|
Dimension areaSize = formArea.getAreaSize(); |
|
|
|
|
|
|
|
double widthValue = formArea.getWidthPaneValue(); |
|
|
|
|
|
|
|
double heightValue = formArea.getHeightPaneValue(); |
|
|
|
|
|
|
|
double slideValue = formArea.getSlideValue(); |
|
|
|
|
|
|
|
|
|
|
|
getTarget().setTemplateTheme(newTheme, compatible); |
|
|
|
getTarget().setTemplateTheme(newTheme, compatible); |
|
|
|
|
|
|
|
|
|
|
|
fireTargetModified(shouldCreateUndoState); |
|
|
|
fireTargetModified(shouldCreateUndoState); |
|
|
|
formDesign.refreshRoot(); |
|
|
|
formDesign.refreshRoot(); |
|
|
|
|
|
|
|
// 刷新界面后恢复原来的尺寸
|
|
|
|
|
|
|
|
formDesign.getArea().setAreaSize(areaSize, horizontalValue, verticalValue, widthValue, heightValue, slideValue); |
|
|
|
FormHierarchyTreePane.getInstance().refreshRoot(); |
|
|
|
FormHierarchyTreePane.getInstance().refreshRoot(); |
|
|
|
if (this.index != FORM_TAB) { |
|
|
|
if (this.index != FORM_TAB) { |
|
|
|
refreshToolArea(); |
|
|
|
refreshToolArea(); |
|
|
|