}
return TabbedContentPane.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");
if (contentAt.getContentUI().isCloseable()) {
stdPopupMenu.add(new JMenuItem(new AbstractAction(SwingUtil.getString("@@tabbed.page.close")) {
public void actionPerformed(ActionEvent e) {
TabbedContentPane.this.fireCloseTabEvent(contentAt);
}
}));
}
stdPopupMenu.add(new JMenuItem(new AbstractAction(SwingUtil.getString("@@tabbed.page.closeAll")) {
public void actionPerformed(ActionEvent e) {
for (Content content : toolWindowManager.getContentManager().getContents()) {
if (content.getContentUI().isCloseable())
TabbedContentPane.this.fireCloseTabEvent(content);
}
}
}));
stdPopupMenu.add(new JMenuItem(new AbstractAction(SwingUtil.getString("@@tabbed.page.closeAllButThis")) {
public void actionPerformed(ActionEvent e) {
for (Content content : toolWindowManager.getContentManager().getContents()) {
if (content != contentAt && content.getContentUI().isCloseable())
TabbedContentPane.this.fireCloseTabEvent(content);
}
}
}));
boolean restore = false;
if (contentAt.getContentUI().isDetachable() && showDetach) {
stdPopupMenu.addSeparator();
stdPopupMenu.add(new JMenuItem(new AbstractAction(SwingUtil.getString("@@tabbed.page.detach")) {
public void actionPerformed(ActionEvent e) {
TabbedContentPane.this.fireDetachTabEvent(contentAt);
}
}));
}
if (contentAt.getContentUI().isMaximizable() && showMaximize) {
MaximizeAction maximizeAction = new MaximizeAction(contentAt);
restore = contentAt.isMaximized() || isAContentMaximized();
maximizeAction.putValue(Action.NAME, restore ?
SwingUtil.getString("@@tabbed.page.restore") :
SwingUtil.getString("@@tabbed.page.maximize")
);
stdPopupMenu.add(maximizeAction);
}
if (!restore && contentAt.getContentUI().isMinimizable() && showMinimize) {
stdPopupMenu.add(new MinimizeAction(contentAt));
}
popupMenu = stdPopupMenu;
}