From 3b59e40059f17061ad59073449c4f03ba79c6afb Mon Sep 17 00:00:00 2001 From: fr_shine Date: Thu, 28 Jul 2016 11:21:00 +0800 Subject: [PATCH 1/2] read plugin --- .../com/fr/design/ChartTypeInterfaceManager.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java b/designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java index 500ece8b45..d6facd7310 100644 --- a/designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java +++ b/designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java @@ -58,13 +58,12 @@ public class ChartTypeInterfaceManager extends XMLFileManager implements ExtraCh if (classManager == null) { classManager = new ChartTypeInterfaceManager(); chartTypeInterfaces.clear(); - classManager.readXMLFile(); } return classManager; } static { - GeneralContext.addEnvChangedListener(new EnvChangedListener() { + GeneralContext.addSwitchEnvListener(new EnvChangedListener() { public void envChanged() { ChartTypeInterfaceManager.envChanged(); } @@ -85,6 +84,8 @@ public class ChartTypeInterfaceManager extends XMLFileManager implements ExtraCh } public static WidgetOption[] initWidgetOption(){ + checkDefault(); + ChartInternationalNameContentBean[] typeName = ChartTypeManager.getInstance().getAllChartBaseNames(); ChartWidgetOption[] child = new ChartWidgetOption[typeName.length]; for (int i = 0; i < typeName.length; i++) { @@ -132,6 +133,11 @@ public class ChartTypeInterfaceManager extends XMLFileManager implements ExtraCh } } + private static void checkDefault() { + if(chartTypeInterfaces.size() == 0){ + readDefault(); + } + } /** * 增加界面接口定义 * @@ -141,7 +147,7 @@ public class ChartTypeInterfaceManager extends XMLFileManager implements ExtraCh public void addChartInterface(String className, String plotID, PluginSimplify simplify) { if (StringUtils.isNotBlank(className)) { try { - Class clazz = loader.loadClass(className); + Class clazz = Class.forName(className); Authorize authorize = clazz.getAnnotation(Authorize.class); if (authorize != null) { PluginLicenseManager.getInstance().registerPaid(authorize, simplify); @@ -171,6 +177,7 @@ public class ChartTypeInterfaceManager extends XMLFileManager implements ExtraCh * @param paneList pane容器 */ public void addPlotTypePaneList(List> paneList) { + checkDefault(); Iterator iterator = chartTypeInterfaces.entrySet().iterator(); while (iterator.hasNext()) { From d57ab06309f99175a6cdd0589b7d1980e3b953ce Mon Sep 17 00:00:00 2001 From: fr_shine Date: Thu, 28 Jul 2016 14:15:18 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=95=B4=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/design/ChartTypeInterfaceManager.java | 7 ------- 1 file changed, 7 deletions(-) diff --git a/designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java b/designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java index d6facd7310..08875b22fe 100644 --- a/designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java +++ b/designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java @@ -84,7 +84,6 @@ public class ChartTypeInterfaceManager extends XMLFileManager implements ExtraCh } public static WidgetOption[] initWidgetOption(){ - checkDefault(); ChartInternationalNameContentBean[] typeName = ChartTypeManager.getInstance().getAllChartBaseNames(); ChartWidgetOption[] child = new ChartWidgetOption[typeName.length]; @@ -133,11 +132,6 @@ public class ChartTypeInterfaceManager extends XMLFileManager implements ExtraCh } } - private static void checkDefault() { - if(chartTypeInterfaces.size() == 0){ - readDefault(); - } - } /** * 增加界面接口定义 * @@ -177,7 +171,6 @@ public class ChartTypeInterfaceManager extends XMLFileManager implements ExtraCh * @param paneList pane容器 */ public void addPlotTypePaneList(List> paneList) { - checkDefault(); Iterator iterator = chartTypeInterfaces.entrySet().iterator(); while (iterator.hasNext()) {