|
@@ -12,58 +12,47 @@ |
12 |
12 |
|
import com.google.gwt.user.client.ui.*; |
13 |
13 |
|
|
14 |
14 |
|
public abstract class DialogView extends UiView implements DialogCloseCallBack, |
15 |
|
- |
Dialog |
16 |
|
- |
{ |
|
15 |
+ |
Dialog { |
17 |
16 |
|
private Opaqueness mOpaqueness; |
18 |
17 |
|
private DialogError mErrorLabel = new DialogError(); |
19 |
18 |
|
|
20 |
|
- |
public DialogView( CO pCO, Opaqueness pOpaqueness ) |
21 |
|
- |
{ |
|
19 |
+ |
public DialogView( CO pCO, Opaqueness pOpaqueness ) { |
22 |
20 |
|
super( pCO ); |
23 |
21 |
|
mOpaqueness = pOpaqueness; |
24 |
22 |
|
} |
25 |
23 |
|
|
26 |
|
- |
public boolean isCancelable() |
27 |
|
- |
{ |
|
24 |
+ |
public boolean isCancelable() { |
28 |
25 |
|
return true; |
29 |
26 |
|
} |
30 |
27 |
|
|
31 |
|
- |
public SizeableLabel getErrorLabel() |
32 |
|
- |
{ |
|
28 |
+ |
public SizeableLabel getErrorLabel() { |
33 |
29 |
|
return mErrorLabel; |
34 |
30 |
|
} |
35 |
31 |
|
|
36 |
|
- |
public void setDialogErrorMessage( String pError ) |
37 |
|
- |
{ |
|
32 |
+ |
public void setDialogErrorMessage( String pError ) { |
38 |
33 |
|
boolean zEmpty = (null == (pError = Strings.noEmpty( pError ))); |
39 |
34 |
|
mErrorLabel.setText( !zEmpty ? pError : HTMLConstants.NBSP, zEmpty ); |
40 |
35 |
|
} |
41 |
36 |
|
|
42 |
|
- |
protected void add( Widget pWidget ) |
43 |
|
- |
{ |
|
37 |
+ |
protected void add( Widget pWidget ) { |
44 |
38 |
|
mContent.add( pWidget ); |
45 |
39 |
|
} |
46 |
40 |
|
|
47 |
41 |
|
@Override |
48 |
|
- |
public Widget getContent() |
49 |
|
- |
{ |
|
42 |
+ |
public Widget getContent() { |
50 |
43 |
|
return mContent; |
51 |
44 |
|
} |
52 |
45 |
|
|
53 |
46 |
|
@Override |
54 |
|
- |
public void dialogClosed() |
55 |
|
- |
{ |
|
47 |
+ |
public void dialogClosed() { |
56 |
48 |
|
} |
57 |
49 |
|
|
58 |
|
- |
public void cancel() |
59 |
|
- |
{ |
|
50 |
+ |
public void cancel() { |
60 |
51 |
|
close(); |
61 |
52 |
|
} |
62 |
53 |
|
|
63 |
|
- |
public void close() |
64 |
|
- |
{ |
65 |
|
- |
if ( mDialog != null ) |
66 |
|
- |
{ |
|
54 |
+ |
public void close() { |
|
55 |
+ |
if ( mDialog != null ) { |
67 |
56 |
|
mDialog.hide(); |
68 |
57 |
|
mDialog = null; |
69 |
58 |
|
} |
|
@@ -71,61 +60,47 @@ |
71 |
60 |
|
|
72 |
61 |
|
private AbstractDialog mDialog = null; |
73 |
62 |
|
|
74 |
|
- |
public void setActualDialog( AbstractDialog pDialog ) |
75 |
|
- |
{ |
|
63 |
+ |
public void setActualDialog( AbstractDialog pDialog ) { |
76 |
64 |
|
mDialog = pDialog; |
77 |
65 |
|
} |
78 |
66 |
|
|
79 |
|
- |
public AbstractDialog getActualDialog() |
80 |
|
- |
{ |
|
67 |
+ |
public AbstractDialog getActualDialog() { |
81 |
68 |
|
return mDialog; |
82 |
69 |
|
} |
83 |
70 |
|
|
84 |
|
- |
public Opaqueness getOpaqueness() |
85 |
|
- |
{ |
|
71 |
+ |
public Opaqueness getOpaqueness() { |
86 |
72 |
|
return mOpaqueness; |
87 |
73 |
|
} |
88 |
74 |
|
|
89 |
|
- |
protected void submitRequested() |
90 |
|
- |
{ |
|
75 |
+ |
protected void submitRequested() { |
91 |
76 |
|
} |
92 |
77 |
|
|
93 |
|
- |
protected final ButtonBase createSubmitButton() |
94 |
|
- |
{ |
|
78 |
+ |
protected final ButtonBase createSubmitButton() { |
95 |
79 |
|
return SubmitButton.factory().add( createSubmitClickHandler() ).create(); |
96 |
80 |
|
} |
97 |
81 |
|
|
98 |
|
- |
protected final ClickHandler createSubmitClickHandler() |
99 |
|
- |
{ |
100 |
|
- |
return new ClickHandler() |
101 |
|
- |
{ |
|
82 |
+ |
protected final ClickHandler createSubmitClickHandler() { |
|
83 |
+ |
return new ClickHandler() { |
102 |
84 |
|
@Override |
103 |
|
- |
public void onClick( ClickEvent event ) |
104 |
|
- |
{ |
|
85 |
+ |
public void onClick( ClickEvent event ) { |
105 |
86 |
|
submitRequested(); |
106 |
87 |
|
} |
107 |
88 |
|
}; |
108 |
89 |
|
} |
109 |
90 |
|
|
110 |
|
- |
protected final ButtonBase createCancelButton() |
111 |
|
- |
{ |
112 |
|
- |
return CancelButton.factory().add( new ClickHandler() |
113 |
|
- |
{ |
|
91 |
+ |
protected final ButtonBase createCancelButton() { |
|
92 |
+ |
return CancelButton.factory().add( new ClickHandler() { |
114 |
93 |
|
@Override |
115 |
|
- |
public void onClick( ClickEvent event ) |
116 |
|
- |
{ |
|
94 |
+ |
public void onClick( ClickEvent event ) { |
117 |
95 |
|
cancel(); |
118 |
96 |
|
} |
119 |
97 |
|
} ).create(); |
120 |
98 |
|
} |
121 |
99 |
|
|
122 |
|
- |
protected final ButtonBase createCloseButton() |
123 |
|
- |
{ |
124 |
|
- |
return CloseButton.factory().add( new ClickHandler() |
125 |
|
- |
{ |
|
100 |
+ |
protected final ButtonBase createCloseButton() { |
|
101 |
+ |
return CloseButton.factory().add( new ClickHandler() { |
126 |
102 |
|
@Override |
127 |
|
- |
public void onClick( ClickEvent event ) |
128 |
|
- |
{ |
|
103 |
+ |
public void onClick( ClickEvent event ) { |
129 |
104 |
|
cancel(); |
130 |
105 |
|
} |
131 |
106 |
|
} ).create(); |