### Eclipse Workspace Patch 1.0
#P org.jboss.tools.deltacloud.ui
Index: plugin.xml
===================================================================
--- plugin.xml	(revision 29564)
+++ plugin.xml	(working copy)
@@ -296,41 +296,31 @@
       <handler
             class="org.jboss.tools.deltacloud.ui.commands.FilterImagesHandler"
             commandId="org.jboss.tools.deltacloud.ui.filterimages">
-			<activeWhen>
-               <with
-                     variable="selection">
-					<iterate operator="and">
-							<adapt
-					             type="org.jboss.tools.deltacloud.core.DeltaCloud">								
-			               	</adapt>
-	               	</iterate>
-               </with>
-			</activeWhen>
 			<enabledWhen>
-				<with
-					variable="selection">
-					<count value="+" />
-				</with>
+				<or>
+					<with
+						variable="selection">
+						<count value="1" />
+					</with>
+					<with variable="activePartId">
+          				<equals value="org.jboss.tools.deltacloud.ui.views.ImageView"/>
+       				</with>
+   				</or>
 			</enabledWhen>
       </handler>
       <handler
             class="org.jboss.tools.deltacloud.ui.commands.FilterInstancesHandler"
             commandId="org.jboss.tools.deltacloud.ui.filterinstances">
-			<activeWhen>
-               <with
-                     variable="selection">
-					<iterate operator="and">
-							<adapt
-					             type="org.jboss.tools.deltacloud.core.DeltaCloud">								
-			               	</adapt>
-	               	</iterate>
-               </with>
-			</activeWhen>
 			<enabledWhen>
-				<with
-					variable="selection">
-					<count value="+" />
-				</with>
+				<or>
+					<with
+						variable="selection">
+						<count value="1" />
+					</with>
+					<with variable="activePartId">
+          				<equals value="org.jboss.tools.deltacloud.ui.views.InstanceView"/>
+       				</with>
+   				</or>
 			</enabledWhen>
       </handler>
    </extension>
Index: src/org/jboss/tools/deltacloud/ui/commands/FilterInstancesHandler.java
===================================================================
--- src/org/jboss/tools/deltacloud/ui/commands/FilterInstancesHandler.java	(revision 29564)
+++ src/org/jboss/tools/deltacloud/ui/commands/FilterInstancesHandler.java	(working copy)
@@ -36,7 +36,13 @@
 		ISelection selection = HandlerUtil.getCurrentSelection(event);
 		if (selection instanceof IStructuredSelection) {
 			DeltaCloud deltaCloud = UIUtils.getFirstAdaptedElement(selection, DeltaCloud.class);
-			createInstancesFilter(deltaCloud, HandlerUtil.getActiveShell(event));
+			if (deltaCloud != null) {
+				createInstancesFilter(deltaCloud, HandlerUtil.getActiveShell(event));
+			} else {
+				// no item selected: try active part
+				deltaCloud = UIUtils.adapt(HandlerUtil.getActivePart(event), DeltaCloud.class);
+				createInstancesFilter(deltaCloud, HandlerUtil.getActiveShell(event));
+			}
 		}
 
 		return Status.OK_STATUS;
Index: src/org/jboss/tools/deltacloud/ui/commands/FilterImagesHandler.java
===================================================================
--- src/org/jboss/tools/deltacloud/ui/commands/FilterImagesHandler.java	(revision 29564)
+++ src/org/jboss/tools/deltacloud/ui/commands/FilterImagesHandler.java	(working copy)
@@ -35,8 +35,14 @@
 	public Object execute(ExecutionEvent event) throws ExecutionException {
 		ISelection selection = HandlerUtil.getCurrentSelection(event);
 		if (selection instanceof IStructuredSelection) {
-			DeltaCloud cloud = UIUtils.getFirstAdaptedElement(selection, DeltaCloud.class);
-			createImagesFilter(cloud, HandlerUtil.getActiveShell(event));
+			DeltaCloud deltaCloud = UIUtils.getFirstAdaptedElement(selection, DeltaCloud.class);
+			if (deltaCloud != null) {
+				createImagesFilter(deltaCloud, HandlerUtil.getActiveShell(event));
+			} else {
+				// no item selected: try active part
+				deltaCloud = UIUtils.adapt(HandlerUtil.getActivePart(event), DeltaCloud.class);
+				createImagesFilter(deltaCloud, HandlerUtil.getActiveShell(event));
+			}
 		}
 
 		return Status.OK_STATUS;
@@ -44,15 +50,15 @@
 
 	private void createImagesFilter(final DeltaCloud cloud, final Shell shell) {
 		if (cloud != null) {
-				Display.getDefault().asyncExec(new Runnable() {
-					@Override
-					public void run() {
-						IWizard wizard = new ImageFilterWizard(cloud);
-						WizardDialog dialog = new WizardDialog(shell, wizard);
-						dialog.create();
-						dialog.open();
-					}
-				});
+			Display.getDefault().asyncExec(new Runnable() {
+				@Override
+				public void run() {
+					IWizard wizard = new ImageFilterWizard(cloud);
+					WizardDialog dialog = new WizardDialog(shell, wizard);
+					dialog.create();
+					dialog.open();
+				}
+			});
 
 		}
 	}
