Author: adietish
Date: 2010-10-26 05:21:14 -0400 (Tue, 26 Oct 2010)
New Revision: 26048
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloud.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/CloudConnectionPage.java
Log:
[JBIDE-7407] corrected DeltaCloud to return <code>false</code> if listing
instances fails
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloud.java
===================================================================
---
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloud.java 2010-10-26
09:12:32 UTC (rev 26047)
+++
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloud.java 2010-10-26
09:21:14 UTC (rev 26048)
@@ -437,7 +437,7 @@
} catch (DeltaCloudAuthException e) {
return false;
} catch (DeltaCloudClientException e) {
- return true;
+ return false;
}
}
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/CloudConnectionPage.java
===================================================================
---
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/CloudConnectionPage.java 2010-10-26
09:12:32 UTC (rev 26047)
+++
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/CloudConnectionPage.java 2010-10-26
09:21:14 UTC (rev 26048)
@@ -135,6 +135,56 @@
}
}
+ /**
+ * A class that listens to a user click on a button that allows it to test
+ * credentials.
+ *
+ * @see CloudConnection#performTest()
+ */
+ private class CredentialsTestAdapter extends SelectionAdapter implements
IValueChangeListener {
+
+ private ControlDecoration[] controlDecorations;
+
+ public CredentialsTestAdapter(ControlDecoration... controlDecorations) {
+ this.controlDecorations = controlDecorations;
+ setDecorations(false);
+ }
+
+ public void widgetSelected(SelectionEvent event) {
+ boolean success = cloudConnection.performTest();
+ setMessage(success);
+ setDecorations(!success);
+ }
+
+ private void setMessage(boolean success) {
+ if (success) {
+ CloudConnectionPage.this.setMessage(WizardMessages.getString(TEST_SUCCESSFUL));
+ } else {
+ CloudConnectionPage.this.setErrorMessage(WizardMessages.getString(TEST_FAILURE));
+ }
+ }
+
+ private void clearMessage() {
+ CloudConnectionPage.this.setMessage(""); //$NON-NLS-1$
+ }
+
+ private void setDecorations(boolean visible) {
+ for (ControlDecoration controlDecoration : controlDecorations) {
+ if (visible) {
+ controlDecoration.show();
+ } else {
+ controlDecoration.hide();
+ }
+ }
+ }
+
+ @Override
+ public void handleValueChange(ValueChangeEvent event) {
+ setDecorations(false);
+ clearMessage();
+ }
+ }
+
public CloudConnectionPage(String pageName, CloudConnection cloudConnection) {
super(pageName);
setDescription(WizardMessages.getString(DESCRIPTION));
@@ -415,48 +465,4 @@
public CloudConnectionModel getModel() {
return connectionModel;
}
-
- private class CredentialsTestAdapter extends SelectionAdapter implements
IValueChangeListener {
-
- private ControlDecoration[] controlDecorations;
-
- public CredentialsTestAdapter(ControlDecoration... controlDecorations) {
- this.controlDecorations = controlDecorations;
- setDecorations(false);
- }
-
- public void widgetSelected(SelectionEvent event) {
- boolean success = cloudConnection.performTest();
- setMessage(success);
- setDecorations(!success);
- }
-
- private void setMessage(boolean success) {
- if (success) {
- CloudConnectionPage.this.setMessage(WizardMessages.getString(TEST_SUCCESSFUL));
- } else {
- CloudConnectionPage.this.setErrorMessage(WizardMessages.getString(TEST_FAILURE));
- }
- }
-
- private void clearMessage() {
- CloudConnectionPage.this.setMessage(""); //$NON-NLS-1$
- }
-
- private void setDecorations(boolean visible) {
- for (ControlDecoration controlDecoration : controlDecorations) {
- if (visible) {
- controlDecoration.show();
- } else {
- controlDecoration.hide();
- }
- }
- }
-
- @Override
- public void handleValueChange(ValueChangeEvent event) {
- setDecorations(false);
- clearMessage();
- }
- }
}
Show replies by date