Author: adietish
Date: 2010-10-11 10:22:13 -0400 (Mon, 11 Oct 2010)
New Revision: 25718
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/WizardMessages.properties
Log:
[JBIDE-7282] [JBIDE-7283] [JBIDE-7284] Error messages externalized, must enter url now
(mandatory form field)
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-11
14:09:08 UTC (rev 25717)
+++
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/CloudConnectionPage.java 2010-10-11
14:22:13 UTC (rev 25718)
@@ -58,6 +58,7 @@
*/
public class CloudConnectionPage extends WizardPage {
+ private static final int CLOUDTYPE_CHECK_DELAY = 500;
private static final String DESCRIPTION = "NewCloudConnection.desc";
//$NON-NLS-1$
private static final String TITLE = "NewCloudConnection.title"; //$NON-NLS-1$
private static final String URL_LABEL = "Url.label"; //$NON-NLS-1$
@@ -71,6 +72,8 @@
private static final String COULD_NOT_OPEN_BROWSER =
"ErrorCouldNotOpenBrowser.text"; //$NON-NLS-1$
private static final String TEST_SUCCESSFUL =
"NewCloudConnectionTest.success"; //$NON-NLS-1$
private static final String TEST_FAILURE = "NewCloudConnectionTest.failure";
//$NON-NLS-1$
+ private static final String MUST_ENTER_A_NAME =
"ErrorMustNameConnection.text"; //$NON-NLS-1$
+ private static final String MUST_ENTER_A_URL = "ErrorMustProvideUrl.text";
//$NON-NLS-1$;
private String defaultName = ""; //$NON-NLS-1$
private String defaultUrl = ""; //$NON-NLS-1$
@@ -148,9 +151,12 @@
Text urlText = new Text(container, SWT.BORDER | SWT.SINGLE);
urlText.setText(defaultUrl);
dbc.bindValue(
- WidgetProperties.text(SWT.Modify).observeDelayed(500, urlText),
+ WidgetProperties.text(SWT.Modify).observeDelayed(CLOUDTYPE_CHECK_DELAY, urlText),
BeanProperties.value(CloudConnectionModel.class, CloudConnectionModel.PROPERTY_URL)
- .observe(connectionModel));
+ .observe(connectionModel),
+ new UpdateValueStrategy().setAfterGetValidator(new MandatoryStringValidator(
+ WizardMessages.getString(MUST_ENTER_A_URL))),
+ null);
// cloud type
Label typeLabel = new Label(container, SWT.NULL);
@@ -371,14 +377,15 @@
.observe(connectionModel),
new UpdateValueStrategy().setBeforeSetValidator(
new CompositeValidator(
- new MandatoryStringValidator("name must be defined"),
+ new MandatoryStringValidator(WizardMessages.getString(MUST_ENTER_A_NAME)),
new IValidator() {
@Override
public IStatus validate(Object value) {
if (nameText.getText() != null
&& DeltaCloudManager.getDefault().findCloud(nameText.getText()) !=
null) {
- return ValidationStatus.error(WizardMessages.getString(NAME_ALREADY_IN_USE));
+ return ValidationStatus
+ .error(WizardMessages.getString(NAME_ALREADY_IN_USE));
} else {
return ValidationStatus.ok();
}
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/WizardMessages.properties
===================================================================
---
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/WizardMessages.properties 2010-10-11
14:09:08 UTC (rev 25717)
+++
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/WizardMessages.properties 2010-10-11
14:22:13 UTC (rev 25718)
@@ -63,6 +63,8 @@
EC2PasswordLink.text=For EC2 use the <a
href="https://console.aws.amazon.com/ec2/home">Access Secret Key</a>
ErrorNameInUse.text=Error: the name chosen is already in use
+ErrorMustNameConnection.text="You must name the connection";
+ErrorMustProvideUrl="You must provide a url for the cloud";
ErrorCouldNotOpenBrowser.text="Could not open url \"{0}\"in
Browser";
ErrorInvalidURL.text=URL specified is invalid
ErrorNonCloudURL.text=URL specified is not a valid Delta-cloud address