JMenu contentMenu = new JMenu("Content");
JMenuItem toolsContentItem = new JMenuItem("Tools");
toolsContentItem.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
ContentManager contentManager = toolWindowManager.getContentManager();
if (contentManager.getContent("Tools") == null)
contentManager.addContent("Tools", "Tools", null, toolsContent, "ToolWindows").setPopupMenu(toolsPopupMenu);
}
});
JMenuItem groupEditorContentItem = new JMenuItem("Groups");
groupEditorContentItem.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
ContentManager contentManager = toolWindowManager.getContentManager();
if (contentManager.getContent("Group Editor") == null)
contentManager.addContent("Group Editor", "Group Editor", null, groupEditorContent, "ToolWindowGroup").setPopupMenu(groupsPopupMenu);
}
});
JMenuItem contentsContentItem = new JMenuItem("Contents");
contentsContentItem.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
ContentManager contentManager = toolWindowManager.getContentManager();
if (contentManager.getContent("Contents") == null)
contentManager.addContent("Contents", "Contents", null, contentsContent, "Contents Editor");
}
});
contentMenu.add(toolsContentItem);
contentMenu.add(groupEditorContentItem);