Author: adietish
Date: 2011-03-14 05:28:15 -0400 (Mon, 14 Mar 2011)
New Revision: 29744
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/deltacloud/ui/views/cloud/property/CVPropertySheetPage.java
Log:
[JBIDE-7523]
* added change notification for username and url
* listening to changes in DeltaCloud and refreshing properties view
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-03-14
09:25:17 UTC (rev 29743)
+++
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog 2011-03-14
09:28:15 UTC (rev 29744)
@@ -1,3 +1,28 @@
+2011-03-14 André Dietisheim <André Dietisheim@adietisheim-thinkpad>
+
+ * src/org/jboss/tools/deltacloud/ui/views/cloud/property/CVPropertySheetPage.java
+ (cloudPropertyListener):
+ (selectionChanged):
+ (addPropertyChangeListener):
+ (removePropertyChangeListener):
+ [JBIDE-7523] added change notification for username and url,
+ listening to changes in DeltaCloud and refreshing properties view
+
+2011-03-08 André Dietisheim <André Dietisheim@adietisheim-thinkpad>
+
+ * src/org/jboss/tools/internal/deltacloud/ui/wizards/FindImageWizard.java (addPages):
+ * src/org/jboss/tools/internal/deltacloud/ui/wizards/InstanceFilterWizard.java
(addPages):
+ * src/org/jboss/tools/internal/deltacloud/ui/wizards/ImageFilterWizard.java (addPages):
+ * src/org/jboss/tools/internal/deltacloud/ui/wizards/NewCloudConnectionWizard.java
(init):
+ * src/org/jboss/tools/internal/deltacloud/ui/wizards/EditCloudConnectionWizard.java
(init):
+ * src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstanceWizard.java (addPages):
+ [JBIDE-8090] set window titles to wizards
+
+2011-03-08 André Dietisheim <André Dietisheim@adietisheim-thinkpad>
+
+ * src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePage.java
(createWidgets):
+ [JBIDE-8293] added link to SSH2 private keys in preferences
+
2011-02-02 André Dietisheim <André Dietisheim@adietisheim-thinkpad>
* src/org/jboss/tools/internal/deltacloud/ui/wizards/FindImagePage.java
(onImageDoubleclick):
Modified:
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloud/property/CVPropertySheetPage.java
===================================================================
---
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloud/property/CVPropertySheetPage.java 2011-03-14
09:25:17 UTC (rev 29743)
+++
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloud/property/CVPropertySheetPage.java 2011-03-14
09:28:15 UTC (rev 29744)
@@ -10,13 +10,68 @@
*******************************************************************************/
package org.jboss.tools.deltacloud.ui.views.cloud.property;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.views.properties.PropertySheetPage;
+import org.jboss.tools.deltacloud.core.DeltaCloud;
+import org.jboss.tools.deltacloud.ui.views.cloud.CloudItem;
+import org.jboss.tools.internal.deltacloud.ui.utils.WorkbenchUtils;
+/**
+ * @Jeff Johnston
+ * @author André Dietisheim
+ */
public class CVPropertySheetPage extends PropertySheetPage {
-
+
+ private DeltaCloud deltaCloud;
+ private PropertyChangeListener cloudPropertyListener = new PropertyChangeListener() {
+
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+ Display.getDefault().syncExec(new Runnable() {
+
+ @Override
+ public void run() {
+ refresh();
+ }
+ });
+ }
+ };
+
public CVPropertySheetPage() {
super();
setSorter(new CVPropertySheetNonSorter());
}
+ @Override
+ public void selectionChanged(IWorkbenchPart part, ISelection selection) {
+ CloudItem cloudItem = WorkbenchUtils.getFirstAdaptedElement(selection,
CloudItem.class);
+ if (cloudItem != null) {
+ removePropertyChangeListener(this.deltaCloud);
+ DeltaCloud deltaCloud = cloudItem.getModel();
+ if (deltaCloud != null) {
+ addPropertyChangeListener(deltaCloud);
+ this.deltaCloud = deltaCloud;
+ }
+ }
+
+ super.selectionChanged(part, selection);
+ }
+
+ private void addPropertyChangeListener(DeltaCloud deltaCloud) {
+ if (deltaCloud != null) {
+ deltaCloud.addPropertyChangeListener(cloudPropertyListener);
+ }
+ }
+
+ private void removePropertyChangeListener(DeltaCloud deltaCloud) {
+ if (deltaCloud != null) {
+ deltaCloud.removePropertyChangeListener(cloudPropertyListener);
+ }
+ }
+
}
Show replies by date