}
return JTabbedContentPane.this;
}
protected void showPopupMenu(final MouseEvent mouseEvent) {
final Content contentAt = getContentAt(mouseOverTab);
JPopupMenu popupMenu = contentAt.getPopupMenu();
if (popupMenu == null)
popupMenu = getComponentPopupMenu();
if (popupMenu == null) {
// Init stdPopupMenu
stdPopupMenu = new JPopupMenu("Content Page Popup");
stdPopupMenu.add(new JMenuItem(new AbstractAction(resourceManager.getString("@@tabbed.page.close")) {
public void actionPerformed(ActionEvent e) {
JTabbedContentPane.this.fireCloseTabEvent(contentAt);
}
})).setEnabled(contentAt.getContentUI().isCloseable());
stdPopupMenu.add(new JMenuItem(new AbstractAction(resourceManager.getString("@@tabbed.page.closeAll")) {
public void actionPerformed(ActionEvent e) {
for (Content content : toolWindowManager.getContentManager().getContents()) {
if (content.getContentUI().isCloseable())
JTabbedContentPane.this.fireCloseTabEvent(content);
}
}
}));
stdPopupMenu.add(new JMenuItem(new AbstractAction(resourceManager.getString("@@tabbed.page.closeAllButThis")) {
public void actionPerformed(ActionEvent e) {
for (Content content : toolWindowManager.getContentManager().getContents()) {
if (content != contentAt && content.getContentUI().isCloseable())
JTabbedContentPane.this.fireCloseTabEvent(content);
}
}
}));
stdPopupMenu.addSeparator();
stdPopupMenu.add(new JMenuItem(new AbstractAction(resourceManager.getString("@@tabbed.page.detach")) {
public void actionPerformed(ActionEvent e) {
JTabbedContentPane.this.fireDetachTabEvent(contentAt);
}
})).setEnabled(contentAt.getContentUI().isDetachable());
MaximizeAction maximizeAction = new MaximizeAction(contentAt);
stdPopupMenu.add(maximizeAction);
maximizeAction.putValue(Action.NAME, contentAt.isMaximized() || isAContentMaximized() ?
resourceManager.getString("@@tabbed.page.restore") :
resourceManager.getString("@@tabbed.page.maximize")
);
popupMenu = stdPopupMenu;
}