From ba9bc4cf17648077a0f9b021ef8b2c599fd4a9a9 Mon Sep 17 00:00:00 2001 From: Hades Date: Fri, 11 Jan 2019 09:07:35 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-13544=20=E5=A1=AB=E6=8A=A5=E5=B1=9E?= =?UTF-8?q?=E6=80=A7=E8=AE=BE=E7=BD=AE-=E8=87=AA=E5=AE=9A=E4=B9=89?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E6=9C=89=E7=82=B9=E9=97=AE=E9=A2=98=EF=BC=8C?= =?UTF-8?q?9.0=E4=B9=9F=E5=AD=98=E5=9C=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/webattr/EditToolBar.java | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/design/webattr/EditToolBar.java b/designer-realize/src/main/java/com/fr/design/webattr/EditToolBar.java index 2f2776626..b6683337f 100644 --- a/designer-realize/src/main/java/com/fr/design/webattr/EditToolBar.java +++ b/designer-realize/src/main/java/com/fr/design/webattr/EditToolBar.java @@ -513,6 +513,12 @@ public class EditToolBar extends BasicPane { javaScriptPane.setPreferredSize(new Dimension(750, 500)); BasicDialog dialog = javaScriptPane.showWindow(SwingUtilities.getWindowAncestor(ButtonPane.this)); dialog.addDialogActionListener(new DialogActionAdapter() { + + @Override + public void doCancel() { + javaScriptPane.populateBean(((CustomToolBarButton) widget).getJSImpl()); + } + @Override public void doOk() { ((CustomToolBarButton) widget).setJSImpl(javaScriptPane.updateBean()); @@ -619,7 +625,7 @@ public class EditToolBar extends BasicPane { } else if (widget instanceof Submit) { updateSubmit(); } else if (widget instanceof CustomToolBarButton) { - ((CustomToolBarButton) widget).setJSImpl(this.javaScriptPane.updateBean()); + updateCustomToolBarButton(); } else if (widget instanceof Email) { updateEmail(); } @@ -670,6 +676,16 @@ public class EditToolBar extends BasicPane { email.setConsigneeByDepartment(this.consigneeByDepartment.isSelected()); email.setConsigneeByRole(this.consigneeByRole.isSelected()); } + + private void updateCustomToolBarButton() { + CustomToolBarButton customToolBarButton = (CustomToolBarButton) widget; + if (customToolBarButton.getJSImpl() != null) { + customToolBarButton.setJSImpl(this.javaScriptPane.updateBean()); + } else { + customToolBarButton.setJSImpl(JavaScriptActionPane.createDefault().updateBean()); + } + + } } }