From c80dcdf0e7946ba7c4fd9c1bd46639988f1b2e99 Mon Sep 17 00:00:00 2001 From: ju Date: Tue, 31 Jul 2018 15:33:08 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-10202=20=E6=B2=A1=E7=94=A8=E7=9A=84?= =?UTF-8?q?=E7=9B=91=E5=90=AC=EF=BC=8C=E5=88=A0=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/actions/file/SwitchExistEnv.java | 15 --------------- .../design/file/HistoryTemplateListPane.java | 2 -- .../com/fr/design/mainframe/TemplatePane.java | 18 ++++++++++++++---- 3 files changed, 14 insertions(+), 21 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/actions/file/SwitchExistEnv.java b/designer-base/src/main/java/com/fr/design/actions/file/SwitchExistEnv.java index 9b400f0522..d32a1aa678 100644 --- a/designer-base/src/main/java/com/fr/design/actions/file/SwitchExistEnv.java +++ b/designer-base/src/main/java/com/fr/design/actions/file/SwitchExistEnv.java @@ -9,14 +9,10 @@ import com.fr.design.env.DesignerWorkspaceGenerator; import com.fr.design.env.DesignerWorkspaceInfo; import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.mainframe.DesignerContext; -import com.fr.design.mainframe.JTemplate; import com.fr.design.menu.KeySetUtils; import com.fr.design.menu.MenuDef; import com.fr.design.menu.SeparatorDef; import com.fr.design.utils.DesignUtils; -import com.fr.general.GeneralContext; - -import com.fr.stable.EnvChangedListener; import com.fr.workspace.WorkContext; import com.fr.workspace.WorkContextCallback; import com.fr.workspace.Workspace; @@ -36,17 +32,6 @@ public class SwitchExistEnv extends MenuDef { this.setName(getMenuKeySet().getMenuName()); this.setHasScrollSubMenu(true); initMenuDef(); - JTemplate t = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); - if (t != null) { - GeneralContext.addEnvWillChangedListener( - t.getPath(), - new EnvChangedListener() { - public void envChanged() { - SwitchExistEnv.this.clearShortCuts(); - initMenuDef(); - } - }); - } } private void initMenuDef() { diff --git a/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListPane.java b/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListPane.java index 12dad2ea85..6d828ccafd 100644 --- a/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListPane.java +++ b/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListPane.java @@ -114,7 +114,6 @@ public class HistoryTemplateListPane extends JPanel implements FileOperations, C public void closeSelectedReport(JTemplate selected) { DesignModuleFactory.clearChartPropertyPane(); DesignTableDataManager.closeTemplate(selected); - GeneralContext.removeEnvWillChangedListener(selected.getPath()); if (contains(selected) == -1) { return; } @@ -139,7 +138,6 @@ public class HistoryTemplateListPane extends JPanel implements FileOperations, C public void closeVirtualSelectedReport(JTemplate selected) { DesignModuleFactory.clearChartPropertyPane(); DesignTableDataManager.closeTemplate(selected); - GeneralContext.removeEnvWillChangedListener(selected.getPath()); if (contains(selected) == -1) { return; } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/TemplatePane.java b/designer-base/src/main/java/com/fr/design/mainframe/TemplatePane.java index b569e054e1..a7a466bdb5 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/TemplatePane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/TemplatePane.java @@ -15,15 +15,26 @@ import com.fr.design.utils.DesignUtils; import com.fr.env.EnvListPane; import com.fr.general.GeneralContext; import com.fr.general.IOUtils; - import com.fr.stable.EnvChangedListener; import com.fr.workspace.WorkContext; import com.fr.workspace.WorkContextCallback; import com.fr.workspace.Workspace; import com.fr.workspace.connect.AuthException; -import javax.swing.*; -import java.awt.*; +import javax.swing.BorderFactory; +import javax.swing.Icon; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.SwingUtilities; +import javax.swing.UIManager; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Cursor; +import java.awt.Dimension; +import java.awt.GradientPaint; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.Point; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.MouseEvent; @@ -132,7 +143,6 @@ public class TemplatePane extends JPanel implements MouseListener { final String selectedName = envListPane.updateEnvManager(); DesignerEnvManager envManager = DesignerEnvManager.getEnvManager(); DesignerWorkspaceInfo selectedEnv = envManager.getWorkspaceInfo(selectedName); - GeneralContext.fireEnvWillChangeListener(); try { Workspace workspace = DesignerWorkspaceGenerator.generate(selectedEnv); if (workspace == null) {