[jbosstools-commits] JBoss Tools SVN: r42487 - 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
Tue Jul 10 10:44:39 EDT 2012
Author: adietish
Date: 2012-07-10 10:44:38 -0400 (Tue, 10 Jul 2012)
New Revision: 42487
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/ApplicationConfigurationWizardPageModel.java
branches/jbosstools-3.3.x/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/GitCloningSettingsWizardPage.java
branches/jbosstools-3.3.x/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/GitCloningSettingsWizardPageModel.java
branches/jbosstools-3.3.x/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/OpenShiftExpressApplicationWizardModel.java
branches/jbosstools-3.3.x/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ProjectAndServerAdapterSettingsWizardPage.java
branches/jbosstools-3.3.x/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ProjectAndServerAdapterSettingsWizardPageModel.java
Log:
[JBIDE-11310] resetting models when user switches the openshift user
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-10 06:59:43 UTC (rev 42486)
+++ 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-10 14:44:38 UTC (rev 42487)
@@ -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,6 +34,7 @@
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;
@@ -161,6 +160,9 @@
ValueBindingBuilder.bind(existingAppNameTextObservable).to(existingAppNameModelObservable).in(dbc);
UIUtils.focusOnSelection(useExistingAppBtn, existingAppNameText);
createExistingAppNameContentAssist();
+ useExistingAppBtnSelection.addValueChangeListener(
+ onUseExistingApplication(
+ newAppConfigurationGroup, existingAppNameText, browseAppsButton));
this.browseAppsButton = new Button(existingAppSelectionGroup, SWT.NONE);
browseAppsButton.setText("Browse...");
@@ -236,11 +238,6 @@
GridDataFactory.fillDefaults()
.grab(true, true).align(SWT.FILL, SWT.FILL).applyTo(newAppConfigurationGroup);
- IObservableValue useExistingApplication = WidgetProperties.selection().observe(useExistingAppBtn);
- useExistingApplication.addValueChangeListener(
- onUseExistingApplication(
- newAppConfigurationGroup, existingAppNameText, browseAppsButton));
-
final Label newAppNameLabel = new Label(newAppConfigurationGroup, SWT.NONE);
newAppNameLabel.setText("Name:");
GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).applyTo(newAppNameLabel);
@@ -661,25 +658,32 @@
@Override
protected void onPageActivated(final DataBindingContext dbc) {
+
if (ensureHasDomain()) {
- new Thread() {
- public void run() {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- loadOpenshiftResources(dbc);
- 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();
- }
- });
- }
- }.start();
+ 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
+ loadOpenshiftResources(dbc);
+ dbc.updateTargets();
+ setPageComplete(false);
+ } catch (OpenShiftException e) {
+ Logger.error("Failed to reset page fields", e);
+ }
+ }
+ }
+
/**
* Checks that the user has a domain, opens the creation dialog in case he
* hasn't, closes the wizard if the user does not create a domain (required
@@ -718,60 +722,28 @@
protected void loadOpenshiftResources(final DataBindingContext dbc) {
try {
- WizardUtils.runInWizard(new Job("Loading existing applications...") {
+ WizardUtils.runInWizard(new Job("Loading data...") {
@Override
protected IStatus run(IProgressMonitor monitor) {
try {
+ monitor.setTaskName("Loading existing applications...");
pageModel.loadExistingApplications();
- return Status.OK_STATUS;
- } catch (NotFoundOpenShiftException e) {
- return Status.OK_STATUS;
- } catch (Exception e) {
- return OpenShiftUIActivator.createErrorStatus("Could not load applications", e);
- }
- }
-
- }, getContainer(), dbc);
-
- WizardUtils.runInWizard(new Job("Loading application cartridges...") {
- @Override
- protected IStatus run(IProgressMonitor monitor) {
- try {
+ monitor.setTaskName("Loading application cartridges...");
pageModel.loadStandaloneCartridges();
- return Status.OK_STATUS;
- } catch (NotFoundOpenShiftException e) {
- return Status.OK_STATUS;
- } catch (Exception e) {
- return OpenShiftUIActivator.createErrorStatus("Could not load application cartridges", e);
- }
- }
- }, getContainer(), dbc);
- WizardUtils.runInWizard(new Job("Loading embeddable cartridges...") {
- @Override
- protected IStatus run(IProgressMonitor monitor) {
- try {
+ monitor.setTaskName("Loading embeddable cartridges...");
setViewerInput(pageModel.loadEmbeddedCartridges());
- return Status.OK_STATUS;
- } catch (NotFoundOpenShiftException e) {
- return Status.OK_STATUS;
- } catch (Exception e) {
- return OpenShiftUIActivator.createErrorStatus("Could not load embeddable cartridges", e);
- }
- }
- }, getContainer(), dbc);
- WizardUtils.runInWizard(new Job("Loading gear sizes...") {
- @Override
- protected IStatus run(IProgressMonitor monitor) {
- try {
+ monitor.setTaskName("Loading gear profiles...");
pageModel.loadGearProfiles();
return Status.OK_STATUS;
} catch (NotFoundOpenShiftException e) {
return Status.OK_STATUS;
} catch (Exception e) {
- return OpenShiftUIActivator.createErrorStatus("Could not load gear sizes", e);
+ return OpenShiftUIActivator.createErrorStatus("Could not load applications", e);
}
}
+
}, getContainer(), dbc);
+
} catch (Exception ex) {
// ignore
}
@@ -819,16 +791,8 @@
}
return ValidationStatus.ok();
-
}
- @Override
- public IObservableList getTargets() {
- WritableList targets = new WritableList();
- targets.add(existingAppNameTextObservable);
- return targets;
- }
-
}
class NewApplicationNameValidator extends MultiValidator {
@@ -863,12 +827,6 @@
return ValidationStatus.ok();
}
- @Override
- public IObservableList getTargets() {
- WritableList targets = new WritableList();
- targets.add(applicationNameObservable);
- return targets;
- }
}
/**
@@ -879,18 +837,18 @@
*/
class NewApplicationTypeValidator extends MultiValidator {
- private final IObservableValue useExistingAppBtnbservable;
+ private final IObservableValue useExistingAppBtnObservable;
private final IObservableValue selectedApplicationTypeObservable;
public NewApplicationTypeValidator(IObservableValue useExistingAppBtnbservable,
IObservableValue selectedApplicationTypeObservable) {
- this.useExistingAppBtnbservable = useExistingAppBtnbservable;
+ this.useExistingAppBtnObservable = useExistingAppBtnbservable;
this.selectedApplicationTypeObservable = selectedApplicationTypeObservable;
}
@Override
protected IStatus validate() {
- final boolean useExistingApp = (Boolean) useExistingAppBtnbservable.getValue();
+ final boolean useExistingApp = (Boolean) useExistingAppBtnObservable.getValue();
final Integer selectedCartridgeIndex = (Integer) selectedApplicationTypeObservable.getValue();
if (useExistingApp) {
return ValidationStatus.ok();
@@ -902,12 +860,6 @@
return ValidationStatus.ok();
}
- @Override
- public IObservableList getTargets() {
- WritableList targets = new WritableList();
- targets.add(selectedApplicationTypeObservable);
- return targets;
- }
}
protected void setupWizardPageSupport(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/ApplicationConfigurationWizardPageModel.java
===================================================================
--- branches/jbosstools-3.3.x/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPageModel.java 2012-07-10 06:59:43 UTC (rev 42486)
+++ branches/jbosstools-3.3.x/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPageModel.java 2012-07-10 14:44:38 UTC (rev 42487)
@@ -146,7 +146,7 @@
*
* @see #doSetExistingApplication(IApplication)
*/
- public void setExistingApplicationName(String applicationName) throws OpenShiftException {
+ public void setExistingApplicationName(String applicationName) throws OpenShiftException {
firePropertyChange(PROPERTY_EXISTING_APPLICATION_NAME
, this.existingApplicationName, this.existingApplicationName = applicationName);
@@ -325,7 +325,9 @@
public void setExistingApplication(IApplication application) throws OpenShiftException {
if (application != null) {
setExistingApplicationName(application.getName());
- doSetExistingApplication(application);
+ //doSetExistingApplication(application); // already called within setExistingApplicationName(String) above
+ } else {
+ setExistingApplicationName(null);
}
}
@@ -353,10 +355,6 @@
}
}
- public void resetExistingApplication() throws OpenShiftException, SocketTimeoutException {
- setExistingApplication((IApplication) null);
- }
-
public void setApplicationName(String applicationName) {
firePropertyChange(PROPERTY_APPLICATION_NAME
, wizardModel.getApplicationName()
@@ -426,4 +424,12 @@
public IDomain getDomain() throws SocketTimeoutException, OpenShiftException {
return wizardModel.getUser().getDefaultDomain();
}
+
+ public void reset() throws OpenShiftException {
+ setApplicationName(wizardModel.getApplication());
+ setExistingApplication(wizardModel.getApplication());
+ setUseExistingApplication(wizardModel.isUseExistingApplication());
+ setSelectedEmbeddableCartridges(wizardModel.getSelectedEmbeddableCartridges());
+ }
+
}
Modified: branches/jbosstools-3.3.x/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/GitCloningSettingsWizardPage.java
===================================================================
--- branches/jbosstools-3.3.x/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/GitCloningSettingsWizardPage.java 2012-07-10 06:59:43 UTC (rev 42486)
+++ branches/jbosstools-3.3.x/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/GitCloningSettingsWizardPage.java 2012-07-10 14:44:38 UTC (rev 42487)
@@ -12,8 +12,6 @@
import org.eclipse.core.databinding.DataBindingContext;
import org.eclipse.core.databinding.beans.BeanProperties;
-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.validation.MultiValidator;
import org.eclipse.core.databinding.validation.ValidationStatus;
@@ -24,6 +22,7 @@
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.databinding.swt.WidgetProperties;
+import org.eclipse.jface.dialogs.PageChangingEvent;
import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.jface.layout.GridLayoutFactory;
import org.eclipse.jface.wizard.IWizardPage;
@@ -223,7 +222,17 @@
protected void onPageActivated(DataBindingContext dbc) {
enableWidgets(pageModel.isNewProject());
}
+
+
+ @Override
+ protected void onPageWillGetActivated(Direction direction, PageChangingEvent event, DataBindingContext dbc) {
+ if(direction == Direction.FORWARDS) {
+ pageModel.reset();
+ dbc.updateTargets();
+ }
+ }
+
private void enableWidgets(boolean isNewProject) {
if (isNewProject) {
useDefaultRepoPathButton.setEnabled(true);
@@ -280,13 +289,6 @@
return ValidationStatus.ok();
}
- @Override
- public IObservableList getTargets() {
- WritableList targets = new WritableList();
- targets.add(repoPathObservable);
- return targets;
- }
-
}
/**
@@ -334,12 +336,13 @@
private boolean hasRemoteName(String remoteName, IProject project) {
try {
- if (project == null
- || !project.isAccessible()) {
+ if (project == null || !project.isAccessible()) {
return false;
}
-
Repository repository = EGitUtils.getRepository(project);
+ if(repository == null) {
+ return false;
+ }
return EGitUtils.hasRemote(remoteName, repository);
} catch (Exception e) {
OpenShiftUIActivator.log(OpenShiftUIActivator.createErrorStatus(e.getMessage(), e));
@@ -347,12 +350,6 @@
}
}
- @Override
- public IObservableList getTargets() {
- WritableList targets = new WritableList();
- targets.add(remoteNameObservable);
- return targets;
- }
}
}
Modified: branches/jbosstools-3.3.x/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/GitCloningSettingsWizardPageModel.java
===================================================================
--- branches/jbosstools-3.3.x/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/GitCloningSettingsWizardPageModel.java 2012-07-10 06:59:43 UTC (rev 42486)
+++ branches/jbosstools-3.3.x/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/GitCloningSettingsWizardPageModel.java 2012-07-10 14:44:38 UTC (rev 42487)
@@ -173,5 +173,10 @@
public boolean isUseDefaultRemoteName() {
return useDefaultRemoteName;
}
+
+ public void reset() {
+ setRemoteName(wizardModel.getRemoteName());
+ setRepositoryPath(wizardModel.getRepositoryPath());
+ }
}
Modified: branches/jbosstools-3.3.x/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/OpenShiftExpressApplicationWizardModel.java
===================================================================
--- branches/jbosstools-3.3.x/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/OpenShiftExpressApplicationWizardModel.java 2012-07-10 06:59:43 UTC (rev 42486)
+++ branches/jbosstools-3.3.x/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/OpenShiftExpressApplicationWizardModel.java 2012-07-10 14:44:38 UTC (rev 42487)
@@ -39,6 +39,12 @@
private static final String KEY_SELECTED_EMBEDDABLE_CARTRIDGES = "selectedEmbeddableCartridges";
+ private static final String DEFAULT_APPLICATION = "default_application";
+
+ private static final String DEFAULT_PROJECT = "default_project";
+
+ private static final String DEFAULT_USE_EXISTING_APPLICATION = "default_useExistingApplication";
+
public OpenShiftExpressApplicationWizardModel(UserDelegate user) {
this(user, null, null, false);
}
@@ -46,15 +52,10 @@
public OpenShiftExpressApplicationWizardModel(UserDelegate user, IProject project, IApplication application,
boolean useExistingApplication) {
// default value(s)
+ setDefaultProject(project);
+ setDefaultApplication(application);
+ setDefaultUseExistingApplication(useExistingApplication);
setUser(user);
- setProject(project);
- setNewProject(true);
- setApplication(application);
- setUseExistingApplication(useExistingApplication);
- setCreateServerAdapter(true);
- setRepositoryPath(DEFAULT_REPOSITORY_PATH);
- setRemoteName(NEW_PROJECT_REMOTE_NAME_DEFAULT);
- setServerType(ServerCore.findServerType(ExpressServerUtils.OPENSHIFT_SERVER_TYPE));
}
/**
@@ -198,6 +199,15 @@
return (IApplication) getProperty(APPLICATION);
}
+ public void setDefaultApplication(IApplication application) {
+ setProperty(DEFAULT_APPLICATION, application);
+ setApplication(application);
+ }
+
+ public IApplication getDefaultApplication() {
+ return (IApplication)getProperty(DEFAULT_APPLICATION);
+ }
+
@Override
public void setApplication(IApplication application) {
setProperty(APPLICATION, application);
@@ -206,7 +216,6 @@
setApplicationName(application);
setApplicationScaling(application);
setApplicationGearProfile(application);
-
}
@Override
@@ -255,6 +264,16 @@
return (String) setProperty(PROJECT_NAME, projectName);
}
+ public IProject setDefaultProject(IProject project) {
+ setProperty(DEFAULT_PROJECT, project);
+ setProject(project);
+ return project;
+ }
+
+ public IProject getDefaultProject() {
+ return (IProject)getProperty(DEFAULT_PROJECT);
+ }
+
@Override
public IProject setProject(IProject project) {
if (project != null && project.exists()) {
@@ -327,6 +346,20 @@
return (Boolean) getProperty(USE_EXISTING_APPLICATION);
}
+ public boolean setDefaultUseExistingApplication(boolean useExistingApplication) {
+ setProperty(DEFAULT_USE_EXISTING_APPLICATION, useExistingApplication);
+ setUseExistingApplication(useExistingApplication);
+ return useExistingApplication;
+ }
+
+ public boolean getDefaultUseExistingApplication() {
+ Object useExistingApp = getProperty(DEFAULT_USE_EXISTING_APPLICATION);
+ if(useExistingApp != null) {
+ return (Boolean)useExistingApp;
+ }
+ return false;
+ }
+
@Override
public boolean setUseExistingApplication(boolean useExistingApplication) {
Boolean isUseExistingApplication = (Boolean) setProperty(USE_EXISTING_APPLICATION, useExistingApplication);
@@ -429,9 +462,22 @@
@Override
public UserDelegate setUser(UserDelegate user) {
- return (UserDelegate) setProperty(USER, user);
+ setProperty(USER, user);
+ resetWizardModel();
+ return user;
}
-
+
+ public void resetWizardModel() {
+ setApplication(getDefaultApplication());
+ setUseExistingApplication(getDefaultUseExistingApplication());
+ setSelectedEmbeddableCartridges(new HashSet<IEmbeddableCartridge>());
+ setNewProject(true);
+ setCreateServerAdapter(true);
+ setRepositoryPath(IOpenShiftExpressWizardModel.DEFAULT_REPOSITORY_PATH);
+ setRemoteName(IOpenShiftExpressWizardModel.NEW_PROJECT_REMOTE_NAME_DEFAULT);
+ setServerType(ServerCore.findServerType(ExpressServerUtils.OPENSHIFT_SERVER_TYPE));
+ }
+
@Override
public void addUserToModel() {
UserDelegate user = getUser();
Modified: branches/jbosstools-3.3.x/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ProjectAndServerAdapterSettingsWizardPage.java
===================================================================
--- branches/jbosstools-3.3.x/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ProjectAndServerAdapterSettingsWizardPage.java 2012-07-10 06:59:43 UTC (rev 42486)
+++ branches/jbosstools-3.3.x/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ProjectAndServerAdapterSettingsWizardPage.java 2012-07-10 14:44:38 UTC (rev 42487)
@@ -15,8 +15,6 @@
import org.eclipse.core.databinding.DataBindingContext;
import org.eclipse.core.databinding.beans.BeanProperties;
-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.validation.MultiValidator;
import org.eclipse.core.resources.IProject;
@@ -27,6 +25,7 @@
import org.eclipse.jface.databinding.swt.ISWTObservableValue;
import org.eclipse.jface.databinding.swt.WidgetProperties;
import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.dialogs.PageChangingEvent;
import org.eclipse.jface.fieldassist.AutoCompleteField;
import org.eclipse.jface.fieldassist.ControlDecoration;
import org.eclipse.jface.fieldassist.FieldDecoration;
@@ -217,6 +216,7 @@
return serverAdapterGroup;
}
+ @SuppressWarnings("unused")
private WorkingSetGroup createWorkingSetGroup(Composite container, DataBindingContext dbc) {
return new WorkingSetGroup(container, null, new String[] { "org.eclipse.ui.resourceWorkingSetPage", //$NON-NLS-1$
"org.eclipse.jdt.ui.JavaWorkingSetPage" /* JavaWorkingSetUpdater.ID */});
@@ -301,22 +301,24 @@
}
return status;
}
-
- @Override
- public IObservableList getTargets() {
- WritableList targets = new WritableList();
- targets.add(projectNameObservable);
- return targets;
- }
}
@Override
protected void onPageActivated(DataBindingContext dbc) {
setPageTitle();
+ dbc.updateTargets();
}
-
+
private void setPageTitle() {
setTitle(NLS.bind(PAGE_TITLE_FORMAT, pageModel.getApplicationName()));
}
+
+ @Override
+ protected void onPageWillGetActivated(Direction direction, PageChangingEvent event, DataBindingContext dbc) {
+ if(direction == Direction.FORWARDS) {
+ pageModel.reset();
+ }
+ }
+
}
Modified: branches/jbosstools-3.3.x/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ProjectAndServerAdapterSettingsWizardPageModel.java
===================================================================
--- branches/jbosstools-3.3.x/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ProjectAndServerAdapterSettingsWizardPageModel.java 2012-07-10 06:59:43 UTC (rev 42486)
+++ branches/jbosstools-3.3.x/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ProjectAndServerAdapterSettingsWizardPageModel.java 2012-07-10 14:44:38 UTC (rev 42487)
@@ -85,4 +85,10 @@
public String getApplicationName() {
return wizardModel.getApplicationName();
}
+
+ public void reset() {
+ setNewProject(!wizardModel.isExistingProject());
+ setProjectName(wizardModel.getProjectName());
+ setCreateServerAdapter(wizardModel.isCreateServerAdapter());
+ }
}
More information about the jbosstools-commits
mailing list