From fe0226e1bc7a8d61c9bfe402a5537f301d7e968c Mon Sep 17 00:00:00 2001 From: lucian Date: Wed, 18 Mar 2020 18:16:40 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-27608=20=E5=A4=9A=E7=83=AD=E7=82=B9?= =?UTF-8?q?=E5=9B=BE=E7=89=87=E6=8F=92=E4=BB=B6=E6=97=A0=E6=B3=95=E7=83=AD?= =?UTF-8?q?=E5=8A=A0=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/actions/core/ActionFactory.java | 14 ++++++++++++ .../fr/start/module/DesignerActivator.java | 22 +++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/designer-base/src/main/java/com/fr/design/actions/core/ActionFactory.java b/designer-base/src/main/java/com/fr/design/actions/core/ActionFactory.java index 83aeaefe3..574195470 100644 --- a/designer-base/src/main/java/com/fr/design/actions/core/ActionFactory.java +++ b/designer-base/src/main/java/com/fr/design/actions/core/ActionFactory.java @@ -260,6 +260,13 @@ public class ActionFactory { } } + public static void referCellInsertActionClass(Class[] cls) { + if (cls != null) { + actionClasses.clear(); + Collections.addAll(actionClasses, cls); + } + } + /** * 生成单元格插入相关的Action * 表单中报表块编辑需要屏蔽掉"插入子报表" @@ -318,6 +325,13 @@ public class ActionFactory { } } + public static void referFloatInsertActionClass(Class[] cls) { + if (cls != null) { + floatActionClasses.clear(); + Collections.addAll(floatActionClasses, cls); + } + } + /** * 生成悬浮元素插入相关的Action * diff --git a/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java b/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java index 796b983f8..38efb4c1f 100644 --- a/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java +++ b/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java @@ -63,6 +63,7 @@ import com.fr.design.update.actions.RecoverForDesigner; import com.fr.design.update.push.DesignerPushUpdateManager; import com.fr.design.widget.ui.btn.FormSubmitButtonDetailPane; import com.fr.form.stable.ElementCaseThumbnailProcessor; +import com.fr.general.GeneralContext; import com.fr.general.xml.GeneralXMLTools; import com.fr.js.EmailJavaScript; import com.fr.js.JavaScriptImpl; @@ -75,6 +76,11 @@ import com.fr.locale.LocaleScope; import com.fr.log.FineLoggerFactory; import com.fr.log.LogHandler; import com.fr.module.Activator; +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.quickeditor.cellquick.CellBiasTextPainterEditor; import com.fr.quickeditor.cellquick.CellDSColumnEditor; import com.fr.quickeditor.cellquick.CellFormulaQuickEditor; @@ -181,6 +187,7 @@ public class DesignerActivator extends Activator { ActionFactory.registerFloatInsertActionClass(actionsForInsertFloatElement()); DesignModuleFactory.registerCreators4Hyperlink(hyperlinkTypes()); + createPluginListener(); justStartModules4Designer(); CalculatorProviderContext.setValueConverter(valueConverter()); @@ -193,6 +200,21 @@ public class DesignerActivator extends Activator { InformationCollector.getInstance().collectStartTime(); } + private void createPluginListener() { + GeneralContext.listenPluginRunningChanged(new PluginEventListener() { + @Override + public void on(PluginEvent event) { + ActionFactory.referCellInsertActionClass(actionsForInsertCellElement()); + ActionFactory.referFloatInsertActionClass(actionsForInsertFloatElement()); + } + }, new PluginFilter() { + @Override + public boolean accept(PluginContext context) { + return context.contain(PluginModule.ExtraDesign, ElementUIProvider.MARK_STRING); + } + }); + } + private static Class[] actionsForInsertCellElement() { List> classes = new ArrayList<>(); Set providers = ExtraDesignClassManager.getInstance().getArray(ElementUIProvider.MARK_STRING);