Author: adietish
Date: 2011-02-03 12:28:37 -0500 (Thu, 03 Feb 2011)
New Revision: 28981
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/AbstractCloudElementFilter.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/ICloudElementFilter.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/IInstanceFilter.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/ImageFilter.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/InstanceFilter.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloudelements/AbstractCloudElementTableView.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloudelements/ImageView.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloudelements/InstanceView.java
Log:
[JBIDE-8323] updating filtered label now on cloud change and on filter change.
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/AbstractCloudElementFilter.java
===================================================================
---
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/AbstractCloudElementFilter.java 2011-02-03
17:00:38 UTC (rev 28980)
+++
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/AbstractCloudElementFilter.java 2011-02-03
17:28:37 UTC (rev 28981)
@@ -116,8 +116,8 @@
}
public boolean isFiltering() {
- return idRule.isMatchesAll()
- && nameRule.isMatchesAll();
+ return !idRule.isMatchesAll()
+ || !nameRule.isMatchesAll();
}
}
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/ICloudElementFilter.java
===================================================================
---
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/ICloudElementFilter.java 2011-02-03
17:00:38 UTC (rev 28980)
+++
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/ICloudElementFilter.java 2011-02-03
17:28:37 UTC (rev 28981)
@@ -34,4 +34,6 @@
public IFieldMatcher getNameRule();
public IFieldMatcher getIdRule();
+
+ public boolean isFiltering();
}
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/IInstanceFilter.java
===================================================================
---
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/IInstanceFilter.java 2011-02-03
17:00:38 UTC (rev 28980)
+++
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/IInstanceFilter.java 2011-02-03
17:28:37 UTC (rev 28981)
@@ -22,5 +22,4 @@
public IFieldMatcher getKeyNameRule();
public IFieldMatcher getRealmRule();
public IFieldMatcher getProfileRule();
- public boolean isFiltering();
}
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/ImageFilter.java
===================================================================
---
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/ImageFilter.java 2011-02-03
17:00:38 UTC (rev 28980)
+++
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/ImageFilter.java 2011-02-03
17:28:37 UTC (rev 28981)
@@ -80,7 +80,7 @@
public boolean isFiltering() {
return super.isFiltering()
- && archRule.isMatchesAll()
- && descRule.isMatchesAll();
+ || !archRule.isMatchesAll()
+ || !descRule.isMatchesAll();
}
}
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/InstanceFilter.java
===================================================================
---
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/InstanceFilter.java 2011-02-03
17:00:38 UTC (rev 28980)
+++
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/InstanceFilter.java 2011-02-03
17:28:37 UTC (rev 28981)
@@ -130,11 +130,11 @@
public boolean isFiltering() {
return super.isFiltering()
- && aliasRule.isMatchesAll()
- && imageIdRule.isMatchesAll()
- && keyNameRule.isMatchesAll()
- && ownerIdRule.isMatchesAll()
- && profileRule.isMatchesAll()
- && realmRule.isMatchesAll();
+ || !aliasRule.isMatchesAll()
+ || !imageIdRule.isMatchesAll()
+ || !keyNameRule.isMatchesAll()
+ || !ownerIdRule.isMatchesAll()
+ || !profileRule.isMatchesAll()
+ || !realmRule.isMatchesAll();
}
}
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog 2011-02-03 17:00:38
UTC (rev 28980)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog 2011-02-03 17:28:37
UTC (rev 28981)
@@ -1,5 +1,9 @@
2011-02-03 André Dietisheim <André Dietisheim@adietisheim-thinkpad>
+ * src/org/jboss/tools/deltacloud/ui/views/cloudelements/InstanceView.java
(propertyChange):
+ * src/org/jboss/tools/deltacloud/ui/views/cloudelements/ImageView.java (propertyChange):
+ *
src/org/jboss/tools/deltacloud/ui/views/cloudelements/AbstractCloudElementTableView.java
(updateFilteredLabel):
+ [JBIDE-8323] updating filtered label now on cloud change and on filter change.
* src/org/jboss/tools/deltacloud/ui/views/DeltaCloudInstanceColumns.java
(DeltaCloudInstanceColumns):
* src/org/jboss/tools/internal/deltacloud/ui/wizards/WizardMessages.properties:
[JBIDE-8319] added columns imageId, ownerId, key, realm and profile to instance view.
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloudelements/AbstractCloudElementTableView.java
===================================================================
---
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloudelements/AbstractCloudElementTableView.java 2011-02-03
17:00:38 UTC (rev 28980)
+++
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloudelements/AbstractCloudElementTableView.java 2011-02-03
17:28:37 UTC (rev 28981)
@@ -46,6 +46,7 @@
import org.jboss.tools.deltacloud.core.DeltaCloud;
import org.jboss.tools.deltacloud.core.DeltaCloudException;
import org.jboss.tools.deltacloud.core.DeltaCloudManager;
+import org.jboss.tools.deltacloud.core.ICloudElementFilter;
import org.jboss.tools.deltacloud.core.IDeltaCloudElement;
import org.jboss.tools.deltacloud.core.IDeltaCloudManagerListener;
import org.jboss.tools.deltacloud.core.IInstanceFilter;
@@ -77,10 +78,12 @@
private Combo currentCloudSelector;
private Label currentCloudSelectorLabel;
+ private Label filteredLabel;
+ private Composite container;
private TableViewer viewer;
private DeltaCloud currentCloud;
+
private StringPreferenceValue lastSelectedCloudPref;
- private Composite container;
private ModifyListener currentCloudModifyListener = new ModifyListener() {
@@ -101,6 +104,7 @@
@Override
public void run() {
+ updateFilteredLabel();
setViewerInput(currentCloud);
}
});
@@ -173,9 +177,10 @@
createCloudSelector(container);
initCloudSelector(lastSelectedCloudPref.get(), currentCloudSelector, clouds);
- Label filterLabel = new Label(container, SWT.NULL);
- filterLabel.setText(CVMessages.getString(FILTERED_LABEL));
- filterLabel.setToolTipText(CVMessages.getString(FILTERED_TOOLTIP));
+ this.filteredLabel = new Label(container, SWT.NULL);
+ filteredLabel.setText(CVMessages.getString(FILTERED_LABEL));
+ filteredLabel.setToolTipText(CVMessages.getString(FILTERED_TOOLTIP));
+ updateFilteredLabel();
Composite tableArea = new Composite(container, SWT.NULL);
viewer = createTableViewer(tableArea);
@@ -183,7 +188,7 @@
currentCloud = getCloud(currentCloudSelector.getSelectionIndex(), clouds);
addPropertyChangeListener(currentCloud);
setViewerInput(currentCloud);
- setFilterLabelVisible(currentCloud, filterLabel);
+ setFilterLabelVisible(currentCloud, filteredLabel);
Point p1 = currentCloudSelectorLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT);
Point p2 = currentCloudSelector.computeSize(SWT.DEFAULT, SWT.DEFAULT);
@@ -202,7 +207,7 @@
f = new FormData();
f.top = new FormAttachment(0, 5 + centering);
f.right = new FormAttachment(100, -10);
- filterLabel.setLayoutData(f);
+ filteredLabel.setLayoutData(f);
f = new FormData();
f.top = new FormAttachment(currentCloudSelector, 8);
@@ -210,7 +215,7 @@
f.right = new FormAttachment(100, 0);
f.bottom = new FormAttachment(100, 0);
tableArea.setLayoutData(f);
-
+
// Create the help context id for the viewer's control
PlatformUI.getWorkbench().getHelpSystem().setHelp(viewer.getControl(),
"org.jboss.tools.deltacloud.ui.viewer");
hookContextMenu(viewer.getControl());
@@ -458,4 +463,21 @@
return super.getAdapter(adapter);
}
}
+
+ protected void updateFilteredLabel() {
+ filteredLabel.getDisplay().syncExec(new Runnable() {
+
+ @Override
+ public void run() {
+ boolean visible = false;
+ if (currentCloud != null) {
+ ICloudElementFilter<CLOUDELEMENT> filter = getFilter(currentCloud);
+ visible = filter.isFiltering();
+ }
+ filteredLabel.setVisible(visible);
+ }
+ });
+ }
+
+ protected abstract ICloudElementFilter<CLOUDELEMENT> getFilter(DeltaCloud cloud);
}
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloudelements/ImageView.java
===================================================================
---
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloudelements/ImageView.java 2011-02-03
17:00:38 UTC (rev 28980)
+++
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloudelements/ImageView.java 2011-02-03
17:28:37 UTC (rev 28981)
@@ -10,8 +10,11 @@
*******************************************************************************/
package org.jboss.tools.deltacloud.ui.views.cloudelements;
+import java.beans.PropertyChangeEvent;
+
import org.jboss.tools.deltacloud.core.DeltaCloud;
import org.jboss.tools.deltacloud.core.DeltaCloudImage;
+import org.jboss.tools.deltacloud.core.ICloudElementFilter;
import org.jboss.tools.deltacloud.ui.IDeltaCloudPreferenceConstants;
/**
@@ -45,10 +48,23 @@
}
@Override
+ public void propertyChange(PropertyChangeEvent event) {
+ super.propertyChange(event);
+ if (DeltaCloud.PROP_IMAGES.equals(event.getPropertyName())) {
+ updateFilteredLabel();
+ }
+ }
+
+ @Override
protected void addPropertyChangeListener(DeltaCloud cloud) {
if (cloud != null) {
super.addPropertyChangeListener(cloud);
cloud.addPropertyChangeListener(DeltaCloud.PROP_IMAGES, this);
}
}
+
+ @Override
+ protected ICloudElementFilter<DeltaCloudImage> getFilter(DeltaCloud cloud) {
+ return cloud.getImageFilter();
+ }
}
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloudelements/InstanceView.java
===================================================================
---
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloudelements/InstanceView.java 2011-02-03
17:00:38 UTC (rev 28980)
+++
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloudelements/InstanceView.java 2011-02-03
17:28:37 UTC (rev 28981)
@@ -10,10 +10,13 @@
*******************************************************************************/
package org.jboss.tools.deltacloud.ui.views.cloudelements;
+import java.beans.PropertyChangeEvent;
+
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.services.IEvaluationService;
import org.jboss.tools.deltacloud.core.DeltaCloud;
import org.jboss.tools.deltacloud.core.DeltaCloudInstance;
+import org.jboss.tools.deltacloud.core.ICloudElementFilter;
import org.jboss.tools.deltacloud.ui.IDeltaCloudPreferenceConstants;
/**
@@ -51,10 +54,24 @@
}
@Override
+ public void propertyChange(PropertyChangeEvent event) {
+ super.propertyChange(event);
+ if (DeltaCloud.PROP_INSTANCES.equals(event.getPropertyName())) {
+ updateFilteredLabel();
+ }
+ }
+
+ @Override
protected void addPropertyChangeListener(DeltaCloud cloud) {
if (cloud != null) {
super.addPropertyChangeListener(cloud);
cloud.addPropertyChangeListener(DeltaCloud.PROP_INSTANCES, this);
}
}
+
+ @Override
+ protected ICloudElementFilter<DeltaCloudInstance> getFilter(DeltaCloud cloud) {
+ return cloud.getInstanceFilter();
+ }
+
}