|
@@ -9,20 +9,17 @@ |
9 |
9 |
|
import com.google.gwt.event.dom.client.*; |
10 |
10 |
|
import com.google.gwt.user.client.ui.*; |
11 |
11 |
|
|
12 |
|
- |
public class AlertErrorDialog extends AbstractMessageDialog |
13 |
|
- |
{ |
|
12 |
+ |
public class AlertErrorDialog extends AbstractMessageDialog { |
14 |
13 |
|
private static final String VERSION_PANEL_STYLE = "litesoft-AlertErrorDialogVersionPanel"; |
15 |
14 |
|
|
16 |
|
- |
protected AlertErrorDialog() |
17 |
|
- |
{ |
|
15 |
+ |
protected AlertErrorDialog() { |
18 |
16 |
|
super( "Error", "litesoft-AlertErrorDialog", // |
19 |
17 |
|
"litesoft-AlertErrorDialogBodyPanel", "litesoft-AlertErrorDialogHTML", "litesoft-AlertErrorDialogButtonBar", "litesoft-AlertErrorDialogIcon" ); |
20 |
18 |
|
} |
21 |
19 |
|
|
22 |
20 |
|
private String mVersion, mDetail; |
23 |
21 |
|
|
24 |
|
- |
public AlertErrorDialog( String pTitle, String pMessage, String pVersion, String pDetail, DialogCloseCallBack pCloseCallBack ) |
25 |
|
- |
{ |
|
22 |
+ |
public AlertErrorDialog( String pTitle, String pMessage, String pVersion, String pDetail, DialogCloseCallBack pCloseCallBack ) { |
26 |
23 |
|
this(); |
27 |
24 |
|
|
28 |
25 |
|
mVersion = Strings.noEmpty( pVersion ); |
|
@@ -32,17 +29,13 @@ |
32 |
29 |
|
} |
33 |
30 |
|
|
34 |
31 |
|
@Override |
35 |
|
- |
protected SizeableHorizontalPanel createMainBodyPanel( final String pMessage ) |
36 |
|
- |
{ |
|
32 |
+ |
protected SizeableHorizontalPanel createMainBodyPanel( final String pMessage ) { |
37 |
33 |
|
SizeableHorizontalPanel zPanel = super.createMainBodyPanel( pMessage ); |
38 |
34 |
|
|
39 |
|
- |
if ( mDetail != null ) |
40 |
|
- |
{ |
41 |
|
- |
zPanel.add( Button.named( "Details" ).blue().text().add( new ClickHandler() |
42 |
|
- |
{ |
|
35 |
+ |
if ( mDetail != null ) { |
|
36 |
+ |
zPanel.add( Button.named( "Details" ).blue().text().add( new ClickHandler() { |
43 |
37 |
|
@Override |
44 |
|
- |
public void onClick( ClickEvent event ) |
45 |
|
- |
{ |
|
38 |
+ |
public void onClick( ClickEvent event ) { |
46 |
39 |
|
UtilsGwt.windowOpenWithHtml( "", "location=0,menubar=1,status=0,scrollbars=1", // |
47 |
40 |
|
"<html><body style='font-family:sans-serif; overflow:auto;'>" + // |
48 |
41 |
|
"<h4>" + pMessage + "</h4>" + // |
|
@@ -56,16 +49,13 @@ |
56 |
49 |
|
} |
57 |
50 |
|
|
58 |
51 |
|
@Override |
59 |
|
- |
protected void augmentMainPanelBeforeButtons( HasWidgets pVerticalPanel ) |
60 |
|
- |
{ |
61 |
|
- |
if ( mVersion != null ) |
62 |
|
- |
{ |
|
52 |
+ |
protected void augmentMainPanelBeforeButtons( HasWidgets pVerticalPanel ) { |
|
53 |
+ |
if ( mVersion != null ) { |
63 |
54 |
|
pVerticalPanel.add( createVersionPanel( mVersion ) ); |
64 |
55 |
|
} |
65 |
56 |
|
} |
66 |
57 |
|
|
67 |
|
- |
private Widget createVersionPanel( String pMessage ) |
68 |
|
- |
{ |
|
58 |
+ |
private Widget createVersionPanel( String pMessage ) { |
69 |
59 |
|
SizeableHorizontalPanel zPanel = new SizeableHorizontalPanel().stretchableHorizontally(); |
70 |
60 |
|
zPanel.add( new SizeableSpacer().stretchableHorizontally() ); |
71 |
61 |
|
zPanel.add( createBodyPanelMessageHTML( pMessage ) ); |