I'm a newbie to module development and trying to add a new feature to the tag browser context menu. I was able to add a new menu item to the tag browser context menu, but how do I get which tag(s) was selected when the action event is invoked? The ActionEvent does not contain this info and I'm having a hard time finding anything in the API that would give me this info. Below is the code from my designer hook.
private DesignerContext context;
private String projectName;
@Override
public void startup(DesignerContext context, LicenseState activationState) throws Exception {
// implelement functionality as required
this.context = context;
this.projectName = context.getProjectName();
addMenuItemToTagBrowser();
}
private void addMenuItemToTagBrowser() {
JMenuItem menuItem = new JMenuItem("Add to View");
menuItem.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
menuItem.setText("Pressed!");
}
});
TagBrowserFrame tagBrowserFrame = context.getTagBrowser();
tagBrowserFrame.addTagPopupMenuComponent(menuItem, 0);
}