Author: adietish
Date: 2011-02-07 05:46:04 -0500 (Mon, 07 Feb 2011)
New Revision: 29035
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/utils/UIUtils.java
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/NewInstancePage.java
Log:
[JBIDE-8340] changed keys since using slash seems not working
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/utils/UIUtils.java
===================================================================
---
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/utils/UIUtils.java 2011-02-07
10:20:46 UTC (rev 29034)
+++
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/utils/UIUtils.java 2011-02-07
10:46:04 UTC (rev 29035)
@@ -36,7 +36,7 @@
*/
public class UIUtils {
- public static ContentProposalAdapter addPreferencesProposalAdapter(final Text text,
String preferencesKey) {
+ public static ContentProposalAdapter createPreferencesProposalAdapter(final Text text,
String preferencesKey) {
final ControlDecoration decoration = createContenAssistDecoration(text);
final StringsPreferenceValue preferencesValues =
@@ -53,9 +53,11 @@
@Override
public void focusLost(FocusEvent e) {
decoration.hide();
-
- preferencesValues.add(text.getText());
- preferencesValues.store();
+ String value = text.getText();
+ if (value != null && value.length() > 0) {
+ preferencesValues.add(text.getText());
+ preferencesValues.store();
+ }
}
});
@@ -76,7 +78,7 @@
decoration.hide();
return decoration;
}
-
+
public static ControlDecoration createErrorDecoration(String errorText, Control control)
{
return createDecoration(errorText, FieldDecorationRegistry.DEC_ERROR, control);
}
@@ -94,7 +96,8 @@
/**
* Opens a confirmation dialog that offers a checkbox that allows the user
- * to turn further aksing off. The checkbox state is stored to the preferences
+ * to turn further aksing off. The checkbox state is stored to the
+ * preferences
*
* @param title
* dialog title
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 2011-02-07
10:20:46 UTC (rev 29034)
+++
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/CloudConnectionPage.java 2011-02-07
10:46:04 UTC (rev 29035)
@@ -74,9 +74,9 @@
*/
public class CloudConnectionPage extends WizardPage {
- private static final String NAME_PROPOSAL_KEY = "cloud/name";
- private static final String USERNAME_PROPOSAL_KEY = "cloud/username";
- private static final String URL_PROPOSAL_KEY = "cloud/url";
+ private static final String NAME_PROPOSAL_KEY = "cloud_name";
+ private static final String USERNAME_PROPOSAL_KEY = "cloud_username";
+ private static final String URL_PROPOSAL_KEY = "cloud_url";
private static final int CLOUDTYPE_CHECK_DELAY = 1000;
@@ -335,7 +335,7 @@
Label nameLabel = new Label(container, SWT.NULL);
nameLabel.setText(WizardMessages.getString(NAME_LABEL));
Text nameText = new Text(container, SWT.BORDER | SWT.SINGLE);
- UIUtils.addPreferencesProposalAdapter(nameText, NAME_PROPOSAL_KEY);
+ UIUtils.createPreferencesProposalAdapter(nameText, NAME_PROPOSAL_KEY);
bindName(dbc, nameText);
// url
@@ -343,7 +343,7 @@
urlLabel.setText(WizardMessages.getString(URL_LABEL));
Point p1 = urlLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT);
Text urlText = new Text(container, SWT.BORDER | SWT.SINGLE);
- UIUtils.addPreferencesProposalAdapter(urlText, URL_PROPOSAL_KEY);
+ UIUtils.createPreferencesProposalAdapter(urlText, URL_PROPOSAL_KEY);
dbc.bindValue(
WidgetProperties.text(SWT.Modify).observe(urlText),
BeanProperties.value(
@@ -368,7 +368,7 @@
Label usernameLabel = new Label(container, SWT.NULL);
usernameLabel.setText(WizardMessages.getString(USERNAME_LABEL));
Text usernameText = new Text(container, SWT.BORDER | SWT.SINGLE);
- UIUtils.addPreferencesProposalAdapter(usernameText, USERNAME_PROPOSAL_KEY);
+ UIUtils.createPreferencesProposalAdapter(usernameText, USERNAME_PROPOSAL_KEY);
IObservableValue usernameObservable =
WidgetProperties.text(SWT.Modify).observe(usernameText);
dbc.bindValue(
usernameObservable,
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePage.java
===================================================================
---
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePage.java 2011-02-07
10:20:46 UTC (rev 29034)
+++
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePage.java 2011-02-07
10:46:04 UTC (rev 29035)
@@ -80,9 +80,9 @@
*/
public class NewInstancePage extends WizardPage {
- private static final String NAME_PROPOSAL_KEY = "instance/name";
- private static final String IMAGE_PROPOSAL_KEY = "instance/image";
- private static final String KEY_PROPOSAL_KEY = "instance/key";
+ private static final String NAME_PROPOSAL_KEY = "instance_ame";
+ private static final String IMAGE_PROPOSAL_KEY = "instance_image";
+ private static final String KEY_PROPOSAL_KEY = "instance_key";
private static final int IMAGE_CHECK_DELAY = 500;
private static final int KEY_CHECK_DELAY = 500;
@@ -180,14 +180,14 @@
nameLabel.setText(WizardMessages.getString(NAME_LABEL));
GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).applyTo(nameLabel);
this.nameText = new Text(container, SWT.BORDER | SWT.SINGLE);
- UIUtils.addPreferencesProposalAdapter(nameText, NAME_PROPOSAL_KEY);
+ UIUtils.createPreferencesProposalAdapter(nameText, NAME_PROPOSAL_KEY);
GridDataFactory.fillDefaults().span(2, 1).grab(true, false).applyTo(nameText);
Label imageLabel = new Label(container, SWT.NULL);
imageLabel.setText(WizardMessages.getString(IMAGE_LABEL));
GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).applyTo(imageLabel);
this.imageText = new Text(container, SWT.BORDER | SWT.SINGLE);
- UIUtils.addPreferencesProposalAdapter(imageText, IMAGE_PROPOSAL_KEY);
+ UIUtils.createPreferencesProposalAdapter(imageText, IMAGE_PROPOSAL_KEY);
GridDataFactory.fillDefaults().grab(true, false).align(SWT.FILL,
SWT.CENTER).applyTo(imageText);
Button findImageButton = new Button(container, SWT.NULL);
findImageButton.setText(WizardMessages.getString(FIND_BUTTON_LABEL));
@@ -212,7 +212,7 @@
keyLabel.setText(WizardMessages.getString(KEY_LABEL));
GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).applyTo(keyLabel);
keyText = new Text(container, SWT.BORDER | SWT.SINGLE);
- UIUtils.addPreferencesProposalAdapter(keyText, KEY_PROPOSAL_KEY);
+ UIUtils.createPreferencesProposalAdapter(keyText, KEY_PROPOSAL_KEY);
GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).applyTo(keyText);
Button keyManageButton = new Button(container, SWT.NULL);
keyManageButton.setText(WizardMessages.getString(MANAGE_BUTTON_LABEL));