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() {