From 7e7514a8b8074bc900ccf198081a2ec6ce97cf6a Mon Sep 17 00:00:00 2001 From: "Yuan.Wang" <1536296691@qq.com> Date: Fri, 13 Nov 2020 10:45:55 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-43372=20=E4=BF=AE=E6=94=B9=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E6=A0=91=E8=B7=AF=E5=BE=84=E7=9A=84key=E7=9A=84?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/mainframe/ComponentTree.java | 17 ++++++++--------- .../java/com/fr/design/mainframe/JForm.java | 2 +- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/ComponentTree.java b/designer-form/src/main/java/com/fr/design/mainframe/ComponentTree.java index e1ac304b28..c9ae03272f 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/ComponentTree.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/ComponentTree.java @@ -2,13 +2,13 @@ package com.fr.design.mainframe; import com.fr.design.constants.UIConstants; import com.fr.design.designer.creator.XCreator; -import com.fr.design.designer.creator.XCreatorUtils; import com.fr.design.designer.creator.XLayoutContainer; import com.fr.design.designer.treeview.ComponentTreeCellRenderer; import com.fr.design.designer.treeview.ComponentTreeModel; import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.gui.itree.UITreeUI; import com.fr.design.utils.gui.GUICoreUtils; +import com.fr.log.FineLoggerFactory; import com.fr.stable.StringUtils; import javax.swing.BorderFactory; @@ -287,22 +287,21 @@ public class ComponentTree extends JTree { } private void saveTreePath() { - String templateID = designer.getTarget().getTemplateID(); JTemplate jt = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); - if (templateID != null && jt != null && StringUtils.equals(templateID, jt.getTarget().getTemplateID())) { - String key = jt.getEditingFILE().getPath() + templateID; + if (jt instanceof JForm && jt.getTarget() == designer.getTarget()) { + String key = jt.getEditingFILE().getPath() + "-" + designer.getTarget().getTemplateID(); treePathCache.put(key, getExpandTreePaths()); } } private List loadTreePath() { + List result = null; JTemplate jt = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); - if (jt == null) { - return null; + if (jt instanceof JForm) { + String key = jt.getEditingFILE().getPath() + "-" + designer.getTarget().getTemplateID(); + result = treePathCache.get(key); } - String key = jt.getEditingFILE().getPath() + designer.getTarget().getTemplateID(); - - return treePathCache.get(key); + return result == null ? new ArrayList<>() : result; } private TreePath buildTreePath(Component comp) { diff --git a/designer-form/src/main/java/com/fr/design/mainframe/JForm.java b/designer-form/src/main/java/com/fr/design/mainframe/JForm.java index b7fb90fcb8..43aa58d9b9 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/JForm.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/JForm.java @@ -313,7 +313,7 @@ public class JForm extends JTemplate implements BaseJForm