From f8c8c6da9957d31263a7897adab4b0420f81c79c Mon Sep 17 00:00:00 2001 From: juhaoyu <2335173323@qq.com> Date: Wed, 21 Jun 2017 09:05:59 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=88=B7=E6=96=B0=E6=8E=A7=E4=BB=B6?= =?UTF-8?q?=E6=A0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/mainframe/FormParaPane.java | 38 +++++++++++++++++-- 1 file changed, 34 insertions(+), 4 deletions(-) diff --git a/designer_form/src/com/fr/design/mainframe/FormParaPane.java b/designer_form/src/com/fr/design/mainframe/FormParaPane.java index ddf5794c8c..9fab17cfd0 100644 --- a/designer_form/src/com/fr/design/mainframe/FormParaPane.java +++ b/designer_form/src/com/fr/design/mainframe/FormParaPane.java @@ -1,16 +1,23 @@ package com.fr.design.mainframe; -import com.fr.design.constants.UIConstants; import com.fr.design.ExtraDesignClassManager; +import com.fr.design.constants.UIConstants; +import com.fr.design.designer.creator.XCreatorUtils; +import com.fr.design.fun.CellWidgetOptionProvider; import com.fr.design.gui.core.UserDefinedWidgetOption; import com.fr.design.gui.core.WidgetOption; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ilable.UILabel; -import com.fr.design.designer.creator.XCreatorUtils; +import com.fr.design.utils.gui.LayoutUtils; import com.fr.form.ui.*; +import com.fr.general.GeneralContext; import com.fr.general.Inter; +import com.fr.plugin.context.PluginContext; +import com.fr.plugin.injectable.PluginModule; +import com.fr.plugin.manage.PluginFilter; +import com.fr.plugin.observer.PluginEvent; +import com.fr.plugin.observer.PluginEventListener; import com.fr.stable.ArrayUtils; -import com.fr.design.utils.gui.LayoutUtils; import javax.swing.*; import java.awt.*; @@ -41,7 +48,30 @@ public class FormParaPane extends JPanel { private FormDesigner designer; - + + static { + listenPluginChange(); + } + + private static void listenPluginChange() { + + GeneralContext.listenPluginRunningChanged(new PluginEventListener() { + + @Override + public void on(PluginEvent event) { + + THIS = null; + } + }, new PluginFilter() { + + @Override + public boolean accept(PluginContext context) { + + return context.contain(PluginModule.ExtraDesign, CellWidgetOptionProvider.XML_TAG); + } + }); + } + public static final FormParaPane getInstance(FormDesigner designer) { if(THIS == null) { THIS = new FormParaPane(); From 36803bfc79a143a1dd184d91a2dfa3c09af3742f Mon Sep 17 00:00:00 2001 From: juhaoyu <2335173323@qq.com> Date: Wed, 21 Jun 2017 09:10:42 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E5=88=B7=E6=96=B0=E6=8E=A7=E4=BB=B6?= =?UTF-8?q?=E6=A0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer_form/src/com/fr/design/mainframe/FormParaPane.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/designer_form/src/com/fr/design/mainframe/FormParaPane.java b/designer_form/src/com/fr/design/mainframe/FormParaPane.java index 9fab17cfd0..0c25b08c83 100644 --- a/designer_form/src/com/fr/design/mainframe/FormParaPane.java +++ b/designer_form/src/com/fr/design/mainframe/FormParaPane.java @@ -41,7 +41,8 @@ public class FormParaPane extends JPanel { private static final int TOOLTIP_X = 5; private static final int TOOLTIP_Y = 10; private static Dimension originalSize; - private static FormParaPane THIS; + + private static volatile FormParaPane THIS; private java.util.List predifinedwidgeList = new ArrayList(); private UIButton predefineButton; private FormWidgetPopWindow predifinedWindow; From 599f725a51766b62d2d394a48b1b2271d9d3a171 Mon Sep 17 00:00:00 2001 From: juhaoyu <2335173323@qq.com> Date: Wed, 21 Jun 2017 09:11:14 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E5=88=B7=E6=96=B0=E6=8E=A7=E4=BB=B6?= =?UTF-8?q?=E6=A0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/design/mainframe/FormParaPane.java | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/designer_form/src/com/fr/design/mainframe/FormParaPane.java b/designer_form/src/com/fr/design/mainframe/FormParaPane.java index 0c25b08c83..732d5632ec 100644 --- a/designer_form/src/com/fr/design/mainframe/FormParaPane.java +++ b/designer_form/src/com/fr/design/mainframe/FormParaPane.java @@ -51,23 +51,18 @@ public class FormParaPane extends JPanel { private FormDesigner designer; static { - listenPluginChange(); - } - - private static void listenPluginChange() { - GeneralContext.listenPluginRunningChanged(new PluginEventListener() { - + @Override public void on(PluginEvent event) { - + THIS = null; } }, new PluginFilter() { - + @Override public boolean accept(PluginContext context) { - + return context.contain(PluginModule.ExtraDesign, CellWidgetOptionProvider.XML_TAG); } });