WFContainer mainArea = (WFContainer) component.getChildren().get(0); mainArea.setStyleClass(mainAreaStyleClass);
try{ WFContainer mainArea = (WFContainer) children.get(0); if(mainArea!=null){ mainArea.setStyleClass(mainAreaStyleClass); } } catch(ClassCastException cce){  }
	public void encodeBegin(FacesContext context,UIComponent component) throws IOException {		WFBlock block = (WFBlock)component;		if (!component.isRendered()) {			return;		}		super.encodeBegin(context,component);		String mainAreaStyleClass = block.getMainAreaStyleClass();		if (mainAreaStyleClass != null) {			if(component.getChildren().size()>0){				WFContainer mainArea = (WFContainer) component.getChildren().get(0);				mainArea.setStyleClass(mainAreaStyleClass);			}		}		if (!block.isToolbarEmbeddedInTitlebar()) {			renderFacet(context, component,"toolbar");		}		renderFacet(context, component,"titlebar");	}