Skip to content

Instantly share code, notes, and snippets.

Created February 10, 2016 13:47
What would you like to do?
This script runs with Eclipse EASE Jython engine. It allows you to start a file browser using the current selection.
# name : Explore from here
# popup : enableFor(org.eclipse.core.resources.IResource)
# description : Start a file browser using current selection
selection = getSelection()
if isinstance(selection, org.eclipse.jface.viewers.IStructuredSelection):
selection = selection.getFirstElement()
if not isinstance(selection, org.eclipse.core.resources.IResource):
selection = adapt(selection, org.eclipse.core.resources.IResource)
if isinstance(selection, org.eclipse.core.resources.IFile):
selection = selection.getParent()
if isinstance(selection, org.eclipse.core.resources.IContainer):
runProcess("explorer.exe", [selection.getLocation().toFile().toString()])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment