Author: rob.stryker(a)jboss.com
Date: 2011-11-07 03:25:14 -0500 (Mon, 07 Nov 2011)
New Revision: 36187
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressPublishMethod.java
Log:
JBIDE-10105 - trunk - messagebox error from m4
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressPublishMethod.java
===================================================================
---
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressPublishMethod.java 2011-11-07
07:59:25 UTC (rev 36186)
+++
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressPublishMethod.java 2011-11-07
08:25:14 UTC (rev 36187)
@@ -8,10 +8,9 @@
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.SubProgressMonitor;
+import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jgit.lib.Repository;
-import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.MessageBox;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.team.internal.ui.wizards.ConfigureProjectWizard;
import org.eclipse.ui.PlatformUI;
@@ -120,19 +119,23 @@
final boolean[] b = new boolean[1];
Display.getDefault().syncExec(new Runnable() {
public void run() {
- MessageBox messageBox = new MessageBox(new Shell(), SWT.ICON_QUESTION | SWT.YES |
SWT.NO);
- messageBox.setMessage(message);
- messageBox.setText(title);
- int response = messageBox.open();
- if (response == SWT.YES)
- b[0] = true;
- else
- b[0] = false;
+ b[0] = MessageDialog.openQuestion(getActiveShell(), title, message);
}
});
return b[0];
}
+ private static Shell getActiveShell() {
+ Display display = Display.getDefault();
+ final Shell[] ret = new Shell[1];
+ display.syncExec(new Runnable() {
+ public void run() {
+ ret[0] = Display.getCurrent().getActiveShell();
+ }
+ });
+ return ret[0];
+ }
+
@Override
public IPublishCopyCallbackHandler getCallbackHandler(IPath path,
IServer server) {
Show replies by date