From ec5c6549c24aa9a74232ee9852e4a81e3ff66297 Mon Sep 17 00:00:00 2001 From: roger Date: Tue, 23 Aug 2022 15:23:41 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-78819=20=E9=87=8D=E5=91=BD=E5=90=8D?= =?UTF-8?q?=E5=B7=B2=E6=89=93=E5=BC=80=E7=9A=84=E6=A8=A1=E6=9D=BF=EF=BC=8C?= =?UTF-8?q?=E8=AD=A6=E5=91=8A=E5=BC=B9=E7=AA=97=E5=BA=94=E8=AF=A5=E5=9C=A8?= =?UTF-8?q?=E9=87=8D=E5=91=BD=E5=90=8D=E5=BC=B9=E7=AA=97=E7=9A=84=E4=B8=8A?= =?UTF-8?q?=E5=B1=82=E7=AD=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/EnvChangeEntrance.java | 3 +++ .../java/com/fr/design/actions/file/RenameAction.java | 4 ++-- .../design/file/DefaultTemplateTreeDefineProcessor.java | 3 ++- .../java/com/fr/design/file/MutilTempalteTabPane.java | 8 +++++++- 4 files changed, 14 insertions(+), 4 deletions(-) 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 661d5f05e..d38def283 100644 --- a/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java +++ b/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java @@ -1,6 +1,7 @@ package com.fr.design; import com.fr.common.report.ReportState; +import com.fr.design.mainframe.manager.clip.TemplateTreeClipboard; import com.fr.design.plugin.remind.PluginErrorDesignReminder; import com.fr.design.data.DesignTableDataManager; import com.fr.design.dialog.BasicDialog; @@ -150,6 +151,8 @@ public class EnvChangeEntrance { model.envChanged(); } NotificationCenter.getInstance().clearAllNotifications(); + //切换环境后,清空粘贴板里面的内容 + TemplateTreeClipboard.getInstance().reset(); return true; } diff --git a/designer-base/src/main/java/com/fr/design/actions/file/RenameAction.java b/designer-base/src/main/java/com/fr/design/actions/file/RenameAction.java index c38a01510..c92291cdb 100644 --- a/designer-base/src/main/java/com/fr/design/actions/file/RenameAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/file/RenameAction.java @@ -238,10 +238,10 @@ public class RenameAction extends UpdateAction { private void confirmClose() { if (TemplateUtils.checkSelectedTemplateIsEditing()) { - if (FineJOptionPane.showConfirmDialog(DesignerContext.getDesignerFrame(), + if (FineJOptionPane.showConfirmDialog(this, Toolkit.i18nText("Fine-Design_Basic_Template_Is_Editing"), Toolkit.i18nText("Fine-Design_Basic_Alert"), - YES_NO_OPTION) == JOptionPane.NO_OPTION) { + YES_NO_OPTION) != JOptionPane.YES_OPTION) { return; } } diff --git a/designer-base/src/main/java/com/fr/design/file/DefaultTemplateTreeDefineProcessor.java b/designer-base/src/main/java/com/fr/design/file/DefaultTemplateTreeDefineProcessor.java index 383d5993b..ad7062752 100644 --- a/designer-base/src/main/java/com/fr/design/file/DefaultTemplateTreeDefineProcessor.java +++ b/designer-base/src/main/java/com/fr/design/file/DefaultTemplateTreeDefineProcessor.java @@ -217,7 +217,8 @@ public class DefaultTemplateTreeDefineProcessor extends AbstractTemplateTreeDefi return false; } //确定目标目录并检查权限 - if (getDirTree().getSelectionCount() != 0 && !TemplateDirTreePane.getInstance().selectedAccess()) { + FileOperations selectedOperation = DesignerFrameFileDealerPane.getInstance().getSelectedOperation(); + if (!selectedOperation.access()) { FineJOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Toolkit.i18nText("Fine-Design_Basic_Template_Permission_Denied"), Toolkit.i18nText("Fine-Design_Basic_Alert"), diff --git a/designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java b/designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java index 1e25ddb3d..aabb6ef75 100644 --- a/designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java +++ b/designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java @@ -15,6 +15,7 @@ import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.JTemplate; import com.fr.design.mainframe.TemplateSavingChecker; +import com.fr.design.mainframe.manager.search.TemplateTreeSearchManager; import com.fr.design.utils.DesignUtils; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUIPaintUtils; @@ -258,6 +259,11 @@ public class MutilTempalteTabPane extends JComponent { @Override public void actionPerformed(ActionEvent e) { + //处于搜索模式时,先退出搜索模式,再定位 + if (TemplateTreeSearchManager.getInstance().isInSearchMode()) { + TemplateTreeSearchManager.getInstance().outOfSearchMode(); + TemplateTreePane.getInstance().refreshDockingView(); + } JTemplate template = openedTemplate.get(this.tplIndex); super.gotoEditingTemplateLeaf(template.getPath()); } @@ -287,7 +293,7 @@ public class MutilTempalteTabPane extends JComponent { JTemplate currentTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); closeTemplate(templates, currentTemplate); - if (currentTemplate == null) { + if (option == CloseOption.All) { DesignerContext.getDesignerFrame().addAndActivateJTemplate(); } else { DesignerContext.getDesignerFrame().activateJTemplate(currentTemplate);