Browse Source

Merge pull request #978 in BA/design from ~JU/ba-9.0-design:9.0 to 9.0

* commit 'c11b7f1b7d76fa34394fc69800dcb31186035beb':
  PFC-607 插件安装删除更新不重启支持 fix
master
superman 7 years ago
parent
commit
18082f47d1
  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的时候修改右上的组件构成 //hugh: private修改为protected方便oem的时候修改右上的组件构成
//顶部日志+登陆按钮 //顶部日志+登陆按钮
final JPanel northEastPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); final JPanel northEastPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
//优先级为-1,保证最后全面刷新一次
GeneralContext.listenPluginRunningChanged(new PluginEventListener() { GeneralContext.listenPluginRunningChanged(new PluginEventListener(-1) {
@Override @Override
public void on(PluginEvent event) { 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.gui.ilable.UILabel;
import com.fr.design.utils.gui.LayoutUtils; import com.fr.design.utils.gui.LayoutUtils;
import com.fr.form.ui.*; import com.fr.form.ui.*;
import com.fr.general.GeneralContext;
import com.fr.general.Inter; 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.stable.ArrayUtils;
import javax.swing.*; import javax.swing.*;
@ -43,6 +49,24 @@ public class FormParaPane extends JPanel {
private FormDesigner designer; 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) { public static final FormParaPane getInstance(FormDesigner designer) {
if(THIS == null) { if(THIS == null) {
THIS = new FormParaPane(); 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.DesignerEditListener;
import com.fr.design.designer.beans.events.DesignerEvent; import com.fr.design.designer.beans.events.DesignerEvent;
import com.fr.design.designer.creator.XCreatorUtils; 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.FormWidgetOption;
import com.fr.design.gui.core.UserDefinedWidgetOption; import com.fr.design.gui.core.UserDefinedWidgetOption;
import com.fr.design.gui.core.WidgetOption; 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.design.utils.gui.LayoutUtils;
import com.fr.form.ui.*; import com.fr.form.ui.*;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.GeneralContext;
import com.fr.general.Inter; 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.stable.ArrayUtils;
import javax.swing.*; import javax.swing.*;
import java.awt.*; 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.ArrayList;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
@ -58,6 +68,26 @@ public class FormParaWidgetPane extends JPanel {
private FormDesigner designer; 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) { public static synchronized final FormParaWidgetPane getInstance(FormDesigner designer) {
if (THIS == null) { if (THIS == null) {
THIS = new FormParaWidgetPane(); THIS = new FormParaWidgetPane();
@ -254,8 +284,8 @@ public class FormParaWidgetPane extends JPanel {
public void mouseClicked(MouseEvent e) { public void mouseClicked(MouseEvent e) {
initChartTypePopUp(); initChartTypePopUp();
chartTypePopupMenu.show(FormParaWidgetPane.this, chartTypePopupMenu.show(FormParaWidgetPane.this,
(int) jSeparatorLayout.getLocation().getX() + BORDER, (int) jSeparatorChart.getLocation().getX() + BORDER,
(int) jSeparatorLayout.getLocation().getY()); (int) jSeparatorChart.getLocation().getY());
} }
}); });
labelPane.add(chartPopUpButton, BorderLayout.EAST); labelPane.add(chartPopUpButton, BorderLayout.EAST);
@ -274,8 +304,8 @@ public class FormParaWidgetPane extends JPanel {
public void mouseClicked(MouseEvent e) { public void mouseClicked(MouseEvent e) {
initWidgetTypePopUp(); initWidgetTypePopUp();
widgetTypePopupMenu.show(FormParaWidgetPane.this, widgetTypePopupMenu.show(FormParaWidgetPane.this,
(int) jSeparatorChart.getLocation().getX() + BORDER, (int) jSeparatorLayout.getLocation().getX() + BORDER,
(int) jSeparatorChart.getLocation().getY()); (int) jSeparatorLayout.getLocation().getY());
} }
}); });

Loading…
Cancel
Save