Browse Source

REPORT-10202 没用的监听,删了

final/10.0
ju 7 years ago
parent
commit
c80dcdf0e7
  1. 15
      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

15
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.env.DesignerWorkspaceInfo;
import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.JTemplate;
import com.fr.design.menu.KeySetUtils; import com.fr.design.menu.KeySetUtils;
import com.fr.design.menu.MenuDef; import com.fr.design.menu.MenuDef;
import com.fr.design.menu.SeparatorDef; import com.fr.design.menu.SeparatorDef;
import com.fr.design.utils.DesignUtils; 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.WorkContext;
import com.fr.workspace.WorkContextCallback; import com.fr.workspace.WorkContextCallback;
import com.fr.workspace.Workspace; import com.fr.workspace.Workspace;
@ -36,17 +32,6 @@ public class SwitchExistEnv extends MenuDef {
this.setName(getMenuKeySet().getMenuName()); this.setName(getMenuKeySet().getMenuName());
this.setHasScrollSubMenu(true); this.setHasScrollSubMenu(true);
initMenuDef(); 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() { 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) { public void closeSelectedReport(JTemplate<?, ?> selected) {
DesignModuleFactory.clearChartPropertyPane(); DesignModuleFactory.clearChartPropertyPane();
DesignTableDataManager.closeTemplate(selected); DesignTableDataManager.closeTemplate(selected);
GeneralContext.removeEnvWillChangedListener(selected.getPath());
if (contains(selected) == -1) { if (contains(selected) == -1) {
return; return;
} }
@ -139,7 +138,6 @@ public class HistoryTemplateListPane extends JPanel implements FileOperations, C
public void closeVirtualSelectedReport(JTemplate<?, ?> selected) { public void closeVirtualSelectedReport(JTemplate<?, ?> selected) {
DesignModuleFactory.clearChartPropertyPane(); DesignModuleFactory.clearChartPropertyPane();
DesignTableDataManager.closeTemplate(selected); DesignTableDataManager.closeTemplate(selected);
GeneralContext.removeEnvWillChangedListener(selected.getPath());
if (contains(selected) == -1) { if (contains(selected) == -1) {
return; return;
} }

18
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.env.EnvListPane;
import com.fr.general.GeneralContext; import com.fr.general.GeneralContext;
import com.fr.general.IOUtils; import com.fr.general.IOUtils;
import com.fr.stable.EnvChangedListener; import com.fr.stable.EnvChangedListener;
import com.fr.workspace.WorkContext; import com.fr.workspace.WorkContext;
import com.fr.workspace.WorkContextCallback; import com.fr.workspace.WorkContextCallback;
import com.fr.workspace.Workspace; import com.fr.workspace.Workspace;
import com.fr.workspace.connect.AuthException; import com.fr.workspace.connect.AuthException;
import javax.swing.*; import javax.swing.BorderFactory;
import java.awt.*; 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.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.awt.event.MouseEvent; import java.awt.event.MouseEvent;
@ -132,7 +143,6 @@ public class TemplatePane extends JPanel implements MouseListener {
final String selectedName = envListPane.updateEnvManager(); final String selectedName = envListPane.updateEnvManager();
DesignerEnvManager envManager = DesignerEnvManager.getEnvManager(); DesignerEnvManager envManager = DesignerEnvManager.getEnvManager();
DesignerWorkspaceInfo selectedEnv = envManager.getWorkspaceInfo(selectedName); DesignerWorkspaceInfo selectedEnv = envManager.getWorkspaceInfo(selectedName);
GeneralContext.fireEnvWillChangeListener();
try { try {
Workspace workspace = DesignerWorkspaceGenerator.generate(selectedEnv); Workspace workspace = DesignerWorkspaceGenerator.generate(selectedEnv);
if (workspace == null) { if (workspace == null) {

Loading…
Cancel
Save