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 83aeaefe3d..574195470b 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 796b983f84..38efb4c1fc 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);