Browse Source

CHART-3275 安装插件 图表类型不重启更新

final/10.0
zheng 6 years ago
parent
commit
8a00f5f321
  1. 26
      designer-chart/src/main/java/com/fr/design/ChartTypeInterfaceManager.java
  2. 7
      designer-form/src/main/java/com/fr/design/mainframe/FormParaWidgetPane.java

26
designer-chart/src/main/java/com/fr/design/ChartTypeInterfaceManager.java

@ -37,7 +37,9 @@ import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.design.mainframe.chart.gui.data.report.AbstractReportDataContentPane;
import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane;
import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane;
import com.fr.design.module.DesignModuleFactory;
import com.fr.form.ui.ChartEditor;
import com.fr.general.GeneralContext;
import com.fr.general.IOUtils;
import com.fr.plugin.chart.PiePlot4VanChart;
import com.fr.plugin.chart.area.VanChartAreaPlot;
@ -57,8 +59,13 @@ import com.fr.plugin.chart.scatter.VanChartScatterPlot;
import com.fr.plugin.chart.structure.VanChartStructurePlot;
import com.fr.plugin.chart.treemap.VanChartTreeMapPlot;
import com.fr.plugin.chart.wordcloud.VanChartWordCloudPlot;
import com.fr.plugin.context.PluginContext;
import com.fr.plugin.injectable.PluginModule;
import com.fr.plugin.injectable.PluginSingleInjection;
import com.fr.plugin.injectable.SpecialLevel;
import com.fr.plugin.manage.PluginFilter;
import com.fr.plugin.observer.PluginEvent;
import com.fr.plugin.observer.PluginEventListener;
import com.fr.plugin.solution.closeable.CloseableContainedMap;
import com.fr.stable.ArrayUtils;
import com.fr.stable.AssistUtils;
@ -119,6 +126,25 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr
readDefault();
readVanChart();
PluginModule.registerAgent(PluginModule.ExtraChartDesign, classManager);
GeneralContext.listenPluginRunningChanged(new PluginEventListener() {
@Override
public void on(PluginEvent event) {
synchronized (ChartTypeInterfaceManager.class) {
//因为是CloseableContainedMap,所以不能在mount那边处理。
DesignModuleFactory.registerExtraWidgetOptions(ChartTypeInterfaceManager.initWidgetOption());
}
}
}, new PluginFilter() {
@Override
public boolean accept(PluginContext context) {
return context.contain(PluginModule.ExtraChartDesign, SpecialLevel.IndependentChartUIProvider.getTagName());
}
});
}
public static WidgetOption[] initWidgetOption() {

7
designer-form/src/main/java/com/fr/design/mainframe/FormParaWidgetPane.java

@ -22,9 +22,9 @@ import com.fr.form.ui.WidgetConfig;
import com.fr.form.ui.WidgetInfoConfig;
import com.fr.general.ComparatorUtils;
import com.fr.general.GeneralContext;
import com.fr.plugin.context.PluginContext;
import com.fr.plugin.injectable.PluginModule;
import com.fr.plugin.injectable.SpecialLevel;
import com.fr.plugin.manage.PluginFilter;
import com.fr.plugin.observer.PluginEvent;
import com.fr.plugin.observer.PluginEventListener;
@ -47,6 +47,8 @@ import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import static com.fr.plugin.injectable.SpecialLevel.IndependentChartUIProvider;
/**
* @author null
*/
@ -98,7 +100,8 @@ public class FormParaWidgetPane extends JPanel {
@Override
public boolean accept(PluginContext context) {
return context.contain(PluginModule.ExtraDesign, FormWidgetOptionProvider.XML_TAG);
return context.contain(PluginModule.ExtraDesign, FormWidgetOptionProvider.XML_TAG)
|| context.contain(PluginModule.ExtraChartDesign, SpecialLevel.IndependentChartUIProvider.getTagName());
}
});
}

Loading…
Cancel
Save