Author: adietish
Date: 2011-03-09 07:33:19 -0500 (Wed, 09 Mar 2011)
New Revision: 29646
Modified:
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.core/ChangeLog
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/internal/deltacloud/core/observable/ObservablePojo.java
Log:
[JBIDE-7523] added change notification for username and url
Modified:
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.core/ChangeLog
===================================================================
---
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.core/ChangeLog 2011-03-09
12:11:53 UTC (rev 29645)
+++
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.core/ChangeLog 2011-03-09
12:33:19 UTC (rev 29646)
@@ -1,3 +1,12 @@
+2011-03-09 André Dietisheim <André Dietisheim@adietisheim-thinkpad>
+
+ * src/org/jboss/tools/deltacloud/core/DeltaCloud.java
+ (PROP_URL):
+ (PROP_USERNAME):
+ (updateConnectionProperties):
+ * src/org/jboss/tools/internal/deltacloud/core/observable/ObservablePojo.java
(addPropertyChangeListener):
+ [JBIDE-7523] added change notification for username and url
+
2011-01-11 André Dietisheim <André Dietisheim@adietisheim-thinkpad>
* src/org/jboss/tools/deltacloud/core/client/DeltaCloudClientImpl.java
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-09
12:11:53 UTC (rev 29645)
+++
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloud.java 2011-03-09
12:33:19 UTC (rev 29646)
@@ -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;
}
Modified:
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/internal/deltacloud/core/observable/ObservablePojo.java
===================================================================
---
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/internal/deltacloud/core/observable/ObservablePojo.java 2011-03-09
12:11:53 UTC (rev 29645)
+++
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/internal/deltacloud/core/observable/ObservablePojo.java 2011-03-09
12:33:19 UTC (rev 29646)
@@ -37,6 +37,10 @@
propertyChangeSupport.addPropertyChangeListener(propertyName, listener);
}
+ public void addPropertyChangeListener(PropertyChangeListener listener) {
+ propertyChangeSupport.addPropertyChangeListener(listener);
+ }
+
public void removePropertyChangeListener(String propertyName, PropertyChangeListener
listener) {
propertyChangeSupport.removePropertyChangeListener(propertyName, listener);
}