diff options
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.releng.winexplorer/src/org/eclipse/emf/cdo/releng/winexplorer/ExplorerAction.java')
-rw-r--r-- | plugins/org.eclipse.emf.cdo.releng.winexplorer/src/org/eclipse/emf/cdo/releng/winexplorer/ExplorerAction.java | 49 |
1 files changed, 6 insertions, 43 deletions
diff --git a/plugins/org.eclipse.emf.cdo.releng.winexplorer/src/org/eclipse/emf/cdo/releng/winexplorer/ExplorerAction.java b/plugins/org.eclipse.emf.cdo.releng.winexplorer/src/org/eclipse/emf/cdo/releng/winexplorer/ExplorerAction.java index 00a3eab1ca..99b3978b3a 100644 --- a/plugins/org.eclipse.emf.cdo.releng.winexplorer/src/org/eclipse/emf/cdo/releng/winexplorer/ExplorerAction.java +++ b/plugins/org.eclipse.emf.cdo.releng.winexplorer/src/org/eclipse/emf/cdo/releng/winexplorer/ExplorerAction.java @@ -10,60 +10,23 @@ */ package org.eclipse.emf.cdo.releng.winexplorer; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IResource; -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.ui.IObjectActionDelegate; -import org.eclipse.ui.IWorkbenchPart; +import org.eclipse.core.resources.IContainer; import java.io.File; -import java.io.IOException; /** * @author Eike Stepper */ -public class ExplorerAction implements IObjectActionDelegate +public class ExplorerAction extends AbstractContainerAction { - private IResource resource; - public ExplorerAction() { } - public void setActivePart(IAction action, IWorkbenchPart targetPart) - { - } - - public void selectionChanged(IAction action, ISelection selection) - { - resource = null; - if (selection instanceof IStructuredSelection) - { - IStructuredSelection ssel = (IStructuredSelection)selection; - Object element = ssel.getFirstElement(); - if (element instanceof IResource) - { - resource = (IResource)element; - if (resource instanceof IFile) - { - resource = resource.getParent(); - } - } - } - } - - public void run(IAction action) + @Override + protected void run(IContainer container) throws Exception { - try - { - String location = resource.getLocation().toString().replace('/', File.separatorChar); - Runtime.getRuntime().exec("explorer.exe \"" + location + "\""); - } - catch (IOException ex) - { - ex.printStackTrace(); - } + String location = container.getLocation().toString().replace('/', File.separatorChar); + Runtime.getRuntime().exec("explorer.exe \"" + location + "\""); } } |