protected void initComponents() {
detachedContentUIMap = new Hashtable<Content, TabbedContentUI>();
final JTabbedContentManager tabbedContentManager = new JTabbedContentManager();
tabbedContentManager.addTabListener(new TabListener() {
public void tabEventFired(TabEvent event) {
Content content = contentManager.getContentByComponent(event.getContentManager().getComponentAt(event.getOverTabIndex()));
switch (event.getActionId()) {
case ON_CLOSE:
try {
fireContentUIRemoving(getContentUI(content));
contentManager.removeContent(content);
} catch (Exception ignore) {
}
break;
case ON_DETACH:
content.setDetached(true);
fireContentUIDetached(getContentUI(content));
break;
}
}
});
tabbedContentManager.addChangeListener(new ChangeListener() {
public void stateChanged(ChangeEvent e) {
if (!valueAdjusting && !contentValueAdjusting) {
Component selectedComponent = tabbedContentManager.getSelectedComponent();
if (selectedComponent == null)
return;
BackContentUI newSelected = (BackContentUI) contentManager.getContentByComponent(selectedComponent);
if (newSelected == lastSelected)