Revision 6c73ee65 src/gr/ebs/gss/client/CredentialsDialog.java
b/src/gr/ebs/gss/client/CredentialsDialog.java | ||
---|---|---|
52 | 52 |
/** |
53 | 53 |
* The 'confirm reset password' dialog box. |
54 | 54 |
*/ |
55 |
public class ConfirmResetPasswordDialog extends DialogBox {
|
|
55 |
private class ConfirmResetPasswordDialog extends DialogBox {
|
|
56 | 56 |
|
57 | 57 |
/** |
58 | 58 |
* The widget's constructor. |
... | ... | |
116 | 116 |
|
117 | 117 |
} |
118 | 118 |
|
119 |
private class ReauthenticateDialog extends DialogBox { |
|
120 |
/** |
|
121 |
* The widget constructor. |
|
122 |
*/ |
|
123 |
public ReauthenticateDialog() { |
|
124 |
// Set the dialog's caption. |
|
125 |
setText("New Password Created"); |
|
126 |
setAnimationEnabled(true); |
|
127 |
VerticalPanel outer = new VerticalPanel(); |
|
128 |
|
|
129 |
// Create the text and set a style name so we can style it with CSS. |
|
130 |
HTML text = new HTML("<p>A new WebDAV password has been created.</p>"+ |
|
131 |
"<p>You will now be redirected to the initial screen for the changes to take effect. " + |
|
132 |
"Choose \"Show Credentials\" again afterwards to see the new password.</p>"); |
|
133 |
text.setStyleName("gss-AboutText"); |
|
134 |
outer.add(text); |
|
135 |
|
|
136 |
// Create the 'OK' button, along with a listener that hides the dialog |
|
137 |
// when the button is clicked. |
|
138 |
Button confirm = new Button("Proceed", new ClickListener() { |
|
139 |
|
|
140 |
public void onClick(Widget sender) { |
|
141 |
GSS.get().authenticateUser(); |
|
142 |
hide(); |
|
143 |
} |
|
144 |
}); |
|
145 |
outer.add(confirm); |
|
146 |
outer.setCellHorizontalAlignment(confirm, HasHorizontalAlignment.ALIGN_CENTER); |
|
147 |
outer.setSpacing(8); |
|
148 |
setWidget(outer); |
|
149 |
} |
|
150 |
|
|
151 |
@Override |
|
152 |
public boolean onKeyDownPreview(char key, int modifiers) { |
|
153 |
// Use the popup's key preview hooks to close the dialog when either |
|
154 |
// enter or escape is pressed. |
|
155 |
switch (key) { |
|
156 |
case KeyboardListener.KEY_ENTER: |
|
157 |
GSS.get().authenticateUser(); |
|
158 |
hide(); |
|
159 |
break; |
|
160 |
case KeyboardListener.KEY_ESCAPE: |
|
161 |
hide(); |
|
162 |
break; |
|
163 |
} |
|
164 |
return true; |
|
165 |
} |
|
166 |
} |
|
167 |
|
|
119 | 168 |
/** |
120 | 169 |
* The widget constructor. |
121 | 170 |
*/ |
... | ... | |
254 | 303 |
|
255 | 304 |
@Override |
256 | 305 |
public void onComplete() { |
257 |
GSS.get().refreshWebDAVPassword();
|
|
258 |
passwordBox.setText(GSS.get().getWebDAVPassword());
|
|
306 |
ReauthenticateDialog dlg = new ReauthenticateDialog();
|
|
307 |
dlg.center();
|
|
259 | 308 |
} |
260 | 309 |
|
261 | 310 |
@Override |
Also available in: Unified diff