From 5253c81482058dc125482f15d5a1a3b77ee88e2d Mon Sep 17 00:00:00 2001 From: "fly.li" Date: Mon, 27 Sep 2021 16:53:54 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=86=B2=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/mainframe/DesignerFrameFileDealerPane.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java index fe2589028..2925e03a8 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java @@ -3,6 +3,7 @@ package com.fr.design.mainframe; import com.fr.base.BaseUtils; import com.fr.base.extension.FileExtension; import com.fr.base.vcs.DesignerMode; +import com.fr.chartx.TwoTuple; import com.fr.design.DesignModelAdapter; import com.fr.design.DesignerEnvManager; import com.fr.design.ExtraDesignClassManager; @@ -35,6 +36,8 @@ import com.fr.design.menu.ToolBarDef; import com.fr.design.roleAuthority.RolesAlreadyEditedPane; import com.fr.design.utils.DesignUtils; import com.fr.design.utils.gui.GUICoreUtils; +import com.fr.event.Event; +import com.fr.event.EventDispatcher; import com.fr.file.FileNodeFILE; import com.fr.file.filetree.FileNode; import com.fr.general.ComparatorUtils; @@ -78,6 +81,8 @@ import java.util.Set; import static javax.swing.JOptionPane.WARNING_MESSAGE; public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarStateChangeListener, ResponseDataSourceChange { + public static final Event> TEMPLATE_RENAME = new Event>() { + }; private static final String FILE = "file"; private static volatile DesignerFrameFileDealerPane THIS; @@ -690,6 +695,7 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt boolean success = selectedOperation.rename(fnf, path, newPath); if (success) { + EventDispatcher.fire(TEMPLATE_RENAME, new TwoTuple<>(path, newPath)); HistoryTemplateListCache.getInstance().rename(fnf, path, newPath); DesignerEnvManager.getEnvManager().replaceRecentOpenedFilePath(fnf.isDirectory(), path, newPath); selectedOperation.refresh();