Browse Source

REPORT-71824 frm打开报表块编辑页面,切换工作目录无法打开当前frm

【问题原因】
切换工作空间后,应该刷新整个设计。
10.0和11.0的刷新都有问题,需要退出当前选中控件的编辑模式。

【改动思路】
同上
new-design
Starryi 2 years ago
parent
commit
27f974c488
  1. 10
      designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java
  2. 23
      designer-form/src/main/java/com/fr/design/mainframe/JForm.java

10
designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java

@ -499,6 +499,13 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
UIUtil.invokeLaterIfNeeded(new Runnable() {
@Override
public void run() {
refreshDesignerFromResource();
}
});
}
protected void refreshDesignerFromResource() {
// 先移除旧的。
removeCenterPane();
// 加入新的
@ -508,9 +515,6 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter()).refreshDockingView();
}
});
}
/**
* 刷新 模板资源 EditingFILE

23
designer-form/src/main/java/com/fr/design/mainframe/JForm.java

@ -70,6 +70,7 @@ import com.fr.design.parameter.ParameterPropertyPane;
import com.fr.design.preview.FormPreview;
import com.fr.design.preview.MobilePreview;
import com.fr.design.roleAuthority.RolesAlreadyEditedPane;
import com.fr.design.ui.util.UIUtil;
import com.fr.design.utils.gui.LayoutUtils;
import com.fr.file.FILE;
import com.fr.file.FILEChooserPane;
@ -380,6 +381,28 @@ public class JForm extends JTemplate<Form, FormUndoState> implements BaseJForm<F
this.formDesign = formDesign;
}
@Override
protected void refreshDesignerFromResource() {
stopCreatorEditing();
super.refreshDesignerFromResource();
}
private void stopCreatorEditing() {
if (index == ELEMENTCASE_TAB) {
tabChanged(FORM_TAB);
} else if (index == FORM_TAB) {
TreePath[] treePaths = FormHierarchyTreePane.getInstance(formDesign).getComponentTree().getSelectedTreePath();
if (treePaths != null) {
for (TreePath path : treePaths) {
if (path != null) {
formDesign.stopEditing(path);
}
}
}
FormHierarchyTreePane.getInstance().refreshRoot();
}
}
/**
* 去除选择
*/

Loading…
Cancel
Save