break;
}
}
}
IFrameTabPanel panel = null;
if ( freeFrames.size() > 0 ) {
panel = freeFrames.iterator().next();
panel.setName( frameName );
// mark as no longer free by removing from set
freeFrames.remove( panel );
} else {
panel = new IFrameTabPanel( frameName );
}
addTab( tabName, tabTooltip, true, panel );
selectTab( elementId );
// plugins will define their background color, if any
// all other content is expected, for backwards compatibility to
// be set on a white background (default for web browsers)
// I have defined a CSS class for this background if someone
// wants to change or remove the color
if ( url.indexOf( "/content" ) > -1 || url.indexOf( "/generatedContent" ) > -1 ) {
panel.getElement().addClassName( "mantle-white-tab-background" ); // white background
} else {
panel.getElement().addClassName( "mantle-default-tab-background" ); // transparent background
}
final ArrayList<com.google.gwt.dom.client.Element> parentList = new ArrayList<com.google.gwt.dom.client.Element>();
com.google.gwt.dom.client.Element parent = panel.getFrame().getElement();
while ( parent != getElement() ) {
parentList.add( parent );
parent = parent.getParentElement();
}
Collections.reverse( parentList );
for ( int i = 1; i < parentList.size(); i++ ) {
parentList.get( i ).getStyle().setProperty( "height", "100%" ); //$NON-NLS-1$ //$NON-NLS-2$
}
Widget selectTabContent = null;
if ( getTab( getSelectedTabIndex() ) != null ) {
selectTabContent = getTab( getSelectedTabIndex() ).getContent();
}
List<FileItem> selectedItems = SolutionBrowserPanel.getInstance().getFilesListPanel().getSelectedFileItems();
EventBusUtil.EVENT_BUS.fireEvent( new SolutionBrowserOpenEvent( selectTabContent, selectedItems ) );
// if showContent is the thing that turns on our first tab, which is entirely possible, then we
// would encounter the same timing issue as before
panel.setUrl( url );
EventBusUtil.EVENT_BUS.fireEvent( new SolutionBrowserSelectEvent( selectTabContent, selectedItems ) );
if ( setFileInfoInFrame && SolutionBrowserPanel.getInstance().getFilesListPanel()
.getSelectedFileItems().size() > 0 ) {