[jbosstools-commits] JBoss Tools SVN: r42575 - 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
Fri Jul 13 11:05:18 EDT 2012


Author: adietish
Date: 2012-07-13 11:05:16 -0400 (Fri, 13 Jul 2012)
New Revision: 42575

Modified:
   trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/AbstractOpenShiftWizardPage.java
   trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPage.java
Log:
[JBIDE-12306] resetting wizard models when user switches openshift user in the application wizard

Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/AbstractOpenShiftWizardPage.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/AbstractOpenShiftWizardPage.java	2012-07-13 14:59:11 UTC (rev 42574)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/AbstractOpenShiftWizardPage.java	2012-07-13 15:05:16 UTC (rev 42575)
@@ -113,6 +113,15 @@
 	protected void onPageDeactivated(DataBindingContext dbc) {
 	}
 
+	/**
+	 * Callback that gets called before the page changes. 
+	 * <p>
+	 * Attention: this is not called when the very first wizard page gets shown for the first time.
+	 * 
+	 * @param direction
+	 * @param event
+	 * @param dbc
+	 */
 	protected void onPageWillGetActivated(Direction direction, PageChangingEvent event, DataBindingContext dbc) {
 	}
 	

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-07-13 14:59:11 UTC (rev 42574)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPage.java	2012-07-13 15:05:16 UTC (rev 42575)
@@ -18,8 +18,6 @@
 import org.eclipse.core.databinding.UpdateListStrategy;
 import org.eclipse.core.databinding.beans.BeanProperties;
 import org.eclipse.core.databinding.conversion.Converter;
-import org.eclipse.core.databinding.observable.list.IObservableList;
-import org.eclipse.core.databinding.observable.list.WritableList;
 import org.eclipse.core.databinding.observable.value.IObservableValue;
 import org.eclipse.core.databinding.observable.value.IValueChangeListener;
 import org.eclipse.core.databinding.observable.value.ValueChangeEvent;
@@ -36,7 +34,6 @@
 import org.eclipse.jface.dialogs.Dialog;
 import org.eclipse.jface.dialogs.ErrorDialog;
 import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.PageChangingEvent;
 import org.eclipse.jface.fieldassist.AutoCompleteField;
 import org.eclipse.jface.fieldassist.ControlDecoration;
 import org.eclipse.jface.fieldassist.FieldDecoration;
@@ -661,27 +658,16 @@
 	@Override
 	protected void onPageActivated(final DataBindingContext dbc) {
 		if (ensureHasDomain()) {
-			enableApplicationWidgets(pageModel.isUseExistingApplication());
-			createExistingAppNameContentAssist();
-			// this is needed because of weird issues with UI
-			// not reacting to model changes while wizard
-			// runnable is run. We force another update
-			// dbc.updateModels();
-			this.newAppNameText.setFocus();
-		}
-	}
-
-	@Override
-	protected void onPageWillGetActivated(Direction direction, PageChangingEvent event, DataBindingContext dbc) {
-		if (direction == Direction.FORWARDS) {
 			try {
-				pageModel.reset(); 
-				// needs to be done before loading resources,
-				// otherwise: dbc.updateModels() will be
-				// called and old data could be restored
+				pageModel.reset();
+				// needs to be done before loading resources, otherwise:
+				// dbc.updateModels() will be called and old data could be
+				// restored
 				loadOpenshiftResources(dbc);
 				dbc.updateTargets();
-				setPageComplete(false);
+				enableApplicationWidgets(pageModel.isUseExistingApplication());
+				createExistingAppNameContentAssist();
+				this.newAppNameText.setFocus();
 			} catch (OpenShiftException e) {
 				Logger.error("Failed to reset page fields", e);
 			}



More information about the jbosstools-commits mailing list