Browse Source

代码质量:每个实例各自监听插件事件

zheng-1641779399395
shine 3 years ago
parent
commit
9ecac9978a
  1. 10
      designer-chart/src/main/java/com/fr/design/mainframe/ChartPropertyPane.java

10
designer-chart/src/main/java/com/fr/design/mainframe/ChartPropertyPane.java

@ -49,8 +49,6 @@ public class ChartPropertyPane extends BaseChartPropertyPane {
//ID一样的话 不用新建chartEditPane
private String currentID;
private static PluginEventListener pluginEventListener;
private ChartPropertyPane() {
initComponent();
addListener();
@ -62,17 +60,13 @@ public class ChartPropertyPane extends BaseChartPropertyPane {
}
private void addListener() {
if (pluginEventListener != null) {
GeneralContext.stopListenPlugin(pluginEventListener);
}
pluginEventListener = new PluginEventListener() {
GeneralContext.listenPlugin(PluginEventType.AfterRun, new PluginEventListener() {
@Override
public void on(PluginEvent event) {
//禁用启用图表插件 这边id置空。这样展示图表配置属性不管和上一个id是否一样 都新建chartEditPane
currentID = null;
}
};
GeneralContext.listenPlugin(PluginEventType.AfterRun, pluginEventListener, new PluginFilter() {
}, new PluginFilter() {
@Override
public boolean accept(PluginContext context) {

Loading…
Cancel
Save