Author: adietish
Date: 2011-10-11 18:52:49 -0400 (Tue, 11 Oct 2011)
New Revision: 35563
Modified:
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationWizardPage.java
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationWizardPageModel.java
Log:
[JBIDE-9793] fixed bug: not showing any error dialog if loading domain/applications fails
since this is an expected usecase. the applications table shall then just stay empty
Modified:
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationWizardPage.java
===================================================================
---
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationWizardPage.java 2011-10-11
22:41:26 UTC (rev 35562)
+++
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationWizardPage.java 2011-10-11
22:52:49 UTC (rev 35563)
@@ -57,6 +57,7 @@
import org.jboss.tools.common.ui.databinding.DataBindingUtils;
import org.jboss.tools.openshift.express.client.IApplication;
import org.jboss.tools.openshift.express.client.IDomain;
+import org.jboss.tools.openshift.express.client.NotFoundOpenshiftException;
import org.jboss.tools.openshift.express.client.OpenshiftException;
import org.jboss.tools.openshift.express.internal.ui.OpenshiftUIActivator;
@@ -189,7 +190,7 @@
private void createDomain() throws OpenshiftException {
if (WizardUtils.openWizardDialog(
new NewDomainDialog(model.getNamespace(), wizardModel), getContainer().getShell()) ==
Dialog.OK) {
- model.updateDomain();
+ model.loadDomain();
}
}
@@ -347,10 +348,14 @@
@Override
protected IStatus run(IProgressMonitor monitor) {
try {
- model.updateDomain();
- final Collection<IApplication> applications = model.getApplications();
+ model.loadDomain();
+ final Collection<IApplication> applications = model.loadApplications();
setViewerInput(applications);
return Status.OK_STATUS;
+ } catch (NotFoundOpenshiftException e) {
+ // no domain and therefore no applications present
+ clearViewer();
+ return Status.OK_STATUS;
} catch (Exception e) {
clearViewer();
return new Status(IStatus.ERROR, OpenshiftUIActivator.PLUGIN_ID,
Modified:
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationWizardPageModel.java
===================================================================
---
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationWizardPageModel.java 2011-10-11
22:41:26 UTC (rev 35562)
+++
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationWizardPageModel.java 2011-10-11
22:52:49 UTC (rev 35563)
@@ -71,12 +71,12 @@
getDomain().setNamespace(namespace);
}
- public void updateDomain() throws OpenshiftException {
+ public void loadDomain() throws OpenshiftException {
setDomain(getUser().getDomain());
}
- public Collection<IApplication> getApplications() throws OpenshiftException {
- IUser user = wizardModel.getUser();
+ public Collection<IApplication> loadApplications() throws OpenshiftException {
+ IUser user = getUser();
if (user == null) {
return Collections.emptyList();
}