diff --git a/designer_base/src/com/fr/design/mainframe/DesignerFrame.java b/designer_base/src/com/fr/design/mainframe/DesignerFrame.java index 737fdcab27..61113b593b 100644 --- a/designer_base/src/com/fr/design/mainframe/DesignerFrame.java +++ b/designer_base/src/com/fr/design/mainframe/DesignerFrame.java @@ -182,8 +182,8 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta //hugh: private修改为protected方便oem的时候修改右上的组件构成 //顶部日志+登陆按钮 final JPanel northEastPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); - - GeneralContext.listenPluginRunningChanged(new PluginEventListener() { + //优先级为-1,保证最后全面刷新一次 + GeneralContext.listenPluginRunningChanged(new PluginEventListener(-1) { @Override public void on(PluginEvent event) { diff --git a/designer_form/src/com/fr/design/mainframe/FormParaPane.java b/designer_form/src/com/fr/design/mainframe/FormParaPane.java index 755deec3b0..d3f0fa0cbb 100644 --- a/designer_form/src/com/fr/design/mainframe/FormParaPane.java +++ b/designer_form/src/com/fr/design/mainframe/FormParaPane.java @@ -9,7 +9,13 @@ import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ilable.UILabel; 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 javax.swing.*; @@ -43,6 +49,24 @@ public class FormParaPane extends JPanel { private FormDesigner designer; + static { + 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); + } + }); + } + public static final FormParaPane getInstance(FormDesigner designer) { if(THIS == null) { THIS = new FormParaPane(); diff --git a/designer_form/src/com/fr/design/mainframe/FormParaWidgetPane.java b/designer_form/src/com/fr/design/mainframe/FormParaWidgetPane.java index 4ae8e01bd5..a5b39ae886 100644 --- a/designer_form/src/com/fr/design/mainframe/FormParaWidgetPane.java +++ b/designer_form/src/com/fr/design/mainframe/FormParaWidgetPane.java @@ -5,6 +5,7 @@ import com.fr.design.ExtraDesignClassManager; import com.fr.design.designer.beans.events.DesignerEditListener; import com.fr.design.designer.beans.events.DesignerEvent; import com.fr.design.designer.creator.XCreatorUtils; +import com.fr.design.fun.FormWidgetOptionProvider; import com.fr.design.gui.core.FormWidgetOption; import com.fr.design.gui.core.UserDefinedWidgetOption; import com.fr.design.gui.core.WidgetOption; @@ -16,12 +17,21 @@ import com.fr.design.module.DesignModuleFactory; import com.fr.design.utils.gui.LayoutUtils; import com.fr.form.ui.*; import com.fr.general.ComparatorUtils; +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 javax.swing.*; import java.awt.*; -import java.awt.event.*; +import java.awt.event.ComponentAdapter; +import java.awt.event.ComponentEvent; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; import java.util.ArrayList; import java.util.Iterator; import java.util.List; @@ -58,6 +68,26 @@ public class FormParaWidgetPane extends JPanel { private FormDesigner designer; + static { + GeneralContext.listenPluginRunningChanged(new PluginEventListener() { + + @Override + public void on(PluginEvent event) { + + synchronized (FormParaWidgetPane.class) { + THIS = null; + } + } + }, new PluginFilter() { + + @Override + public boolean accept(PluginContext context) { + + return context.contain(PluginModule.ExtraDesign, FormWidgetOptionProvider.XML_TAG); + } + }); + } + public static synchronized final FormParaWidgetPane getInstance(FormDesigner designer) { if (THIS == null) { THIS = new FormParaWidgetPane(); @@ -254,8 +284,8 @@ public class FormParaWidgetPane extends JPanel { public void mouseClicked(MouseEvent e) { initChartTypePopUp(); chartTypePopupMenu.show(FormParaWidgetPane.this, - (int) jSeparatorLayout.getLocation().getX() + BORDER, - (int) jSeparatorLayout.getLocation().getY()); + (int) jSeparatorChart.getLocation().getX() + BORDER, + (int) jSeparatorChart.getLocation().getY()); } }); labelPane.add(chartPopUpButton, BorderLayout.EAST); @@ -274,8 +304,8 @@ public class FormParaWidgetPane extends JPanel { public void mouseClicked(MouseEvent e) { initWidgetTypePopUp(); widgetTypePopupMenu.show(FormParaWidgetPane.this, - (int) jSeparatorChart.getLocation().getX() + BORDER, - (int) jSeparatorChart.getLocation().getY()); + (int) jSeparatorLayout.getLocation().getX() + BORDER, + (int) jSeparatorLayout.getLocation().getY()); } });