Skip to content

Instantly share code, notes, and snippets.

@tracymiranda
Created February 10, 2016 13:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tracymiranda/8aa3f0fc4bf44f4a5cd3 to your computer and use it in GitHub Desktop.
Save tracymiranda/8aa3f0fc4bf44f4a5cd3 to your computer and use it in GitHub Desktop.
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
loadModule("/System/Platform")
loadModule('/System/UI')
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