diff --git a/designer-base/src/main/java/com/fr/design/javascript/JSContentPane.java b/designer-base/src/main/java/com/fr/design/javascript/JSContentPane.java index c9344f5ca8..a31ebe8450 100644 --- a/designer-base/src/main/java/com/fr/design/javascript/JSContentPane.java +++ b/designer-base/src/main/java/com/fr/design/javascript/JSContentPane.java @@ -31,6 +31,7 @@ import java.awt.BorderLayout; import java.awt.Cursor; import java.awt.Dimension; import java.awt.FontMetrics; +import java.awt.Window; import java.awt.event.FocusEvent; import java.awt.event.FocusListener; import java.awt.event.MouseAdapter; @@ -54,6 +55,7 @@ public class JSContentPane extends BasicPane { private JSImplUpdateAction jsImplUpdateAction; private JSImplPopulateAction jsImplPopulateAction; private boolean modal; + private Window parentWindow; BasicDialog advancedEditorDialog ; public JSContentPane(){} @@ -122,6 +124,9 @@ public class JSContentPane extends BasicPane { super.doCancel(); } },new Dimension(900,800)); + if (parentWindow != null) { + parentWindow.setVisible(false); + } advancedEditorDialog.setModal(modal); advancedEditorDialog.setResizable(true); advancedEditorDialog.pack(); @@ -133,6 +138,10 @@ public class JSContentPane extends BasicPane { labelPane.add(advancedEditorLabel,BorderLayout.EAST); } + public void setParentWindow(Window parentWindow) { + this.parentWindow = parentWindow; + } + protected UIScrollPane createContentTextAreaPanel(){ contentTextArea = new RSyntaxTextArea(); contentTextArea.setCloseCurlyBraces(true); diff --git a/designer-base/src/main/java/com/fr/design/javascript/JavaScriptImplPane.java b/designer-base/src/main/java/com/fr/design/javascript/JavaScriptImplPane.java index 6a83ad3d24..fa7e30dc44 100644 --- a/designer-base/src/main/java/com/fr/design/javascript/JavaScriptImplPane.java +++ b/designer-base/src/main/java/com/fr/design/javascript/JavaScriptImplPane.java @@ -29,6 +29,7 @@ import javax.swing.JPanel; import javax.swing.event.TableModelEvent; import javax.swing.event.TableModelListener; +import java.awt.Window; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -49,6 +50,7 @@ public class JavaScriptImplPane extends AbstractHyperLinkPane { public JavaScriptImplPane(HashMap hyperLinkEditorMap, boolean needRenamePane) { super(hyperLinkEditorMap, needRenamePane); this.defaultArgs = new String[0]; + this.modal = true; initComponents(); } @@ -149,7 +151,9 @@ public class JavaScriptImplPane extends AbstractHyperLinkPane { return importedJsPane; } - + public void setParentWindow4ContentPane(Window parentWindow) { + jsPane.setParentWindow(parentWindow); + } /** * 参数改变 diff --git a/designer-chart/src/main/java/com/fr/van/chart/custom/component/VanChartHyperLinkPane.java b/designer-chart/src/main/java/com/fr/van/chart/custom/component/VanChartHyperLinkPane.java index 6e5b346a18..1a23ca8162 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/custom/component/VanChartHyperLinkPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/custom/component/VanChartHyperLinkPane.java @@ -77,7 +77,11 @@ public class VanChartHyperLinkPane extends VanChartUIListControlPane { Constructor constructor = null; try { constructor = creator.getUpdatePane().getConstructor(HashMap.class, boolean.class); - return constructor.newInstance(getHyperLinkEditorMap(), false); + BasicBeanPane pane = constructor.newInstance(getHyperLinkEditorMap(), false); + if (pane instanceof JavaScriptImplPane) { + ((JavaScriptImplPane) pane).setParentWindow4ContentPane(getPopupEditDialog()); + } + return pane; } catch (InstantiationException | IllegalAccessException | InvocationTargetException e) { FineLoggerFactory.getLogger().error(e.getMessage(), e);