|
@@ -19,8 +19,7 @@ |
19 |
19 |
|
private Button[] mButtons; |
20 |
20 |
|
|
21 |
21 |
|
protected AbstractMessageDialog( String pDefaultTitle, String pMainPanelStyle, // |
22 |
|
- |
String pBodyPanelStyle, String pBodyPanelMessageHtmlStyle, String pButtonBarStyle, String pDialogIconReference ) |
23 |
|
- |
{ |
|
22 |
+ |
String pBodyPanelStyle, String pBodyPanelMessageHtmlStyle, String pButtonBarStyle, String pDialogIconReference ) { |
24 |
23 |
|
super( pDefaultTitle, Opaqueness.None ); |
25 |
24 |
|
mOuterPanel.addStyleName( pMainPanelStyle ); |
26 |
25 |
|
mBodyPanelStyle = pBodyPanelStyle; |
|
@@ -29,8 +28,7 @@ |
29 |
28 |
|
mButtonBarStyle = pButtonBarStyle; |
30 |
29 |
|
} |
31 |
30 |
|
|
32 |
|
- |
protected void initialize( String pTitle, String pMessage, DialogCloseCallBack pCloseCallBack ) |
33 |
|
- |
{ |
|
31 |
+ |
protected void initialize( String pTitle, String pMessage, DialogCloseCallBack pCloseCallBack ) { |
34 |
32 |
|
mOuterPanel.add( createMainBodyPanel( pMessage ) ); |
35 |
33 |
|
augmentMainPanelBeforeButtons( mOuterPanel ); |
36 |
34 |
|
mOuterPanel.add( new SizeableSpacer().stretchableVertically() ); |
|
@@ -39,13 +37,11 @@ |
39 |
37 |
|
} |
40 |
38 |
|
|
41 |
39 |
|
@Override |
42 |
|
- |
protected Widget createBodyPanel() |
43 |
|
- |
{ |
|
40 |
+ |
protected Widget createBodyPanel() { |
44 |
41 |
|
return mOuterPanel; |
45 |
42 |
|
} |
46 |
43 |
|
|
47 |
|
- |
protected SizeableHorizontalPanel createMainBodyPanel( String pMessage ) |
48 |
|
- |
{ |
|
44 |
+ |
protected SizeableHorizontalPanel createMainBodyPanel( String pMessage ) { |
49 |
45 |
|
SizeableHorizontalPanel zPanel = new SizeableHorizontalPanel().stretchableHorizontally(); |
50 |
46 |
|
zPanel.add( new BackgroundImage( mDialogIconReference ) ); |
51 |
47 |
|
zPanel.add( new Spacer( 8 ) ); |
|
@@ -55,17 +51,13 @@ |
55 |
51 |
|
return zPanel.style( mBodyPanelStyle ); |
56 |
52 |
|
} |
57 |
53 |
|
|
58 |
|
- |
protected void augmentMainPanelBeforeButtons( HasWidgets pVerticalPanel ) |
59 |
|
- |
{ |
|
54 |
+ |
protected void augmentMainPanelBeforeButtons( HasWidgets pVerticalPanel ) { |
60 |
55 |
|
} |
61 |
56 |
|
|
62 |
|
- |
protected Widget createButtonPanel() |
63 |
|
- |
{ |
64 |
|
- |
SizeableHorizontalPanel zPanel = new SizeableHorizontalPanel() |
65 |
|
- |
{ |
|
57 |
+ |
protected Widget createButtonPanel() { |
|
58 |
+ |
SizeableHorizontalPanel zPanel = new SizeableHorizontalPanel() { |
66 |
59 |
|
@Override |
67 |
|
- |
protected void onAttach() |
68 |
|
- |
{ |
|
60 |
+ |
protected void onAttach() { |
69 |
61 |
|
super.onAttach(); |
70 |
62 |
|
DialogButtonPanel.sizeAllButtons( mButtons ); |
71 |
63 |
|
} |
|
@@ -74,8 +66,7 @@ |
74 |
66 |
|
zPanel.add( new SizeableSpacer().stretchableHorizontally() ); |
75 |
67 |
|
mButtons = createButtons(); |
76 |
68 |
|
zPanel.add( mButtons[0] ); |
77 |
|
- |
for ( int i = 1; i < mButtons.length; i++ ) |
78 |
|
- |
{ |
|
69 |
+ |
for ( int i = 1; i < mButtons.length; i++ ) { |
79 |
70 |
|
zPanel.add( new Spacer( 20 ) ); |
80 |
71 |
|
zPanel.add( mButtons[i] ); |
81 |
72 |
|
} |
|
@@ -83,13 +74,11 @@ |
83 |
74 |
|
return zPanel.style( mButtonBarStyle ); |
84 |
75 |
|
} |
85 |
76 |
|
|
86 |
|
- |
protected Button[] createButtons() |
87 |
|
- |
{ |
|
77 |
+ |
protected Button[] createButtons() { |
88 |
78 |
|
return new Button[]{OKButton.factory().add( new HideCommand() ).create()}; |
89 |
79 |
|
} |
90 |
80 |
|
|
91 |
|
- |
private Widget wrapWithSizeable( Widget pWidget ) |
92 |
|
- |
{ |
|
81 |
+ |
private Widget wrapWithSizeable( Widget pWidget ) { |
93 |
82 |
|
Grid zGrid = new Grid( 2, 2 ); |
94 |
83 |
|
zGrid.setWidget( 0, 0, pWidget ); |
95 |
84 |
|
zGrid.setWidget( 0, 1, new Spacer() ); |
|
@@ -98,15 +87,13 @@ |
98 |
87 |
|
return new SizeableSimplePanel( false, zGrid ).stretchableHorizontally(); |
99 |
88 |
|
} |
100 |
89 |
|
|
101 |
|
- |
protected Widget createBodyPanelMessageHTML( String pText ) |
102 |
|
- |
{ |
|
90 |
+ |
protected Widget createBodyPanelMessageHTML( String pText ) { |
103 |
91 |
|
Widget rv = new HTML( wrapWithPre( pText ) ); |
104 |
92 |
|
rv.setStyleName( mBodyPanelMessageHtmlStyle ); |
105 |
93 |
|
return rv; |
106 |
94 |
|
} |
107 |
95 |
|
|
108 |
|
- |
protected String wrapWithPre( String pText ) |
109 |
|
- |
{ |
|
96 |
+ |
protected String wrapWithPre( String pText ) { |
110 |
97 |
|
return "<pre style='font-family:sans-serif; font-size:smaller; margin:0; padding:0;'>" + pText + "</pre>"; |
111 |
98 |
|
} |
112 |
99 |
|
} |