From 0551a2c472be63298f2a59955057ff73e248d1af Mon Sep 17 00:00:00 2001 From: rinoux Date: Mon, 19 Apr 2021 16:44:41 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-51163=20=E6=8F=92=E4=BB=B6=E7=9B=91?= =?UTF-8?q?=E5=90=AC=E7=9A=84=E4=BB=A3=E7=A0=81=E4=B8=A2=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data/datapane/TableDataTreePane.java | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/TableDataTreePane.java b/designer-base/src/main/java/com/fr/design/data/datapane/TableDataTreePane.java index 863daba21a..f64fb21c1e 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/TableDataTreePane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/TableDataTreePane.java @@ -44,9 +44,15 @@ import com.fr.esd.event.DsNameTarget; import com.fr.esd.event.StrategyEventsNotifier; import com.fr.esd.query.StrategicTableData; import com.fr.general.ComparatorUtils; +import com.fr.general.GeneralContext; import com.fr.general.IOUtils; import com.fr.general.NameObject; import com.fr.log.FineLoggerFactory; +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.stable.core.PropertyChangeAdapter; import org.jetbrains.annotations.NotNull; @@ -120,6 +126,8 @@ public class TableDataTreePane extends BasicTableDataTreePane { addMenuDef = new MenuDef(Toolkit.i18nText("Fine-Design_Basic_Action_Add")); addMenuDef.setIconPath(IconPathConstants.ADD_POPMENU_ICON_PATH); createAddMenuDef(); + // 创建插件监听 + createPluginListener(); editAction = new EditAction(); removeAction = new RemoveAction(); @@ -165,6 +173,26 @@ public class TableDataTreePane extends BasicTableDataTreePane { checkButtonEnabled(); } + private void createPluginListener() { + //菜单栏监听 + GeneralContext.listenPluginRunningChanged(new PluginEventListener(PLUGIN_LISTENER_PRIORITY) { + + @Override + public void on(PluginEvent event) { + + addMenuDef.clearShortCuts(); + createAddMenuDef(); + } + }, new PluginFilter() { + + @Override + public boolean accept(PluginContext context) { + + return context.contain(PluginModule.ExtraDesign); + } + }); + } + /** * 刷新 */