Author: adietish
Date: 2011-03-14 05:24:52 -0400 (Mon, 14 Mar 2011)
New Revision: 29742
Modified:
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloud.java
Log:
[JBIDE-7523] added change notification for username and url
Modified:
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloud.java
===================================================================
---
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloud.java 2011-03-14
04:29:38 UTC (rev 29741)
+++
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloud.java 2011-03-14
09:24:52 UTC (rev 29742)
@@ -41,6 +41,8 @@
public static final String PROP_INSTANCES_REMOVED = "instancesRemoved";
public static final String PROP_IMAGES = "images";
public static final String PROP_NAME = "name";
+ public static final String PROP_URL = "url";
+ public static final String PROP_USERNAME = "username";
private String name;
private String username;
@@ -124,11 +126,11 @@
private boolean updateConnectionProperties(String url, String username, String password)
throws DeltaCloudException {
boolean changed = false;
if (!equals(this.url, url)) {
- this.url = url;
+ setUrl(url);
changed = true;
}
if (!equals(this.username, username)) {
- this.username = username;
+ setUsername(username);
changed = true;
}
if (!equals(this.passwordStore.getPassword(), password)) {
@@ -161,10 +163,18 @@
return name;
}
+ private void setUrl(String url) {
+ firePropertyChange(PROP_URL, this.url, this.url = url);
+ }
+
public String getURL() {
return url;
}
+ private void setUsername(String username) {
+ firePropertyChange(PROP_USERNAME, this.username, this.username = username);
+ }
+
public String getUsername() {
return username;
}