### Eclipse Workspace Patch 1.0
#P org.jboss.tools.deltacloud.core
Index: src/org/jboss/tools/deltacloud/core/ICloudElementFilter.java
===================================================================
--- src/org/jboss/tools/deltacloud/core/ICloudElementFilter.java	(revision 29760)
+++ src/org/jboss/tools/deltacloud/core/ICloudElementFilter.java	(working copy)
@@ -29,12 +29,6 @@
 
 	public static final String ALL_MATCHER_EXPRESSION = "*"; //$NON-NLS-1$
 
-	public static final String ALL_STRING =
-			ALL_MATCHER_EXPRESSION + EXPRESSION_DELIMITER // name
-					+ ALL_MATCHER_EXPRESSION + EXPRESSION_DELIMITER // id
-					+ ALL_MATCHER_EXPRESSION + EXPRESSION_DELIMITER // arch
-					+ ALL_MATCHER_EXPRESSION; // desc
-
 	public Collection<CLOUDELEMENT> filter(CLOUDELEMENT[] cloudElements) throws DeltaCloudException;
 
 	public void setRules(String ruleString);
@@ -42,4 +36,6 @@
 	public IFieldMatcher getNameRule();
 
 	public IFieldMatcher getIdRule();
+	
+    public boolean isFiltering();
 }
Index: src/org/jboss/tools/deltacloud/core/DeltaCloudInstance.java
===================================================================
--- src/org/jboss/tools/deltacloud/core/DeltaCloudInstance.java	(revision 29564)
+++ src/org/jboss/tools/deltacloud/core/DeltaCloudInstance.java	(working copy)
@@ -86,6 +86,9 @@
 	}
 
 	public String getAlias() {
+		if (alias == null || alias.length() == 0) {
+			return instance.getName();
+		}
 		return alias;
 	}
 
Index: src/org/jboss/tools/deltacloud/core/InstanceFilter.java
===================================================================
--- src/org/jboss/tools/deltacloud/core/InstanceFilter.java	(revision 29564)
+++ src/org/jboss/tools/deltacloud/core/InstanceFilter.java	(working copy)
@@ -31,6 +31,7 @@
 
 	public InstanceFilter(DeltaCloud cloud) {
 		super(cloud);
+		setRules(ALL_STRING);
 	}
 	
 	@Override
Index: src/org/jboss/tools/deltacloud/core/IInstanceFilter.java
===================================================================
--- src/org/jboss/tools/deltacloud/core/IInstanceFilter.java	(revision 29564)
+++ src/org/jboss/tools/deltacloud/core/IInstanceFilter.java	(working copy)
@@ -16,6 +16,15 @@
  */
 public interface IInstanceFilter extends ICloudElementFilter<DeltaCloudInstance> {
 	
+	public static final String ALL_STRING =
+		ALL_MATCHER_EXPRESSION + EXPRESSION_DELIMITER // name
+				+ ALL_MATCHER_EXPRESSION + EXPRESSION_DELIMITER // id
+				+ ALL_MATCHER_EXPRESSION + EXPRESSION_DELIMITER // imageId
+				+ ALL_MATCHER_EXPRESSION + EXPRESSION_DELIMITER // ownerId
+				+ ALL_MATCHER_EXPRESSION + EXPRESSION_DELIMITER // keynameId
+				+ ALL_MATCHER_EXPRESSION + EXPRESSION_DELIMITER // realm
+				+ ALL_MATCHER_EXPRESSION;	// profile
+
 	public IFieldMatcher getImageIdRule();
 	public IFieldMatcher getOwnerIdRule();
 	public IFieldMatcher getKeyNameRule();
Index: src/org/jboss/tools/deltacloud/core/AllFieldMatcher.java
===================================================================
--- src/org/jboss/tools/deltacloud/core/AllFieldMatcher.java	(revision 29760)
+++ src/org/jboss/tools/deltacloud/core/AllFieldMatcher.java	(working copy)
@@ -12,4 +12,8 @@
 		return "*"; //$NON-NLS-1$
 	}
 
+	public boolean isMatchesAll() {
+		return true;
+	}
+
 }
Index: src/org/jboss/tools/deltacloud/core/FieldMatcher.java
===================================================================
--- src/org/jboss/tools/deltacloud/core/FieldMatcher.java	(revision 29760)
+++ src/org/jboss/tools/deltacloud/core/FieldMatcher.java	(working copy)
@@ -56,4 +56,8 @@
 		return rule;
 	}
 
