Bug 227968 Deathlock while synchronizing with cvs
diff --git a/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/storage/DefaultPasswordProvider.java b/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/storage/DefaultPasswordProvider.java
index cd5dcf6..7173247 100644
--- a/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/storage/DefaultPasswordProvider.java
+++ b/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/storage/DefaultPasswordProvider.java
@@ -15,9 +15,8 @@
import org.eclipse.equinox.internal.security.storage.friends.InternalExchangeUtils;
import org.eclipse.equinox.internal.security.ui.nls.SecUIMessages;
import org.eclipse.equinox.security.storage.provider.*;
+import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.window.Window;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.MessageBox;
import org.eclipse.ui.PlatformUI;
/**
@@ -59,16 +58,14 @@
if (!useUI(container))
return false;
- final int[] result = new int[1];
+ final Boolean[] result = new Boolean[1];
PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() {
public void run() {
- MessageBox dialog = new MessageBox(StorageUtils.getShell(), SWT.ICON_ERROR | SWT.YES | SWT.NO);
- dialog.setText(SecUIMessages.exceptionTitle);
- dialog.setMessage(SecUIMessages.exceptionDecode);
- result[0] = dialog.open();
+ boolean reply = MessageDialog.openConfirm(StorageUtils.getShell(), SecUIMessages.exceptionTitle, SecUIMessages.exceptionDecode);
+ result[0] = new Boolean(reply);
}
});
- return (result[0] == SWT.YES);
+ return result[0].booleanValue();
}
private boolean useUI(IPreferencesContainer container) {
diff --git a/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/storage/UICallbackProvider.java b/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/storage/UICallbackProvider.java
index 511cb95..a7b8418 100644
--- a/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/storage/UICallbackProvider.java
+++ b/bundles/org.eclipse.equinox.security.ui/src/org/eclipse/equinox/internal/security/ui/storage/UICallbackProvider.java
@@ -17,10 +17,9 @@
import org.eclipse.equinox.internal.security.ui.nls.SecUIMessages;
import org.eclipse.equinox.security.storage.StorageException;
import org.eclipse.equinox.security.storage.provider.IPreferencesContainer;
+import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.MessageBox;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.progress.IProgressService;
import org.eclipse.ui.progress.UIJob;
@@ -61,12 +60,9 @@
UIJob reciverySetupJob = new UIJob(SecUIMessages.pswJobName) {
public IStatus runInUIThread(IProgressMonitor monitor) {
- MessageBox prompt = new MessageBox(StorageUtils.getShell(), SWT.ICON_QUESTION | SWT.YES | SWT.NO);
- prompt.setText(SecUIMessages.pswdRecoveryOptionTitle);
- prompt.setMessage(SecUIMessages.pswdRecoveryOptionMsg);
- if (prompt.open() != SWT.YES)
+ boolean reply = MessageDialog.openConfirm(StorageUtils.getShell(), SecUIMessages.pswdRecoveryOptionTitle, SecUIMessages.pswdRecoveryOptionMsg);
+ if (!reply)
return Status.OK_STATUS;
-
ChallengeResponseDialog dialog = new ChallengeResponseDialog(size, StorageUtils.getShell());
dialog.open();
String[][] result = dialog.getResult();
@@ -133,16 +129,14 @@
if (!StorageUtils.showUI())
return null;
- final int[] result = new int[1];
+ final Boolean[] result = new Boolean[1];
PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() {
public void run() {
- MessageBox prompt = new MessageBox(StorageUtils.getShell(), SWT.ICON_QUESTION | SWT.YES | SWT.NO);
- prompt.setText(SecUIMessages.generalDialogTitle);
- prompt.setMessage(msg);
- result[0] = prompt.open();
+ boolean reply = MessageDialog.openConfirm(StorageUtils.getShell(), SecUIMessages.generalDialogTitle, msg);
+ result[0] = new Boolean(reply);
}
});
- return new Boolean(result[0] == SWT.YES);
+ return result[0];
}
public boolean runningUI() {