From 84b4e34cf19a99ed4d7f70a49c68588d9bbaaf59 Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Thu, 7 Nov 2024 11:30:00 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-138249=20cpt=E6=94=AF=E6=8C=81=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E9=9B=86=E6=9B=BF=E6=8D=A2=20=E8=A1=A5=E5=85=85?= =?UTF-8?q?=E5=8F=B3=E9=94=AE=E8=8F=9C=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data/datapane/TableDataTreePane.java | 29 ++++++++++++++----- 1 file changed, 21 insertions(+), 8 deletions(-) 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 4bf7cb6fdb..6626905c1f 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 @@ -179,14 +179,7 @@ public class TableDataTreePane extends BasicTableDataTreePane { ToolTipManager.sharedInstance().setDismissDelay(3000); ToolTipManager.sharedInstance().setInitialDelay(0); // 右键菜单 - popupMenu = new UIPopupMenu(); - popupMenu.add(editAction.createMenuItem()); - popupMenu.add(previewTableDataAction.createMenuItem()); - popupMenu.addSeparator(); - popupMenu.add(copyAction.createMenuItem()); - popupMenu.add(pasteAction.createMenuItem()); - popupMenu.add(removeAction.createMenuItem()); - popupMenu.addSeparator(); + initPopupMenu(); // 监听 tableDataTree.addMouseListener(new MouseAdapter() { @Override @@ -224,6 +217,25 @@ public class TableDataTreePane extends BasicTableDataTreePane { new TableDataTreeDragSource(tableDataTree, DnDConstants.ACTION_COPY); } + private void initPopupMenu() { + popupMenu = new UIPopupMenu(); + popupMenu.add(editAction.createMenuItem()); + popupMenu.add(previewTableDataAction.createMenuItem()); + popupMenu.addSeparator(); + popupMenu.add(copyAction.createMenuItem()); + popupMenu.add(pasteAction.createMenuItem()); + popupMenu.add(removeAction.createMenuItem()); + popupMenu.addSeparator(); + for (AbstractExtraAction action : extraActions) { + try { + popupMenu.add(action.createMenuItem()); + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } + + } + } + /** * 工具栏面板 * @@ -368,6 +380,7 @@ public class TableDataTreePane extends BasicTableDataTreePane { createAddMenuDef(); createToolbarDef(); toolbarDef.updateToolBar(toolbarPane.getToolbar()); + initPopupMenu(); checkEnable(); } }, new PluginFilter() {