if ( getTab( getSelectedTabIndex() ) != null ) {
selectTabContent = getTab( getSelectedTabIndex() ).getContent();
}
List<FileItem> selectedItems =
SolutionBrowserPanel.getInstance().getFilesListPanel().getSelectedFileItems();
EventBusUtil.EVENT_BUS.fireEvent( new SolutionBrowserCloseEvent( selectTabContent, selectedItems ) );
}
}
} );
confirmDialog.center();
return;
}
( (CustomFrame) ( (IFrameTabPanel) closeTab.getContent() ).getFrame() ).removeEventListeners( frameElement );
clearClosingFrame( frameElement );
}
super.closeTab( closeTab, invokePreTabCloseHook );
// since we can't entirely reclaim the frame resources held, keep some around
// so we can minimize the extra leakage caused by constantly created more
// let's only keep 5 of these guys around so at least some of the resources
// can be cleaned up (maybe just wishful thinking)
Widget w = closeTab.getContent();
if ( w instanceof IFrameTabPanel && freeFrames.size() < 5 ) {
// wipe out any file info so it doesn't impact future usages of this frame
SolutionFileInfo sfi = null;
IFrameTabPanel iFrameTabPanel = (IFrameTabPanel) w;
iFrameTabPanel.setFileInfo( sfi );
freeFrames.add( iFrameTabPanel );
}
if ( getTabCount() == 0 ) {
allTabsClosed();
Widget selectTabContent = null;
if ( getTab( getSelectedTabIndex() ) != null ) {
selectTabContent = getTab( getSelectedTabIndex() ).getContent();
}
List<FileItem> selectedItems = SolutionBrowserPanel.getInstance().getFilesListPanel().getSelectedFileItems();
EventBusUtil.EVENT_BUS.fireEvent( new SolutionBrowserCloseEvent( selectTabContent, selectedItems ) );
}
}