Author: rob.stryker(a)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) {
}
}
}
Show replies by date