[jbosstools-commits] JBoss Tools SVN: r40704 - trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard.

jbosstools-commits at lists.jboss.org jbosstools-commits at lists.jboss.org
Wed May 2 02:41:38 EDT 2012


Author: rob.stryker at jboss.com
Date: 2012-05-02 02:41:36 -0400 (Wed, 02 May 2012)
New Revision: 40704

Modified:
   trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPage.java
Log:
JBIDE-11725 use in-wizard job

Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPage.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPage.java	2012-05-02 06:18:30 UTC (rev 40703)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPage.java	2012-05-02 06:41:36 UTC (rev 40704)
@@ -10,6 +10,7 @@
  ******************************************************************************/
 package org.jboss.tools.openshift.express.internal.ui.wizard;
 
+import java.lang.reflect.InvocationTargetException;
 import java.net.SocketTimeoutException;
 import java.util.Collection;
 import java.util.Set;
@@ -213,16 +214,27 @@
 				if (result == IDialogConstants.OK_ID) {
 					final IApplication selectedApplication = appSelectionDialog.getSelectedApplication();
 					if (selectedApplication != null) {
+						// This setter may be long-running
+						Job j = new Job("Setting Application") {
+							protected IStatus run(IProgressMonitor monitor) {
+								try {
+									pageModel.setExistingApplicationName(selectedApplication.getName());
+								} catch (OpenShiftException ex) {
+									OpenShiftUIActivator.log(OpenShiftUIActivator.createErrorStatus(NLS.bind(
+											"Could not get embedded cartridges for application {0}",
+											selectedApplication.getName()), ex));
+								} catch (SocketTimeoutException ex) {
+									OpenShiftUIActivator.log(OpenShiftUIActivator.createErrorStatus(NLS.bind(
+											"Could not get embedded cartridges for application {0}",
+											selectedApplication.getName()), ex));
+								}
+								return Status.OK_STATUS;
+							}
+						};
 						try {
-							pageModel.setExistingApplicationName(selectedApplication.getName());
-						} catch (OpenShiftException ex) {
-							OpenShiftUIActivator.log(OpenShiftUIActivator.createErrorStatus(NLS.bind(
-									"Could not get embedded cartridges for application {0}",
-									selectedApplication.getName()), ex));
-						} catch (SocketTimeoutException ex) {
-							OpenShiftUIActivator.log(OpenShiftUIActivator.createErrorStatus(NLS.bind(
-									"Could not get embedded cartridges for application {0}",
-									selectedApplication.getName()), ex));
+							WizardUtils.runInWizard(j, getContainer());
+						} catch(InvocationTargetException ite) {
+						} catch(InterruptedException ie) {
 						}
 					}
 				}



More information about the jbosstools-commits mailing list