Author: xcoulon
Date: 2012-02-22 15:20:19 -0500 (Wed, 22 Feb 2012)
New Revision: 39012
Modified:
branches/jbosstools-3.3.0.Beta1/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPage.java
branches/jbosstools-3.3.0.Beta1/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPageModel.java
Log:
Fixed - Error in wizard when typing complete existing application name
https://issues.jboss.org/browse/JBIDE-11002
Modified:
branches/jbosstools-3.3.0.Beta1/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPage.java
===================================================================
---
branches/jbosstools-3.3.0.Beta1/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPage.java 2012-02-22
19:24:50 UTC (rev 39011)
+++
branches/jbosstools-3.3.0.Beta1/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPage.java 2012-02-22
20:20:19 UTC (rev 39012)
@@ -161,7 +161,7 @@
ApplicationConfigurationWizardPageModel.PROPERTY_EXISTING_APPLICATION_NAME).observe(pageModel);
ValueBindingBuilder.bind(existingAppNameTextObservable).to(existingAppNameModelObservable).in(dbc);
UIUtils.focusOnSelection(useExistingAppBtn, existingAppNameText);
- createContentAssist(existingAppNameText);
+ createExistingAppNameContentAssist();
this.browseAppsButton = new Button(existingAppSelectionGroup, SWT.NONE);
browseAppsButton.setText("Browse...");
@@ -181,7 +181,7 @@
return existingAppSelectionGroup;
}
- private void createContentAssist(final Text existingAppNameText) {
+ private void createExistingAppNameContentAssist() {
ControlDecoration dec = new ControlDecoration(existingAppNameText, SWT.TOP |
SWT.LEFT);
FieldDecoration contentProposalFieldIndicator =
FieldDecorationRegistry.getDefault().getFieldDecoration(
FieldDecorationRegistry.DEC_CONTENT_PROPOSAL);
@@ -638,6 +638,7 @@
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
Modified:
branches/jbosstools-3.3.0.Beta1/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPageModel.java
===================================================================
---
branches/jbosstools-3.3.0.Beta1/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPageModel.java 2012-02-22
19:24:50 UTC (rev 39011)
+++
branches/jbosstools-3.3.0.Beta1/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPageModel.java 2012-02-22
20:20:19 UTC (rev 39012)
@@ -111,18 +111,21 @@
return existingApplicationName;
}
- public void setExistingApplicationName(String applicationName) {
+ public void setExistingApplicationName(String applicationName) throws OpenShiftException
{
firePropertyChange(PROPERTY_EXISTING_APPLICATION_NAME
, existingApplicationName
, this.existingApplicationName = applicationName);
- }
-
- protected void setExistingApplicationName(IApplication application) {
- String applicationName = null;
- if (application != null) {
- applicationName = application.getName();
+ if (applicationName != null) {
+ for (IApplication application : getApplications()) {
+ if (application.getName().equals(applicationName)) {
+ setApplicationName(application.getName());
+ setSelectedCartridge(application.getCartridge());
+ setSelectedEmbeddableCartridges(new HashSet<IEmbeddableCartridge>(
+ application.getEmbeddedCartridges()));
+ }
+ }
}
- setExistingApplicationName(applicationName);
+
}
public void loadExistingApplications() throws OpenShiftException {
@@ -213,11 +216,12 @@
}
public void setExistingApplication(IApplication application) throws OpenShiftException
{
- // setUseExistingApplication(application);
- setExistingApplicationName(application);
- setApplicationName(application);
- setSelectedCartridge(application);
- setSelectedEmbeddableCartridges(application);
+ if(application != null) {
+ setExistingApplicationName(application.getName());
+ setApplicationName(application.getName());
+ setSelectedCartridge(application.getCartridge());
+ setSelectedEmbeddableCartridges(new
HashSet<IEmbeddableCartridge>(application.getEmbeddedCartridges()));
+ }
wizardModel.setApplication(application);
}
@@ -262,14 +266,6 @@
wizardModel.setSelectedEmbeddableCartridges(selectedEmbeddableCartridges));
}
- protected void setSelectedEmbeddableCartridges(IApplication application) throws
OpenShiftException {
- HashSet<IEmbeddableCartridge> selectedEmbeddableCartridges = new
HashSet<IEmbeddableCartridge>();
- if (application != null) {
- selectedEmbeddableCartridges.addAll(application.getEmbeddedCartridges());
- }
- setSelectedEmbeddableCartridges(selectedEmbeddableCartridges);
- }
-
public boolean hasApplication(ICartridge cartridge) {
try {
return getUser().hasApplication(cartridge);