Created
February 10, 2016 13:47
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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