From a0204bc2f6def38b971fba17811d5fa360d3a5bc Mon Sep 17 00:00:00 2001 From: Hades Date: Mon, 5 Aug 2019 11:15:02 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-18720=20=20=E6=A8=A1=E6=9D=BFweb?= =?UTF-8?q?=E5=B1=9E=E6=80=A7=E9=87=8C=E9=9D=A2=E9=87=87=E7=94=A8=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1=E5=99=A8=E8=AE=BE=E7=BD=AE=E6=97=B6=20=E5=B7=A5?= =?UTF-8?q?=E5=85=B7=E6=A0=8F=E6=8C=89=E9=92=AE=E5=BA=94=E8=AF=A5=E6=98=AF?= =?UTF-8?q?=E5=A4=84=E4=BA=8E=E7=81=B0=E5=8C=96=E4=B8=94=E4=B8=8D=E5=8F=AF?= =?UTF-8?q?=E7=82=B9=E5=87=BB=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/webattr/ToolBarDragPane.java | 12 ++++++++++++ .../java/com/fr/design/webattr/WebSettingPane.java | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/design/webattr/ToolBarDragPane.java b/designer-realize/src/main/java/com/fr/design/webattr/ToolBarDragPane.java index c420c04b4d..9e4df08e84 100644 --- a/designer-realize/src/main/java/com/fr/design/webattr/ToolBarDragPane.java +++ b/designer-realize/src/main/java/com/fr/design/webattr/ToolBarDragPane.java @@ -9,6 +9,7 @@ import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.DesignerContext; import com.fr.design.utils.gui.GUICoreUtils; +import com.fr.form.ui.ToolBar; import com.fr.form.ui.Widget; import com.fr.report.web.Location; import com.fr.report.web.ToolBarManager; @@ -35,6 +36,7 @@ import java.awt.event.ActionListener; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.awt.image.ImageObserver; +import java.util.List; /** * 新的拖拽ToolBar button以实现自定义工具栏 报表web设置那儿的.应该不叫ToolBarDragPane,因为实际没有提供drag功能 @@ -225,6 +227,16 @@ public class ToolBarDragPane extends WidgetToolBarPane { public void setAllEnabled(boolean b) { GUICoreUtils.setEnabled(this, b); isEnabled = b; + removeAllListener(northToolBar.getToolBarButtons()); + } + + private void removeAllListener(List toolBarButtons) { + for (ToolBarButton button : toolBarButtons) { + button.setEnabled(isEnabled); + if (!isEnabled) { + button.removeMouseListener(button); + } + } } /** diff --git a/designer-realize/src/main/java/com/fr/design/webattr/WebSettingPane.java b/designer-realize/src/main/java/com/fr/design/webattr/WebSettingPane.java index ea8225ea07..59b0d2316e 100644 --- a/designer-realize/src/main/java/com/fr/design/webattr/WebSettingPane.java +++ b/designer-realize/src/main/java/com/fr/design/webattr/WebSettingPane.java @@ -122,8 +122,8 @@ public abstract class WebSettingPane extends BasicBeanPane choseComboBox.removeItemListener(itemListener); choseComboBox.setSelectedIndex(SERVER_SET); choseComboBox.addItemListener(itemListener); - checkEnabled(false); populateServerSettings(); + checkEnabled(false); return; } // 模板设置