Author: adietish
Date: 2010-10-14 11:30:40 -0400 (Thu, 14 Oct 2010)
New Revision: 25832
Added:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/FilterImagesHandler.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/FilterInstancesHandler.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/RefreshCloudHandler.java
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/plugin.xml
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVMessages.properties
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/DeltaCloudView.java
Log:
[JBIDE-7329] implemented filter commands (instance & image)
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/plugin.xml
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/plugin.xml 2010-10-14 15:10:58
UTC (rev 25831)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/plugin.xml 2010-10-14 15:30:40
UTC (rev 25832)
@@ -137,6 +137,20 @@
</with>
</activeWhen>
</handler>
+ <handler
+ class="org.jboss.tools.deltacloud.ui.commands.RefreshCloudHandler"
+ commandId="org.eclipse.ui.file.refresh">
+ <activeWhen>
+ <with
+ variable="selection">
+ <iterate>
+ <instanceof
+
value="org.jboss.tools.deltacloud.ui.views.CloudViewElement">
+ </instanceof>
+ </iterate>
+ </with>
+ </activeWhen>
+ </handler>
<!-- instance command handlers -->
<handler
class="org.jboss.tools.deltacloud.ui.commands.StartInstanceHandler"
@@ -209,10 +223,38 @@
</with>
</activeWhen>
</handler>
+ <!-- Filter handlers -->
+ <handler
+ class="org.jboss.tools.deltacloud.ui.commands.FilterImagesHandler"
+ commandId="org.jboss.tools.deltacloud.ui.filterimages">
+ <activeWhen>
+ <with
+ variable="selection">
+ <iterate>
+ <instanceof
+
value="org.jboss.tools.deltacloud.ui.views.CloudViewElement">
+ </instanceof>
+ </iterate>
+ </with>
+ </activeWhen>
+ </handler>
+ <handler
+
class="org.jboss.tools.deltacloud.ui.commands.FilterInstancesHandler"
+ commandId="org.jboss.tools.deltacloud.ui.filterinstances">
+ <activeWhen>
+ <with
+ variable="selection">
+ <iterate>
+ <instanceof
+
value="org.jboss.tools.deltacloud.ui.views.CloudViewElement">
+ </instanceof>
+ </iterate>
+ </with>
+ </activeWhen>
+ </handler>
</extension>
- <extension
- point="org.eclipse.ui.menus">
- <!-- DeltaCloudView context menu -->
+ <extension point="org.eclipse.ui.menus">
+ <!-- DeltaCloudView context menu ================================== -->
<menuContribution
allPopups="true"
locationURI="popup:org.jboss.tools.deltacloud.ui.views.DeltaCloudView">
@@ -235,6 +277,12 @@
style="push"
tooltip="Edit Conncetion">
</command>
+ <command
+ commandId="org.eclipse.ui.file.refresh"
+ label="Refresh Cloud"
+ style="push"
+ tooltip="Refresh Cloud">
+ </command>
<!-- image commands -->
<command
commandId="org.jboss.tools.deltacloud.ui.createinstance"
@@ -329,8 +377,42 @@
</with>
</visibleWhen>
</command>
+ <command
+ commandId="org.jboss.tools.deltacloud.ui.filterimages"
+ label="Filter images..."
+ style="push"
+ tooltip="Filter Images...">
+ <visibleWhen
+ checkEnabled="true">
+ <with
+ variable="selection">
+ <iterate>
+ <instanceof
+
value="org.jboss.tools.deltacloud.ui.views.CloudViewElement">
+ </instanceof>
+ </iterate>
+ </with>
+ </visibleWhen>
+ </command>
+ <command
+ commandId="org.jboss.tools.deltacloud.ui.filterinstances"
+ label="Filter Instances..."
+ style="push"
+ tooltip="Filter Instances...">
+ <visibleWhen
+ checkEnabled="true">
+ <with
+ variable="selection">
+ <iterate>
+ <instanceof
+
value="org.jboss.tools.deltacloud.ui.views.CloudViewElement">
+ </instanceof>
+ </iterate>
+ </with>
+ </visibleWhen>
+ </command>
</menuContribution>
- <!-- DeltaCloudView local menu -->
+ <!-- DeltaCloudView local menu ========================================= -->
<menuContribution
allPopups="true"
locationURI="menu:org.jboss.tools.deltacloud.ui.views.DeltaCloudView">
@@ -447,8 +529,43 @@
</with>
</visibleWhen>
</command>
+ <command
+ commandId="org.jboss.tools.deltacloud.ui.filterimages"
+ label="Filter Images..."
+ style="push"
+ tooltip="Filter Images...">
+ <visibleWhen
+ checkEnabled="true">
+ <with
+ variable="selection">
+ <iterate>
+ <instanceof
+
value="org.jboss.tools.deltacloud.ui.views.CloudViewElement">
+ </instanceof>
+ </iterate>
+ </with>
+ </visibleWhen>
+ </command>
+ <command
+ commandId="org.jboss.tools.deltacloud.ui.filterinstances"
+ label="Filter Instances..."
+ style="push"
+ tooltip="Filter Instances...">
+ <visibleWhen
+ checkEnabled="true">
+ <with
+ variable="selection">
+ <iterate>
+ <instanceof
+
value="org.jboss.tools.deltacloud.ui.views.CloudViewElement">
+ </instanceof>
+ </iterate>
+ </with>
+ </visibleWhen>
+ </command>
</menuContribution>
</extension>
+ <!-- Commands -->
<extension
point="org.eclipse.ui.commands">
<command
@@ -487,6 +604,17 @@
id="org.jboss.tools.deltacloud.ui.destroyinstance"
name="Destroy">
</command>
+ <!-- filter commands -->
+ <command
+ description="Filters images"
+ id="org.jboss.tools.deltacloud.ui.filterimages"
+ name="Filter Images...">
+ </command>
+ <command
+ description="Filters instances"
+ id="org.jboss.tools.deltacloud.ui.filterinstances"
+ name="Filter Instances...">
+ </command>
</extension>
</plugin>
Added:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/FilterImagesHandler.java
===================================================================
---
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/FilterImagesHandler.java
(rev 0)
+++
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/FilterImagesHandler.java 2010-10-14
15:30:40 UTC (rev 25832)
@@ -0,0 +1,68 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.deltacloud.ui.commands;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.commands.IHandler;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.wizard.IWizard;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.handlers.HandlerUtil;
+import org.jboss.tools.deltacloud.core.DeltaCloud;
+import org.jboss.tools.deltacloud.ui.views.CVCloudElement;
+import org.jboss.tools.deltacloud.ui.views.CloudViewElement;
+import org.jboss.tools.internal.deltacloud.ui.utils.UIUtils;
+import org.jboss.tools.internal.deltacloud.ui.wizards.ImageFilter;
+
+/**
+ * @author Andre Dietisheim
+ */
+public class FilterImagesHandler extends AbstractHandler implements IHandler {
+
+ @Override
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ ISelection selection = HandlerUtil.getCurrentSelection(event);
+ if (selection instanceof IStructuredSelection) {
+ CloudViewElement cloudViewElement = UIUtils.getFirstElement(selection,
CloudViewElement.class);
+ createImagesFilter(cloudViewElement, HandlerUtil.getActiveShell(event));
+ }
+
+ return Status.OK_STATUS;
+ }
+
+ private void createImagesFilter(CloudViewElement element, final Shell shell) {
+ if (element != null) {
+ while (element != null && !(element instanceof CVCloudElement)) {
+ element = (CloudViewElement) element.getParent();
+ }
+ if (element != null) {
+ CVCloudElement cve = (CVCloudElement) element;
+ final DeltaCloud cloud = (DeltaCloud) cve.getElement();
+ Display.getDefault().asyncExec(new Runnable() {
+ @Override
+ public void run() {
+ IWizard wizard = new ImageFilter(cloud);
+ WizardDialog dialog = new WizardDialog(shell, wizard);
+ dialog.create();
+ dialog.open();
+ }
+ });
+ }
+
+ }
+ }
+}
Property changes on:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/FilterImagesHandler.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/FilterInstancesHandler.java
===================================================================
---
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/FilterInstancesHandler.java
(rev 0)
+++
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/FilterInstancesHandler.java 2010-10-14
15:30:40 UTC (rev 25832)
@@ -0,0 +1,68 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.deltacloud.ui.commands;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.commands.IHandler;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.wizard.IWizard;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.handlers.HandlerUtil;
+import org.jboss.tools.deltacloud.core.DeltaCloud;
+import org.jboss.tools.deltacloud.ui.views.CVCloudElement;
+import org.jboss.tools.deltacloud.ui.views.CloudViewElement;
+import org.jboss.tools.internal.deltacloud.ui.utils.UIUtils;
+import org.jboss.tools.internal.deltacloud.ui.wizards.InstanceFilter;
+
+/**
+ * @author Andre Dietisheim
+ */
+public class FilterInstancesHandler extends AbstractHandler implements IHandler {
+
+ @Override
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ ISelection selection = HandlerUtil.getCurrentSelection(event);
+ if (selection instanceof IStructuredSelection) {
+ CloudViewElement cloudViewElement = UIUtils.getFirstElement(selection,
CloudViewElement.class);
+ createInstancesFilter(cloudViewElement, HandlerUtil.getActiveShell(event));
+ }
+
+ return Status.OK_STATUS;
+ }
+
+ private void createInstancesFilter(CloudViewElement element, final Shell shell) {
+ if (element != null) {
+ while (element != null && !(element instanceof CVCloudElement)) {
+ element = (CloudViewElement) element.getParent();
+ }
+ if (element != null) {
+ CVCloudElement cve = (CVCloudElement) element;
+ final DeltaCloud cloud = (DeltaCloud) cve.getElement();
+ Display.getDefault().asyncExec(new Runnable() {
+
+ @Override
+ public void run() {
+ IWizard wizard = new InstanceFilter(cloud);
+ WizardDialog dialog = new WizardDialog(shell, wizard);
+ dialog.create();
+ dialog.open();
+ }
+ });
+ }
+ }
+ }
+}
Property changes on:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/FilterInstancesHandler.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/RefreshCloudHandler.java
===================================================================
---
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/RefreshCloudHandler.java
(rev 0)
+++
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/RefreshCloudHandler.java 2010-10-14
15:30:40 UTC (rev 25832)
@@ -0,0 +1,50 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.deltacloud.ui.commands;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.commands.IHandler;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.ui.handlers.HandlerUtil;
+import org.jboss.tools.deltacloud.ui.views.CVCloudElement;
+import org.jboss.tools.deltacloud.ui.views.CloudViewElement;
+import org.jboss.tools.internal.deltacloud.ui.utils.UIUtils;
+
+/**
+ * @author Andre Dietisheim
+ */
+public class RefreshCloudHandler extends AbstractHandler implements IHandler {
+
+ @Override
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ ISelection selection = HandlerUtil.getCurrentSelection(event);
+ if (selection instanceof IStructuredSelection) {
+ CloudViewElement cvImage = UIUtils.getFirstElement(selection,
CloudViewElement.class);
+ refresh(cvImage);
+ }
+
+ return Status.OK_STATUS;
+ }
+
+ private void refresh(CloudViewElement cloudViewElement) {
+ if (cloudViewElement != null) {
+ while (!(cloudViewElement instanceof CVCloudElement))
+ cloudViewElement = (CloudViewElement) cloudViewElement.getParent();
+ CVCloudElement cloud = (CVCloudElement) cloudViewElement;
+ cloud.loadChildren();
+
+ }
+ }
+}
Property changes on:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/RefreshCloudHandler.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVMessages.properties
===================================================================
---
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVMessages.properties 2010-10-14
15:10:58 UTC (rev 25831)
+++
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVMessages.properties 2010-10-14
15:30:40 UTC (rev 25832)
@@ -30,14 +30,9 @@
CloudSelector.label=Select Cloud:
-Refresh.label=Refresh Cloud
Filter.label=Filter...
Filtered.label=filtered
FilteredImages.tooltip=Images shown have been filtered
-ImageFilter.label=Filter Images...
-InstanceFilter.label=Filter Instances...
-CreateInstance.label=Launch Instance
-DeleteInstance.label=Delete Instance
ShowInRSE.label=Show in Remote System Explorer
Start.label=Start
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/DeltaCloudView.java
===================================================================
---
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/DeltaCloudView.java 2010-10-14
15:10:58 UTC (rev 25831)
+++
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/DeltaCloudView.java 2010-10-14
15:30:40 UTC (rev 25832)
@@ -28,7 +28,6 @@
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.ISharedImages;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.part.ViewPart;
import org.eclipse.ui.views.properties.IPropertySheetPage;
@@ -38,7 +37,6 @@
import org.jboss.tools.deltacloud.core.ICloudManagerListener;
import org.jboss.tools.deltacloud.ui.SWTImagesFactory;
import org.jboss.tools.internal.deltacloud.ui.utils.UIUtils;
-import org.jboss.tools.internal.deltacloud.ui.wizards.ImageFilter;
import org.jboss.tools.internal.deltacloud.ui.wizards.InstanceFilter;
public class DeltaCloudView extends ViewPart implements ICloudManagerListener,
@@ -52,23 +50,23 @@
private static final String CONTEXT_MENU_ID = "popup:" + ID;
private static final String VIEW_MENU_ID = "menu:" + ID;
- private static final String REFRESH = "Refresh.label"; //$NON-NLS-1$
- private static final String CREATE_INSTANCE = "CreateInstance.label";
//$NON-NLS-1$
+// private static final String REFRESH = "Refresh.label"; //$NON-NLS-1$
+// private static final String CREATE_INSTANCE = "CreateInstance.label";
//$NON-NLS-1$
// private final static String START_LABEL = "Start.label"; //$NON-NLS-1$
// private final static String STOP_LABEL = "Stop.label"; //$NON-NLS-1$
// private final static String REBOOT_LABEL = "Reboot.label"; //$NON-NLS-1$
// private final static String DESTROY_LABEL = "Destroy.label"; //$NON-NLS-1$
- private final static String IMAGE_FILTER = "ImageFilter.label"; //$NON-NLS-1$
+// private final static String IMAGE_FILTER = "ImageFilter.label";
//$NON-NLS-1$
private final static String INSTANCE_FILTER = "InstanceFilter.label";
//$NON-NLS-1$
public static final String COLLAPSE_ALL = "CollapseAll.label"; //$NON-NLS-1$
private TreeViewer viewer;
- private Action refreshAction;
+// private Action refreshAction;
private Action collapseall;
private Action doubleClickAction;
- private Action imageFilterAction;
- private Action instanceFilterAction;
+// private Action imageFilterAction;
+// private Action instanceFilterAction;
private CloudViewElement selectedElement;
@@ -129,33 +127,26 @@
IActionBars actionBars = getViewSite().getActionBars();
IMenuManager menuManager = actionBars.getMenuManager();
UIUtils.registerContributionManager(VIEW_MENU_ID, menuManager, viewer.getControl());
- // menuMgr.addMenuListener(new IMenuListener() {
- // public void menuAboutToShow(IMenuManager manager) {
- // DeltaCloudView.this.fillLocalPullDown(manager);
- // }
- // });
- // fillLocalPullDown(menuMgr);
- // fillLocalToolBar(bars.getToolBarManager());
}
private void handleSelection() {
IStructuredSelection selection = (IStructuredSelection) viewer.getSelection();
selectedElement = (CloudViewElement) selection.getFirstElement();
- refreshAction.setEnabled(selectedElement != null);
- imageFilterAction.setEnabled(selectedElement != null);
- instanceFilterAction.setEnabled(selectedElement != null);
+// refreshAction.setEnabled(selectedElement != null);
+// imageFilterAction.setEnabled(selectedElement != null);
+// instanceFilterAction.setEnabled(selectedElement != null);
}
private void fillLocalPullDown(IMenuManager manager) {
manager.removeAll();
- manager.add(refreshAction);
- manager.add(imageFilterAction);
- manager.add(instanceFilterAction);
+// manager.add(refreshAction);
+// manager.add(imageFilterAction);
+// manager.add(instanceFilterAction);
}
private void fillContextMenu(IMenuManager manager) {
- manager.add(imageFilterAction);
- manager.add(instanceFilterAction);
+// manager.add(imageFilterAction);
+// manager.add(instanceFilterAction);
// Other plug-ins can contribute there actions here
// manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
}
@@ -165,14 +156,14 @@
}
private void makeActions() {
- refreshAction = createRefreshAction();
+// refreshAction = createRefreshAction();
// startAction = createStartAction();
// stopAction = createStopAction();
// rebootAction = createRebootAction();
// destroyAction = createDestroyAction();
- imageFilterAction = createImageFilterAction();
- instanceFilterAction = createInstanceFilterAction();
+// imageFilterAction = createImageFilterAction();
+// instanceFilterAction = createInstanceFilterAction();
collapseall = createCollapseAllAction();
@@ -198,71 +189,71 @@
return collapseAll;
}
- private Action createInstanceFilterAction() {
- Action instanceFilterAction = new Action() {
- public void run() {
- IStructuredSelection selection = (IStructuredSelection) viewer.getSelection();
- CloudViewElement element = (CloudViewElement) selection.getFirstElement();
- while (element != null && !(element instanceof CVCloudElement)) {
- element = (CloudViewElement) element.getParent();
- }
- if (element != null) {
- CVCloudElement cve = (CVCloudElement) element;
- final DeltaCloud cloud = (DeltaCloud) cve.getElement();
- Display.getDefault().asyncExec(new Runnable() {
+// private Action createInstanceFilterAction() {
+// Action instanceFilterAction = new Action() {
+// public void run() {
+// IStructuredSelection selection = (IStructuredSelection) viewer.getSelection();
+// CloudViewElement element = (CloudViewElement) selection.getFirstElement();
+// while (element != null && !(element instanceof CVCloudElement)) {
+// element = (CloudViewElement) element.getParent();
+// }
+// if (element != null) {
+// CVCloudElement cve = (CVCloudElement) element;
+// final DeltaCloud cloud = (DeltaCloud) cve.getElement();
+// Display.getDefault().asyncExec(new Runnable() {
+//
+// @Override
+// public void run() {
+// Shell shell = viewer.getControl().getShell();
+// IWizard wizard = new InstanceFilter(cloud);
+// WizardDialog dialog = new WizardDialog(shell, wizard);
+// dialog.create();
+// dialog.open();
+// }
+//
+// });
+// }
+// }
+// };
+// instanceFilterAction.setText(CVMessages.getString(INSTANCE_FILTER));
+// instanceFilterAction.setToolTipText(CVMessages.getString(INSTANCE_FILTER));
+// instanceFilterAction.setEnabled(selectedElement != null);
+//
+// return instanceFilterAction;
+// }
- @Override
- public void run() {
- Shell shell = viewer.getControl().getShell();
- IWizard wizard = new InstanceFilter(cloud);
- WizardDialog dialog = new WizardDialog(shell, wizard);
- dialog.create();
- dialog.open();
- }
+// private Action createImageFilterAction() {
+// Action imageFilterAction = new Action() {
+// public void run() {
+// IStructuredSelection selection = (IStructuredSelection) viewer.getSelection();
+// CloudViewElement element = (CloudViewElement) selection.getFirstElement();
+// while (element != null && !(element instanceof CVCloudElement)) {
+// element = (CloudViewElement) element.getParent();
+// }
+// if (element != null) {
+// CVCloudElement cve = (CVCloudElement) element;
+// final DeltaCloud cloud = (DeltaCloud) cve.getElement();
+// Display.getDefault().asyncExec(new Runnable() {
+//
+// @Override
+// public void run() {
+// Shell shell = viewer.getControl().getShell();
+// IWizard wizard = new ImageFilter(cloud);
+// WizardDialog dialog = new WizardDialog(shell, wizard);
+// dialog.create();
+// dialog.open();
+// }
+//
+// });
+// }
+// }
+// };
+// imageFilterAction.setText(CVMessages.getString(IMAGE_FILTER));
+// imageFilterAction.setToolTipText(CVMessages.getString(IMAGE_FILTER));
+// imageFilterAction.setEnabled(selectedElement != null);
+// return imageFilterAction;
+// }
- });
- }
- }
- };
- instanceFilterAction.setText(CVMessages.getString(INSTANCE_FILTER));
- instanceFilterAction.setToolTipText(CVMessages.getString(INSTANCE_FILTER));
- instanceFilterAction.setEnabled(selectedElement != null);
-
- return instanceFilterAction;
- }
-
- private Action createImageFilterAction() {
- Action imageFilterAction = new Action() {
- public void run() {
- IStructuredSelection selection = (IStructuredSelection) viewer.getSelection();
- CloudViewElement element = (CloudViewElement) selection.getFirstElement();
- while (element != null && !(element instanceof CVCloudElement)) {
- element = (CloudViewElement) element.getParent();
- }
- if (element != null) {
- CVCloudElement cve = (CVCloudElement) element;
- final DeltaCloud cloud = (DeltaCloud) cve.getElement();
- Display.getDefault().asyncExec(new Runnable() {
-
- @Override
- public void run() {
- Shell shell = viewer.getControl().getShell();
- IWizard wizard = new ImageFilter(cloud);
- WizardDialog dialog = new WizardDialog(shell, wizard);
- dialog.create();
- dialog.open();
- }
-
- });
- }
- }
- };
- imageFilterAction.setText(CVMessages.getString(IMAGE_FILTER));
- imageFilterAction.setToolTipText(CVMessages.getString(IMAGE_FILTER));
- imageFilterAction.setEnabled(selectedElement != null);
- return imageFilterAction;
- }
-
// private Action createDestroyAction() {
// Action destroyAction = new Action() {
// public void run() {
@@ -399,27 +390,27 @@
// return startAction;
// }
- private Action createRefreshAction() {
- Action refreshAction = new Action() {
- public void run() {
- ISelection selection = viewer.getSelection();
- Object obj = ((IStructuredSelection) selection).getFirstElement();
- if (obj instanceof CloudViewElement) {
- CloudViewElement element = (CloudViewElement) obj;
- while (!(element instanceof CVCloudElement))
- element = (CloudViewElement) element.getParent();
- CVCloudElement cloud = (CVCloudElement) element;
- cloud.loadChildren();
- }
- }
- };
- refreshAction.setText(CVMessages.getString(REFRESH));
- refreshAction.setToolTipText(CVMessages.getString(REFRESH));
- refreshAction.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().
- getImageDescriptor(ISharedImages.IMG_TOOL_REDO));
- refreshAction.setEnabled(selectedElement != null);
- return refreshAction;
- }
+// private Action createRefreshAction() {
+// Action refreshAction = new Action() {
+// public void run() {
+// ISelection selection = viewer.getSelection();
+// Object obj = ((IStructuredSelection) selection).getFirstElement();
+// if (obj instanceof CloudViewElement) {
+// CloudViewElement element = (CloudViewElement) obj;
+// while (!(element instanceof CVCloudElement))
+// element = (CloudViewElement) element.getParent();
+// CVCloudElement cloud = (CVCloudElement) element;
+// cloud.loadChildren();
+// }
+// }
+// };
+// refreshAction.setText(CVMessages.getString(REFRESH));
+// refreshAction.setToolTipText(CVMessages.getString(REFRESH));
+// refreshAction.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().
+// getImageDescriptor(ISharedImages.IMG_TOOL_REDO));
+// refreshAction.setEnabled(selectedElement != null);
+// return refreshAction;
+// }
// private Action createEditCloudAction() {
// Action editCloud = new Action() {