final JsArray<JSPanelDefinition> panels ) {
if ( panels != null ) {
for ( int i = 0; i < panels.length(); i++ ) {
final JSPanelDefinition activePanelDef = panels.get( i );
final PanelDefinition newPanel = new PanelDefinitionImpl( getPanelType( activePanelDef.getPanelTypeAsString(), PanelType.MULTI_TAB ) );
newPanel.setContextDisplayMode( JSNativePerspective.this.getContextDisplayMode( activePanelDef.getContextDisplayModeAsString(), ContextDisplayMode.SHOW ) );
if ( activePanelDef.getContextId() != null ) {
newPanel.setContextDefinition( new ContextDefinitionImpl( new DefaultPlaceRequest( activePanelDef.getContextId() ) ) );
}
if ( activePanelDef.getWidth() > 0 ) {
newPanel.setWidth( activePanelDef.getWidth() );
}
if ( activePanelDef.getMinWidth() > 0 ) {
newPanel.setMinWidth( activePanelDef.getMinWidth() );
}
if ( activePanelDef.getHeight() > 0 ) {
newPanel.setHeight( activePanelDef.getHeight() );
}
if ( activePanelDef.getMinHeight() > 0 ) {
newPanel.setHeight( activePanelDef.getMinHeight() );
}
buildParts( newPanel, activePanelDef.getParts() );
buildPanels( newPanel, activePanelDef.getChildren() );