private VLayout createErrorLayout ( ExceptionDto error ) { VLayout layout = new VLayout ( ) ; layout . setWidth100 ( ) ; layout . setHeight100 ( ) ; layout . setPadding ( WidgetLayout . marginLarge ) ; HLayout topLayout = new HLayout ( WidgetLayout . marginLarge ) ; topLayout . setWidth100 ( ) ; Img icon = new Img ( WidgetLayout . iconError , WidgetLayout . exceptionWindowIconSize , WidgetLayout . exceptionWindowIconSize ) ; topLayout . addMember ( icon ) ; HTMLFlow message = new HTMLFlow ( ) ; message . setWidth100 ( ) ; message . setHeight100 ( ) ; message . setLayoutAlign ( VerticalAlignment . TOP ) ; message . setContents ( HtmlBuilder . divStyle ( WidgetLayout . exceptionWindowMessageStyle , error . getMessage ( ) ) ) ; topLayout . addMember ( message ) ; layout . addMember ( topLayout ) ; if ( error . getStackTrace ( ) != null && error . getStackTrace ( ) . length > 0 ) { expandButton = new Button ( MESSAGES . exceptionDetailsView ( ) ) ; expandButton . setWidth ( WidgetLayout . exceptionWindowButtonWidth ) ; expandButton . setLayoutAlign ( Alignment . RIGHT ) ; expandButton . addClickHandler ( new ClickHandler ( ) { public void onClick ( ClickEvent event ) { setDetailsVisible ( ! detailsLayout . isVisible ( ) ) ; } } ) ; layout . addMember ( expandButton ) ; String content = getDetails ( error ) ; HTMLPane detailPane = new HTMLPane ( ) ; detailPane . setContents ( content ) ; detailPane . setWidth100 ( ) ; detailPane . setHeight100 ( ) ; detailsLayout = new VLayout ( ) ; detailsLayout . setWidth100 ( ) ; detailsLayout . setHeight100 ( ) ; detailsLayout . addMember ( detailPane ) ; detailsLayout . setBorder ( WidgetLayout . exceptionWindowDetailBorderStyle ) ; layout . addMember ( detailsLayout ) ; } return layout ; }
Create the GUI for a single exception .