1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-04 15:45:25 +02:00

Bug 154408 - The fix is to clear the message line prior to validating the dialog.

This commit is contained in:
David Dykstal 2006-09-21 21:59:08 +00:00
parent 904823c2ea
commit 6c68f75c6a
3 changed files with 16 additions and 27 deletions

View file

@ -71,24 +71,10 @@ public class SystemClearPasswordAction extends SystemBaseAction
ISubSystem ss = (ISubSystem)getFirstSelection();
try {
IConnectorService system = ss.getConnectorService();
// get the user id
String userId = system.getUserId();
// clear userid/password from memory and fire event
//DKM and disk now
system.clearPasswordCache(true);
RSEUIPlugin.getTheSystemRegistry().fireEvent(new SystemResourceChangeEvent(ss,
ISystemResourceChangeEvents.EVENT_PROPERTY_CHANGE,
ss.getHost()));
/* DKM - this is now done in clearPasswordCache
*
// now get rid of userid/password from disk
String systemType = ss.getSystem().getSystemType();
String hostName = system.getHostName();
PasswordPersistenceManager.getInstance().remove(systemType, hostName, userId);
*/
}
catch (Exception exc) {
// msg already shown

View file

@ -237,7 +237,6 @@ public final class SystemPasswordPromptDialog extends SystemPromptDialog impleme
protected Control getInitialFocusControl() {
okButton.setEnabled(true);
processUserIdField();
processPasswordField();
if (textUserId != null) {
if (userId.length() == 0 || textPassword == null) {
return textUserId;
@ -311,14 +310,15 @@ public final class SystemPasswordPromptDialog extends SystemPromptDialog impleme
* @see #setUserIdValidator(ISystemValidator)
*/
private void processUserIdField() {
internalGetUserId();
internalGetPassword();
clearErrorMessage();
SystemMessage m = checkUserId();
if (m == null) {
m = checkPassword();
}
if (m != null) {
setErrorMessage(m);
}
okButton.setEnabled(m == null);
setErrorMessage(m);
if (userId == null || originalUserId == null) {
userIdChanged = (userId != originalUserId);
} else {
@ -335,6 +335,7 @@ public final class SystemPasswordPromptDialog extends SystemPromptDialog impleme
* @return the message returned by the validator or null.
*/
private SystemMessage checkUserId() {
internalGetUserId();
SystemMessage m = null;
if (connectorService.supportsUserId() && validate) {
if (userIdValidator != null) {
@ -354,14 +355,15 @@ public final class SystemPasswordPromptDialog extends SystemPromptDialog impleme
* @see #setPasswordValidator(ISystemValidator)
*/
private void processPasswordField() {
internalGetUserId();
internalGetPassword();
clearErrorMessage();
SystemMessage m = checkPassword();
if (m == null) {
m = checkUserId();
}
if (m != null) {
setErrorMessage(m);
}
okButton.setEnabled(m == null);
setErrorMessage(m);
if (savePasswordCB != null) {
savePasswordCB.setEnabled(!(connectorService.requiresPassword() && password.length() == 0));
}
@ -371,6 +373,7 @@ public final class SystemPasswordPromptDialog extends SystemPromptDialog impleme
* Checks the value of the password instance variable.
*/
private SystemMessage checkPassword() {
internalGetPassword();
SystemMessage m = null;
if (connectorService.supportsPassword() && validate) {
if (passwordValidator != null) {

View file

@ -338,22 +338,21 @@ public abstract class AbstractConnectorService extends RSEModelObject implements
* change his userId.
*
* @param onDisk if this is true, clear the password from the disk cache as well
* @see #clearUserIdCache(boolean)
* @see #clearUserIdCache()
*/
final public void clearPasswordCache(boolean onDisk) {
setPasswordInformation(null);
String userId = getUserId();
if (onDisk) {
// now get rid of userid/password from disk
String systemType = getHostType();
String hostName = getHostName();
if (_userId != null)
PasswordPersistenceManager.getInstance().remove(systemType, hostName, _userId);
if (userId != null)
PasswordPersistenceManager.getInstance().remove(systemType, hostName, userId);
}
if (shareUserPasswordWithConnection()) {
// clear this uid/password with other ISystems in connection
clearPasswordForOtherSystemsInConnection(_userId, onDisk);
clearPasswordForOtherSystemsInConnection(userId, onDisk);
}
}
@ -533,6 +532,7 @@ public abstract class AbstractConnectorService extends RSEModelObject implements
logException(e);
}
if (dialog.wasCancelled()) {
_passwordInfo = null;
throw new InterruptedException();
}
String userId = dialog.getUserId();