+	public boolean isMatchesAll() {
+		return false;
+	}
+
 }
Index: src/org/jboss/tools/deltacloud/core/AllInstanceFilter.java
===================================================================
--- src/org/jboss/tools/deltacloud/core/AllInstanceFilter.java	(revision 29564)
+++ src/org/jboss/tools/deltacloud/core/AllInstanceFilter.java	(working copy)
@@ -63,8 +63,14 @@
 		return matcher;
 	}
 
+	public boolean isFiltering() {
+		return false;
+	}
+
 	@Override
 	public String toString() {
 		return ALL_STRING;
 	}
+	
+
 }
Index: src/org/jboss/tools/deltacloud/core/IFieldMatcher.java
===================================================================
--- src/org/jboss/tools/deltacloud/core/IFieldMatcher.java	(revision 29760)
+++ src/org/jboss/tools/deltacloud/core/IFieldMatcher.java	(working copy)
@@ -16,5 +16,6 @@
 public interface IFieldMatcher {
 	
 	public boolean matches(String input);
+	public boolean isMatchesAll();
 
 }
Index: src/org/jboss/tools/deltacloud/core/IImageFilter.java
===================================================================
--- src/org/jboss/tools/deltacloud/core/IImageFilter.java	(revision 29564)
+++ src/org/jboss/tools/deltacloud/core/IImageFilter.java	(working copy)
@@ -16,6 +16,12 @@
  */
 public interface IImageFilter extends ICloudElementFilter<DeltaCloudImage> {
 	
+	public static final String ALL_STRING =
+		ALL_MATCHER_EXPRESSION + EXPRESSION_DELIMITER // name
+				+ ALL_MATCHER_EXPRESSION + EXPRESSION_DELIMITER // id
+				+ ALL_MATCHER_EXPRESSION + EXPRESSION_DELIMITER // arch
+				+ ALL_MATCHER_EXPRESSION; // desc
+
 	public IFieldMatcher getArchRule();
 	public IFieldMatcher getDescRule();
 }
Index: src/org/jboss/tools/deltacloud/core/AbstractCloudElementFilter.java
===================================================================
--- src/org/jboss/tools/deltacloud/core/AbstractCloudElementFilter.java	(revision 29764)
+++ src/org/jboss/tools/deltacloud/core/AbstractCloudElementFilter.java	(working copy)
@@ -91,4 +91,9 @@
 	public IFieldMatcher getIdRule() {
 		return idRule;
 	}
+	
+	public boolean isFiltering() {
+		return !idRule.isMatchesAll()
+		|| !nameRule.isMatchesAll();
+	}
 }
Index: src/org/jboss/tools/deltacloud/core/ImageFilter.java
===================================================================
--- src/org/jboss/tools/deltacloud/core/ImageFilter.java	(revision 29760)
+++ src/org/jboss/tools/deltacloud/core/ImageFilter.java	(working copy)
@@ -27,6 +27,7 @@
 
 	public ImageFilter(DeltaCloud cloud) {
 		super(cloud);
+		setRules(ALL_STRING);
 	}
 
 	private IFieldMatcher descRule;
@@ -60,4 +61,11 @@
 	public IFieldMatcher getDescRule() {
 		return descRule;
 	}
+	
+	public boolean isFiltering() {
+		return super.isFiltering()
+				|| !archRule.isMatchesAll()
+				|| !descRule.isMatchesAll();
+	}
+
 }
Index: src/org/jboss/tools/deltacloud/core/AllImageFilter.java
===================================================================
--- src/org/jboss/tools/deltacloud/core/AllImageFilter.java	(revision 29564)
+++ src/org/jboss/tools/deltacloud/core/AllImageFilter.java	(working copy)
@@ -55,6 +55,10 @@
 		return matcher;
 	}
 
+	public boolean isFiltering() {
+		return false;
+	}
+
 	@Override
 	public String toString() {
 		return ALL_STRING;
#P org.jboss.tools.deltacloud.ui
Index: src/org/jboss/tools/deltacloud/ui/views/cloudelements/ImageView.java
===================================================================
--- src/org/jboss/tools/deltacloud/ui/views/cloudelements/ImageView.java	(revision 29760)
+++ src/org/jboss/tools/deltacloud/ui/views/cloudelements/ImageView.java	(working copy)
@@ -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();
+	}
 }
