In the context of the CSV plugin, the scenario is as follow: I have an com.intellij.openapi.actionSystem.ActionGroup defined and registered for the context menu in the text-editor. Everything shows and works fine (first screenshot).
Additionally the CSV plugin comes with a table editor (custom swing component), which comes with an own custom context menu (JBPopupMenu) created by the table editor component itself (second screenshot).
Now I'd like to add the the very same ActionGroup and its functionality to this menu, which I currently struggle to do. I tried using the ActionManager.createActionPopupMenu/-.createActionToolbar/-.createButtonToolbar (http://www.jetbrains.org/intellij/sdk/docs/basics/action_system.html?search=action#building-ui-from-actions) without success. That's what I basically tried to do (with some variants and also using ActionToolbar/ButtonToolbar components):
ActionManager actionManager = ActionManager.getInstance();
CsvChangeSeparatorActionGroup csvChangeSeparatorActionGroup = (CsvChangeSeparatorActionGroup)actionManager.getAction(CsvChangeSeparatorActionGroup.class.getName());
ActionPopupMenu actionPopupMenu = actionManager.createActionPopupMenu("My Action Group", csvChangeSeparatorActionGroup);
I guess I need to provide some additional context information to the ActionGroup? How to add the ActionGroup to the `popupMenu` properly?