Browse Source

PFC-607 插件安装删除更新不重启支持

fix
master
juhaoyu 7 years ago
parent
commit
901dcbc37a
  1. 4
      designer_base/src/com/fr/design/mainframe/DesignerFrame.java
  2. 24
      designer_form/src/com/fr/design/mainframe/FormParaPane.java
  3. 40
      designer_form/src/com/fr/design/mainframe/FormParaWidgetPane.java

4
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) {

24
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();

40
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());
}
});

Loading…
Cancel
Save