From 8de60f31418b6db2a3c40e0597bb3189ca3ed70f Mon Sep 17 00:00:00 2001 From: hades Date: Thu, 12 Mar 2020 20:24:21 +0800 Subject: [PATCH] REPORT-28026 && REPORT-27919 --- .../mainframe/DesignerFrameFileDealerPane.java | 16 +--------------- .../fr/design/parameter/ParameterInputPane.java | 9 +++++++++ 2 files changed, 10 insertions(+), 15 deletions(-) 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 b4b469e10..bcac7f946 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 @@ -684,21 +684,7 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt this.dispose(); //模版重命名 - boolean success = false; - - // 提醒保存文件 - SaveSomeTemplatePane saveSomeTempaltePane = new SaveSomeTemplatePane(true); - // 只有一个文件未保存时 - if (HistoryTemplateListCache.getInstance().getHistoryCount() == 1) { - int choose = saveSomeTempaltePane.saveLastOneTemplate(); - if (choose != JOptionPane.CANCEL_OPTION) { - success = selectedOperation.rename(fnf, path, newPath); - } - } else { - if (saveSomeTempaltePane.showSavePane()) { - success = selectedOperation.rename(fnf, path, newPath); - } - } + boolean success = selectedOperation.rename(fnf, path, newPath); if (success) { HistoryTemplateListCache.getInstance().rename(fnf, path, newPath); diff --git a/designer-base/src/main/java/com/fr/design/parameter/ParameterInputPane.java b/designer-base/src/main/java/com/fr/design/parameter/ParameterInputPane.java index 14487ca5f..8e8819c67 100644 --- a/designer-base/src/main/java/com/fr/design/parameter/ParameterInputPane.java +++ b/designer-base/src/main/java/com/fr/design/parameter/ParameterInputPane.java @@ -17,6 +17,7 @@ import com.fr.design.editor.editor.Editor; import com.fr.design.editor.editor.FloatEditor; import com.fr.design.editor.editor.IntegerEditor; import com.fr.design.editor.editor.TextEditor; +import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.FRGUIPaneFactory; @@ -24,6 +25,8 @@ import com.fr.stable.ParameterProvider; import com.fr.stable.StringUtils; import javax.swing.*; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; import java.awt.*; import java.util.ArrayList; import java.util.Date; @@ -103,6 +106,12 @@ public class ParameterInputPane extends BasicPane { contentPane.add(flowTableLayoutHelper.createLabelFlowPane(parameterDisplayName + ":", editPane)); //add editor to parameter hashtable. + textF.getCurrentEditor().addChangeListener(new ChangeListener() { + @Override + public void stateChanged(ChangeEvent e) { + HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().fireTargetModified(); + } + }); this.editorNameMap.put(textF, parameter.getName()); nameAddedList.add(parameter.getName()); }