[jbosstools-commits] JBoss Tools SVN: r42507 - branches/jbosstools-3.3.x/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 Jul 11 09:07:36 EDT 2012


Author: adietish
Date: 2012-07-11 09:07:36 -0400 (Wed, 11 Jul 2012)
New Revision: 42507

Modified:
   branches/jbosstools-3.3.x/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/AbstractOpenShiftWizardPage.java
   branches/jbosstools-3.3.x/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPage.java
Log:
[JBIDE-11310] moved logic from #onPageWillGetActivated to #onPageActivated since #onPageWillGetActivated is not called when the first wizard page is shown for the first time (which is the case when launching the wizard from OpenShift Explorer)

Modified: branches/jbosstools-3.3.x/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/AbstractOpenShiftWizardPage.java
===================================================================
--- branches/jbosstools-3.3.x/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/AbstractOpenShiftWizardPage.java	2012-07-11 12:12:46 UTC (rev 42506)
+++ branches/jbosstools-3.3.x/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/AbstractOpenShiftWizardPage.java	2012-07-11 13:07:36 UTC (rev 42507)
@@ -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: branches/jbosstools-3.3.x/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPage.java
===================================================================
--- branches/jbosstools-3.3.x/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPage.java	2012-07-11 12:12:46 UTC (rev 42506)
+++ branches/jbosstools-3.3.x/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPage.java	2012-07-11 13:07:36 UTC (rev 42507)
@@ -34,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;
@@ -658,26 +657,17 @@
 
 	@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);
 			}
@@ -713,13 +703,6 @@
 		return true;
 	}
 
-	/**
-	 * 
-	 * @return private boolean ensureHasSshKey() {
-	 * 
-	 *         }
-	 */
-
 	protected void loadOpenshiftResources(final DataBindingContext dbc) {
 		try {
 			WizardUtils.runInWizard(new Job("Loading data...") {



More information about the jbosstools-commits mailing list