Index: src/org/jboss/tools/deltacloud/ui/views/cloudelements/AbstractCloudElementTableView.java
===================================================================
--- src/org/jboss/tools/deltacloud/ui/views/cloudelements/AbstractCloudElementTableView.java	(revision 29760)
+++ src/org/jboss/tools/deltacloud/ui/views/cloudelements/AbstractCloudElementTableView.java	(working copy)
@@ -13,6 +13,7 @@
 import java.beans.PropertyChangeEvent;
 import java.beans.PropertyChangeListener;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.List;
 
 import org.eclipse.core.runtime.IAdaptable;
@@ -46,6 +47,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;
@@ -55,7 +57,7 @@
 import org.jboss.tools.deltacloud.ui.views.Columns;
 import org.jboss.tools.deltacloud.ui.views.Columns.Column;
 import org.jboss.tools.internal.deltacloud.ui.preferences.StringPreferenceValue;
-import org.jboss.tools.internal.deltacloud.ui.utils.UIUtils;
+import org.jboss.tools.internal.deltacloud.ui.utils.WorkbenchUtils;
 
 /**
  * A common superclass for viewers that operate on IDeltaCloudElements
@@ -77,10 +79,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 +105,7 @@
 
 					@Override
 					public void run() {
+						updateFilteredLabel();
 						setViewerInput(currentCloud);
 					}
 				});
@@ -114,7 +119,7 @@
 		public void selectionChanged(IWorkbenchPart part, ISelection selection) {
 			// we want to listen to selection changes in the deltacloud view
 			// only
-			DeltaCloud cloud = UIUtils.getFirstAdaptedElement(selection, DeltaCloud.class);
+			DeltaCloud cloud = WorkbenchUtils.getFirstAdaptedElement(selection, DeltaCloud.class);
 			if (isNewCloud(cloud)) {
 				int index = getCloudIndex(cloud, getClouds());
 				currentCloudSelector.select(index);
@@ -173,9 +178,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 +189,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 +208,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);
@@ -223,25 +229,22 @@
 	private TableViewer createTableViewer(Composite tableArea) {
 		TableColumnLayout tableLayout = new TableColumnLayout();
 		tableArea.setLayout(tableLayout);
-
-		TableViewer viewer = new TableViewer(tableArea,
-				SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER | SWT.MULTI);
+		TableViewer viewer = new TableViewer(
+				tableArea, SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER | SWT.MULTI);
 		Table table = viewer.getTable();
 		table.setHeaderVisible(true);
 		table.setLinesVisible(true);
 		ITableContentAndLabelProvider<CLOUDELEMENT> provider = getContentAndLabelProvider();
 		viewer.setContentProvider(provider);
 		viewer.setLabelProvider(provider);
-		createColumns(provider, tableLayout, table);
-
+		createColumns(provider.getColumns(), tableLayout, table);
 		viewer.setComparator(new TableViewerColumnComparator());
 		table.setSortDirection(SWT.NONE);
-
 		return viewer;
 	}
 
 	protected abstract ITableContentAndLabelProvider<CLOUDELEMENT> getContentAndLabelProvider();
-	
+
 	private void setViewerInput(DeltaCloud cloud) {
 		viewer.setInput(cloud);
 	}
@@ -295,7 +298,7 @@
 		}
 
 		IInstanceFilter filter = currentCloud.getInstanceFilter();
-		filterLabel.setVisible(!filter.toString().equals(IInstanceFilter.ALL_STRING));
+		filterLabel.setVisible(!filter.isFiltering());
 	}
 
 	private DeltaCloud getCloud(int cloudIndex, DeltaCloud[] clouds) {
@@ -306,17 +309,16 @@
 		return clouds[cloudIndex];
 	}
 
-	private void createColumns(ITableContentAndLabelProvider<CLOUDELEMENT> provider, TableColumnLayout tableLayout, Table table) {
-		Columns<CLOUDELEMENT> columns = provider.getColumns();
-		
+	private void createColumns(Columns<CLOUDELEMENT> columns, TableColumnLayout tableLayout, Table table) {
 		for (int i = 0; i < columns.getSize(); ++i) {
 			Column<CLOUDELEMENT> c = columns.getColumn(i);
 			TableColumn tc = new TableColumn(table, SWT.NONE);
 			if (i == 0) {
 				table.setSortColumn(tc);
 			}
-			tc.setText(CVMessages.getString(c.getName()));
 			tableLayout.setColumnData(tc, new ColumnWeightData(c.getWeight(), true));
+			tc.setText(c.getName());
+			tc.setMoveable(true);
 			tc.addSelectionListener(new ColumnListener(i));
 		}
 	}
@@ -338,8 +340,8 @@
 	}
 
 	private void hookContextMenu(Control control) {
-		IMenuManager contextMenu = UIUtils.createContextMenu(control);
-		UIUtils.registerContributionManager(UIUtils.getContextMenuId(getViewID()), contextMenu, control);
+		IMenuManager contextMenu = WorkbenchUtils.createContextMenu(control);
+		WorkbenchUtils.registerContributionManager(WorkbenchUtils.getContextMenuId(getViewID()), contextMenu, control);
 	}
 
 	protected abstract String getViewID();
@@ -370,37 +372,54 @@
 				if (index >= 0) {
 					int selectionIndex = currentCloudSelector.getSelectionIndex();
 					currentCloudSelector.removeModifyListener(currentCloudModifyListener);
-					currentCloudSelector.setItem(index, cloud.getName());
+					/*
+					 * @see [JBIDE-7862] 
+					 * setting all items seems necessary so that the combo uses the space needed to display the largest cloud name. 
+					 * If you just replace the item that was renamed, the combo will not shrink (it would only get larger if needed).
+					 */
+					currentCloudSelector.setItems(getSelectorItems(cloud, index));
 					currentCloudSelector.select(selectionIndex);
 					currentCloudSelector.addModifyListener(currentCloudModifyListener);
 				}
 				container.layout(true, true);
 				
 			}
