Author: adietish
Date: 2011-04-04 05:09:32 -0400 (Mon, 04 Apr 2011)
New Revision: 30263
Modified:
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/preferences/IPreferenceKeys.java
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/CloudConnectionPage.java
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/EditCloudConnectionWizard.java
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewCloudConnectionWizard.java
Log:
[JBIDE-8259] storing/restoring last used cloud name and username from preferences
Modified:
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog
===================================================================
---
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog 2011-04-04
07:37:21 UTC (rev 30262)
+++
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog 2011-04-04
09:09:32 UTC (rev 30263)
@@ -1,3 +1,22 @@
+2011-04-04 André Dietisheim <André Dietisheim@adietisheim-thinkpad>
+
+ * src/org/jboss/tools/internal/deltacloud/ui/wizards/EditCloudConnectionWizard.java
(performFinish):
+ * src/org/jboss/tools/internal/deltacloud/ui/wizards/NewCloudConnectionWizard.java
(performFinish):
+ * src/org/jboss/tools/internal/deltacloud/ui/wizards/CloudConnectionPage.java
(createControl):
+ * src/org/jboss/tools/internal/deltacloud/ui/preferences/IPreferenceKeys.java
+ (LAST_NAME):
+ (LAST_USERNAME):
+ [JBIDE-8259] storing/restoring last used cloud name and username from preferences
+
+2011-04-01 André Dietisheim <André Dietisheim@adietisheim-thinkpad>
+
+ * plugin.xml:
+ [JBIDE-8662] removed visibility rule for "Launch instance" in cloud viewer
+ * src/org/jboss/tools/internal/deltacloud/ui/wizards/CloudConnectionPageModel.java
+ (prependHttp):
+ (CloudConnectionPageModel):
+ [JBIDE-8599] prepending "http://" if url is empty
+
2011-03-31 André Dietisheim <André Dietisheim@adietisheim-thinkpad>
* src/org/jboss/tools/deltacloud/ui/commands/CreateInstanceFromAnyImageHandler.java:
Modified:
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/preferences/IPreferenceKeys.java
===================================================================
---
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/preferences/IPreferenceKeys.java 2011-04-04
07:37:21 UTC (rev 30262)
+++
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/preferences/IPreferenceKeys.java 2011-04-04
09:09:32 UTC (rev 30263)
@@ -12,6 +12,8 @@
public class IPreferenceKeys {
+ public static final String LAST_NAME =
"org.jboss.tools.internal.deltacloud.ui.wizards.LAST_NAME";
public static final String LAST_URL =
"org.jboss.tools.internal.deltacloud.ui.wizards.LAST_CREATED_URL";
+ public static final String LAST_USERNAME =
"org.jboss.tools.internal.deltacloud.ui.wizards.LAST_USERNAME";
}
Modified:
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/CloudConnectionPage.java
===================================================================
---
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/CloudConnectionPage.java 2011-04-04
07:37:21 UTC (rev 30262)
+++
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/CloudConnectionPage.java 2011-04-04
09:09:32 UTC (rev 30263)
@@ -316,12 +316,19 @@
nameLabel.setText(WizardMessages.getString(NAME_LABEL));
Text nameText = new Text(container, SWT.BORDER | SWT.SINGLE);
bindName(dbc, nameText);
+ String name =
+ new StringPreferenceValue(IPreferenceKeys.LAST_NAME,
Activator.PLUGIN_ID).get(nameText.getText());
+
+ nameText.setText(name);
// url
Label urlLabel = new Label(container, SWT.NULL);
urlLabel.setText(WizardMessages.getString(URL_LABEL));
Point p1 = urlLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT);
Text urlText = new Text(container, SWT.BORDER | SWT.SINGLE);
+ String url =
+ new StringPreferenceValue(IPreferenceKeys.LAST_URL,
Activator.PLUGIN_ID).get(urlText.getText());
+ connectionModel.setUrl(url);
dbc.bindValue(
WidgetProperties.text(SWT.Modify).observe(urlText),
@@ -346,12 +353,6 @@
new ControlDecorationAdapter(decoration, (IStatus)
validationStatusProvider.getValue()),
typeLabelBinding.getValidationStatus(), urlText);
-
- // set url from preferences
- String url =
- new StringPreferenceValue(IPreferenceKeys.LAST_URL,
Activator.PLUGIN_ID).get(urlText.getText());
- urlText.setText(url);
-
// username
Label usernameLabel = new Label(container, SWT.NULL);
usernameLabel.setText(WizardMessages.getString(USERNAME_LABEL));
@@ -361,7 +362,10 @@
usernameObservable,
BeanProperties.value(CloudConnectionPageModel.class,
CloudConnectionPageModel.PROPERTY_USERNAME)
.observe(connectionModel));
-
+ String username =
+ new StringPreferenceValue(IPreferenceKeys.LAST_USERNAME,
Activator.PLUGIN_ID).get(usernameText.getText());
+ usernameText.setText(username);
+
// password
Label passwordLabel = new Label(container, SWT.NULL);
passwordLabel.setText(WizardMessages.getString(PASSWORD_LABEL));
Modified:
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/EditCloudConnectionWizard.java
===================================================================
---
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/EditCloudConnectionWizard.java 2011-04-04
07:37:21 UTC (rev 30262)
+++
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/EditCloudConnectionWizard.java 2011-04-04
09:09:32 UTC (rev 30263)
@@ -19,6 +19,9 @@
import org.jboss.tools.deltacloud.core.DeltaCloud;
import org.jboss.tools.deltacloud.core.Driver;
import org.jboss.tools.deltacloud.core.job.AbstractCloudJob;
+import org.jboss.tools.deltacloud.ui.Activator;
+import org.jboss.tools.internal.deltacloud.ui.preferences.IPreferenceKeys;
+import org.jboss.tools.internal.deltacloud.ui.preferences.StringPreferenceValue;
import org.jboss.tools.internal.deltacloud.ui.utils.WizardUtils;
/**
@@ -41,8 +44,17 @@
@Override
public boolean performFinish() {
String name = mainPage.getModel().getName();
+ new StringPreferenceValue(IPreferenceKeys.LAST_NAME, Activator.PLUGIN_ID)
+ .store(name);
+
String url = mainPage.getModel().getUrl();
+ new StringPreferenceValue(IPreferenceKeys.LAST_URL, Activator.PLUGIN_ID)
+ .store(url);
+
String username = mainPage.getModel().getUsername();
+ new StringPreferenceValue(IPreferenceKeys.LAST_USERNAME, Activator.PLUGIN_ID)
+ .store(username);
+
String password = mainPage.getModel().getPassword();
Driver driver = mainPage.getModel().getDriver();
return editCloud(initialCloud, name, url, username, password, driver);
Modified:
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewCloudConnectionWizard.java
===================================================================
---
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewCloudConnectionWizard.java 2011-04-04
07:37:21 UTC (rev 30262)
+++
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewCloudConnectionWizard.java 2011-04-04
09:09:32 UTC (rev 30263)
@@ -109,12 +109,17 @@
@Override
public boolean performFinish() {
String name = mainPage.getModel().getName();
+ new StringPreferenceValue(IPreferenceKeys.LAST_NAME, Activator.PLUGIN_ID)
+ .store(name);
+
String url = mainPage.getModel().getUrl();
-
new StringPreferenceValue(IPreferenceKeys.LAST_URL, Activator.PLUGIN_ID)
.store(url);
String username = mainPage.getModel().getUsername();
+ new StringPreferenceValue(IPreferenceKeys.LAST_USERNAME, Activator.PLUGIN_ID)
+ .store(username);
+
String password = mainPage.getModel().getPassword();
Driver driver = mainPage.getModel().getDriver();
@@ -122,7 +127,7 @@
}
private boolean createCloud(final String name, final String url, final String username,
final String password,
- final Driver driver) {
+ final Driver driver) {
Job job = new Job(WizardMessages.getFormattedString("CloudConnection.msg",
name)) {
@Override