Browse Source

Merge pull request #289 in DESIGN/design from ~JU/design:release/10.0 to release/10.0

* commit 'f5579ad3a4b53c9bd05b704ff4c398fb1a6bbbec':
  REPORT-10202 没用的监听,删了
research/10.0
ju 6 years ago
parent
commit
20f439b7f2
  1. 18
      designer-base/src/main/java/com/fr/design/actions/file/SwitchExistEnv.java
  2. 2
      designer-base/src/main/java/com/fr/design/file/HistoryTemplateListPane.java
  3. 18
      designer-base/src/main/java/com/fr/design/mainframe/TemplatePane.java

18
designer-base/src/main/java/com/fr/design/actions/file/SwitchExistEnv.java

@ -9,20 +9,17 @@ 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.event.EventDispatcher;
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;
import com.fr.workspace.connect.AuthException;
import javax.swing.*;
import javax.swing.JOptionPane;
import javax.swing.UIManager;
import java.awt.event.ActionEvent;
import java.util.HashMap;
import java.util.Iterator;
@ -35,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() {

2
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;
}

18
designer-base/src/main/java/com/fr/design/mainframe/TemplatePane.java

@ -16,7 +16,6 @@ import com.fr.env.EnvListPane;
import com.fr.event.EventDispatcher;
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;
@ -24,8 +23,20 @@ import com.fr.workspace.Workspace;
import com.fr.workspace.WorkspaceEvent;
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;
@ -134,7 +145,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) {

Loading…
Cancel
Save