editor.getContentComponent().addMouseListener(new MouseAdapter() {
@Override
public void mouseReleased(MouseEvent e) {
if (e.isPopupTrigger()) {
// Single right click unless configured differently
ActionManager actionManager = ActionManager.getInstance();
DefaultActionGroup defaultActionGroup = (DefaultActionGroup) actionManager.getAction("org.intellij.plugins.junitgen.action.JUnitGeneratorEditorMenu");
ActionPopupMenu menu = actionManager.createActionPopupMenu("junitgenerator.editor.popup", defaultActionGroup);
menu.getComponent().show(e.getComponent(), e.getX(), e.getY());
}
}
});
this.velocityEditorMap.put(entry.getKey(), editor);