diff --git a/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java b/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java index d38def2836..9771239eab 100644 --- a/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java +++ b/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java @@ -116,6 +116,10 @@ public class EnvChangeEntrance { if (!checkValid) { return false; } + //如果是相同环境就不会做done操作,因此不会更新名字,需要先判断一下,如果是相同环境也要更新一下名字(可能会重命名) + if (AssistUtils.equals(WorkContext.getCurrent(), workspace)) { + DesignerEnvManager.getEnvManager().setCurEnvName(envName); + } WorkContext.switchTo(workspace, new WorkContextCallback() { @Override diff --git a/designer-base/src/main/java/com/fr/design/gui/ilist/JNameEdList.java b/designer-base/src/main/java/com/fr/design/gui/ilist/JNameEdList.java index 4c530c0fcc..4a489e50f5 100644 --- a/designer-base/src/main/java/com/fr/design/gui/ilist/JNameEdList.java +++ b/designer-base/src/main/java/com/fr/design/gui/ilist/JNameEdList.java @@ -175,7 +175,8 @@ public class JNameEdList extends UIList implements CellEditorListener { } public void setIllegalIndex(int index) { - setNameAt(NameInspector.ILLEGAL_NAME_HOLDER, index); + //环境如果重名会被命名为请重命名,这个”请重命名“也会重复,后面加个索引区别一下 + setNameAt(NameInspector.ILLEGAL_NAME_HOLDER + index, index); this.repaint(); }