+			
+			private String[] getSelectorItems(final DeltaCloud cloud, final int index) {
+				List<String> names = new ArrayList<String>(Arrays.asList(currentCloudSelector.getItems()));
+				names.set(index, cloud.getName());
+				return names.toArray(new String[names.size()]);
+			}
 		});
 	}
 
-	public void cloudsChanged(int type, DeltaCloud cloud) {
-		DeltaCloud[] clouds = getClouds();
-		switch (type) {
-		case IDeltaCloudManagerListener.REMOVE_EVENT:
-			onCloudRemoved(cloud, clouds);
-			break;
-		default:
-		}
-		
-		int index = getCloudIndex(currentCloud, clouds);
-		String[] cloudNames = toCloudNames(clouds);
-		setCloudSelectorItems(cloudNames, currentCloudSelector);
+	public void cloudsChanged(final int type, final DeltaCloud cloud) {
+		viewer.getControl().getDisplay().syncExec(new Runnable() {
 
-		if (cloudNames.length > 0) {
-			currentCloudSelector.setText(cloudNames[index]);
-			setViewerInput(currentCloud);
-		} else {
-			currentCloudSelector.setText("");
-			setViewerInput(null);
+			@Override
+			public void run() {
+				DeltaCloud[] clouds = getClouds();
+				switch (type) {
+				case IDeltaCloudManagerListener.REMOVE_EVENT:
+					onCloudRemoved(cloud, clouds);
+					break;
+				default:
+				}
+
+			int index = getCloudIndex(currentCloud, clouds);
+			String[] cloudNames = toCloudNames(clouds);
+			setCloudSelectorItems(cloudNames, currentCloudSelector);
+
+			if (cloudNames.length > 0) {
+				currentCloudSelector.setText(cloudNames[index]);
+				setViewerInput(currentCloud);
+			} else {
+				currentCloudSelector.setText("");
+				setViewerInput(null);
+			}
+			container.layout(true, true);
 		}
-		container.layout(true, true);
+		});
 	}
 
 	private void onCloudRemoved(DeltaCloud cloud, DeltaCloud[] clouds) {
@@ -463,4 +482,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);
 }
Index: src/org/jboss/tools/deltacloud/ui/views/cloudelements/InstanceView.java
===================================================================
--- src/org/jboss/tools/deltacloud/ui/views/cloudelements/InstanceView.java	(revision 29760)
+++ src/org/jboss/tools/deltacloud/ui/views/cloudelements/InstanceView.java	(working copy)
@@ -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();
+	}
+
 }
